Skip to content

Commit e1268a6

Browse files
authored
Merge pull request #1801 from FluxML/lk/add-gpu-warn
Add warning if the GPU function is called and CUDA is not available
2 parents 589780c + 5739572 commit e1268a6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/functor.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ function check_use_cuda()
183183
if use_cuda[] && !CUDA.has_cudnn()
184184
@warn "CUDA.jl found cuda, but did not find libcudnn. Some functionality will not be available."
185185
end
186+
if !(use_cuda[])
187+
@info """The GPU function is being called but the GPU is not accessible.
188+
Defaulting back to the CPU. (No action is required if you want to run on the CPU).""" maxlog=1
189+
end
186190
end
187191
end
188192
Zygote.@nograd check_use_cuda

0 commit comments

Comments
 (0)