Skip to content

Commit aad0a4c

Browse files
authored
Guard the initialization-time CUDA driver check in a try/catch. (#1881)
On badly-configured systems, this call may crash.
1 parent 2693111 commit aad0a4c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/initialization.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ function __init__()
5757
return
5858
end
5959
end
60-
driver = driver_version()
60+
61+
driver = try
62+
driver_version()
63+
catch err
64+
@debug "CUDA driver failed to report a version" exception=(err, catch_backtrace())
65+
_initialization_error[] = "CUDA driver not functional"
66+
return
67+
end
6168

6269
if driver < v"11"
6370
@error "This version of CUDA.jl only supports NVIDIA drivers for CUDA 11.x or higher (yours is for CUDA $driver)"

0 commit comments

Comments
 (0)