Skip to content

Commit

Permalink
Simplify warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Nov 19, 2019
1 parent bd734ed commit c45cec4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
13 changes: 4 additions & 9 deletions src/Flux.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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

Expand All @@ -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
Expand Down

0 comments on commit c45cec4

Please sign in to comment.