Skip to content

Commit

Permalink
expose env var to disallow cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Jan 14, 2022
1 parent 79dbbd6 commit ebc1b30
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/functor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ end

function check_use_cuda()
if use_cuda[] === nothing
if get(ENV, "FLUX_DISALLOW_CUDA", "true") in ("1", "true")
use_cuda[] = false
@debug "Flux: CUDA disallowed" ENV["FLUX_DISALLOW_CUDA"]
return
end
use_cuda[] = CUDA.functional()
if use_cuda[] && !CUDA.has_cudnn()
@warn "CUDA.jl found cuda, but did not find libcudnn. Some functionality will not be available."
Expand Down

0 comments on commit ebc1b30

Please sign in to comment.