Simplify warning.
This commit is contained in:
parent
bd734ed957
commit
c45cec4cba
|
@ -5,7 +5,6 @@ version = "0.9.0"
|
||||||
[deps]
|
[deps]
|
||||||
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
|
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
|
||||||
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
|
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
|
||||||
CUDAdrv = "c5f51814-7f29-56b8-a69c-e4d8f6be1fde"
|
|
||||||
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
|
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
|
||||||
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
|
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
|
||||||
CuArrays = "3a865a2d-5b23-5a0f-bc46-62713ec82fae"
|
CuArrays = "3a865a2d-5b23-5a0f-bc46-62713ec82fae"
|
||||||
|
@ -25,7 +24,6 @@ ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"
|
||||||
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
|
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
|
||||||
|
|
||||||
[compat]
|
[compat]
|
||||||
CUDAdrv = "4.0.3"
|
|
||||||
CuArrays = "1.4.3"
|
CuArrays = "1.4.3"
|
||||||
NNlib = "0.6"
|
NNlib = "0.6"
|
||||||
Zygote = "0.4"
|
Zygote = "0.4"
|
||||||
|
|
13
src/Flux.jl
13
src/Flux.jl
|
@ -21,8 +21,7 @@ export SGD, Descent, ADAM, Momentum, Nesterov, RMSProp,
|
||||||
ADAMW, RADAM, InvDecay, ExpDecay, WeightDecay
|
ADAMW, RADAM, InvDecay, ExpDecay, WeightDecay
|
||||||
|
|
||||||
|
|
||||||
ENV["CUDA_INIT_SILENT"] = true
|
using CuArrays
|
||||||
using CUDAdrv, CuArrays
|
|
||||||
const use_cuda = Ref(false)
|
const use_cuda = Ref(false)
|
||||||
|
|
||||||
include("utils.jl")
|
include("utils.jl")
|
||||||
|
@ -40,12 +39,8 @@ include("data/Data.jl")
|
||||||
include("deprecations.jl")
|
include("deprecations.jl")
|
||||||
|
|
||||||
function __init__()
|
function __init__()
|
||||||
if !CUDAdrv.functional()
|
if !CuArrays.functional()
|
||||||
# nothing to do here, the user doesn't have CUDA
|
# nothing to do here, and either CuArrays or one of its dependencies will have warned
|
||||||
elseif length(devices()) == 0
|
|
||||||
@warn "CUDA available, but no GPU detected"
|
|
||||||
elseif !CuArrays.functional()
|
|
||||||
@warn "CUDA GPU available, but CuArrays.jl failed to load"
|
|
||||||
else
|
else
|
||||||
use_cuda[] = true
|
use_cuda[] = true
|
||||||
|
|
||||||
|
@ -54,7 +49,7 @@ function __init__()
|
||||||
if CuArrays.has_cudnn()
|
if CuArrays.has_cudnn()
|
||||||
include(joinpath(@__DIR__, "cuda/cuda.jl"))
|
include(joinpath(@__DIR__, "cuda/cuda.jl"))
|
||||||
else
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue