Skip to content

Commit e6ab661

Browse files
committed
Improve error message when no runtime is available.
1 parent ae7edb4 commit e6ab661

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

src/initialization.jl

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ function __init__()
6161
end
6262
driver = driver_version()
6363

64-
if driver < v"11"
65-
@error "This version of CUDA.jl only supports NVIDIA drivers for CUDA 11 or higher (yours is for CUDA $driver)"
66-
_initialization_error[] = "CUDA driver too old"
64+
if driver < v"11" || driver >= v"13"
65+
@error "This version of CUDA.jl only supports NVIDIA drivers for CUDA 11.x or 12.x (yours is for CUDA $driver)"
66+
_initialization_error[] = "CUDA driver too old or too new"
6767
return
6868
end
6969

@@ -74,14 +74,22 @@ function __init__()
7474

7575
# check that we have a runtime
7676
if !CUDA_Runtime.is_available()
77-
@error """No CUDA Runtime library found. This can have several reasons:
78-
* you are using an unsupported platform: CUDA.jl only supports Linux (x86_64, aarch64, ppc64le), and Windows (x86_64).
79-
refer to the documentation for instructions on how to use a custom CUDA runtime.
80-
* you precompiled CUDA.jl in an environment where the CUDA driver was not available.
81-
in that case, you need to specify (during pre compilation) which version of CUDA to use.
82-
refer to the documentation for instructions on how to use `CUDA.set_runtime_version!`.
83-
* you requested use of a local CUDA toolkit, but not all components were discovered.
84-
try running with JULIA_DEBUG=CUDA_Runtime_Discovery for more information."""
77+
@error """CUDA.jl could not find an appropriate CUDA runtime to use.
78+
79+
This can have several reasons:
80+
* you are using an unsupported platform: this version of CUDA.jl
81+
only supports Linux (x86_64, aarch64, ppc64le) and Windows (x86_64),
82+
while your platform was identified as $(Base.BinaryPlatforms.triplet(CUDNN_jll.host_platform));
83+
* you precompiled CUDA.jl in an environment where the CUDA driver
84+
was not available (i.e., a container, or an HPC login node).
85+
in that case, you need to specify which CUDA version to use
86+
by calling `CUDA.set_runtime_version!`;
87+
* you requested use of a local CUDA toolkit, but not all
88+
required components were discovered. try running with
89+
JULIA_DEBUG=all in your environment for more details.
90+
91+
For more details, refer to the CUDA.jl documentation at
92+
https://cuda.juliagpu.org/stable/installation/overview/"""
8593
_initialization_error[] = "CUDA runtime not found"
8694
return
8795
end

0 commit comments

Comments
 (0)