From c45cec4cba587da9461bfb55ffe276758f442031 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Tue, 19 Nov 2019 16:05:41 +0100 Subject: [PATCH] Simplify warning. --- Project.toml | 2 -- src/Flux.jl | 13 ++++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Project.toml b/Project.toml index eae220d8..7f4ab464 100644 --- a/Project.toml +++ b/Project.toml @@ -5,7 +5,6 @@ version = "0.9.0" [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -CUDAdrv = "c5f51814-7f29-56b8-a69c-e4d8f6be1fde" CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" CuArrays = "3a865a2d-5b23-5a0f-bc46-62713ec82fae" @@ -25,7 +24,6 @@ ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" [compat] -CUDAdrv = "4.0.3" CuArrays = "1.4.3" NNlib = "0.6" Zygote = "0.4" diff --git a/src/Flux.jl b/src/Flux.jl index a6132a0b..d0e0d5bf 100644 --- a/src/Flux.jl +++ b/src/Flux.jl @@ -21,8 +21,7 @@ export SGD, Descent, ADAM, Momentum, Nesterov, RMSProp, ADAMW, RADAM, InvDecay, ExpDecay, WeightDecay -ENV["CUDA_INIT_SILENT"] = true -using CUDAdrv, CuArrays +using CuArrays const use_cuda = Ref(false) include("utils.jl") @@ -40,12 +39,8 @@ include("data/Data.jl") include("deprecations.jl") function __init__() - if !CUDAdrv.functional() - # nothing to do here, the user doesn't have CUDA - elseif length(devices()) == 0 - @warn "CUDA available, but no GPU detected" - elseif !CuArrays.functional() - @warn "CUDA GPU available, but CuArrays.jl failed to load" + if !CuArrays.functional() + # nothing to do here, and either CuArrays or one of its dependencies will have warned else use_cuda[] = true @@ -54,7 +49,7 @@ function __init__() if CuArrays.has_cudnn() include(joinpath(@__DIR__, "cuda/cuda.jl")) else - @warn "CUDA GPU available, but CuArrays.jl did not find libcudnn. Some functionality will not be available." + @warn "CuArrays.jl did not find libcudnn. Some functionality will not be available." end end end