Skip to content

Commit ad311d8

Browse files
authored
Fix compatibility for CUDA 13. (#2897)
1 parent 29fa0ba commit ad311d8

3 files changed

Lines changed: 17 additions & 23 deletions

File tree

lib/cudadrv/state.jl

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -216,20 +216,14 @@ function context(dev::CuDevice)
216216
end
217217

218218
# check if the device isn't too old
219-
if capability(dev) < v"3.5"
219+
if capability(dev) < v"5.0"
220220
@error("""Your $(name(dev)) GPU (compute capability $(capability(dev).major).$(capability(dev).minor)) is not supported by CUDA.jl.
221-
Please use a device with at least capability 3.5.""",
221+
Please use a device with at least capability 5.0, or downgrade CUDA.jl (see the README for compatibility details).""",
222222
maxlog=1, _id=devidx)
223-
elseif runtime_version() >= v"12" && capability(dev) <= v"3.7"
224-
@error("""Your $(name(dev)) GPU (compute capability $(capability(dev).major).$(capability(dev).minor)) is not supported on CUDA 12+.
225-
Please use CUDA 11.8 or earlier (by calling `CUDA.set_runtime_version!`), or switch to a different device.""",
223+
elseif runtime_version() >= v"13" && capability(dev) <= v"7.5"
224+
@error("""Your $(name(dev)) GPU (compute capability $(capability(dev).major).$(capability(dev).minor)) is not supported on CUDA 13+.
225+
Please use a device with at least capability 7.5, or downgrade your NVIDIA driver to below v580.""",
226226
maxlog=1, _id=devidx)
227-
elseif runtime_version() >= v"11" && capability(dev) <= v"3.7"
228-
# XXX: the 10.2 release notes mention that even sm_50 is deprecated,
229-
# but that isn't repeated in more recent release notes...
230-
@warn("""Your $(name(dev)) GPU (compute capability $(capability(dev).major).$(capability(dev).minor)) is deprecated on CUDA 11+.
231-
Some functionality may be broken; It's recommended to switch to a different device.""",
232-
maxlog=1, _id=devidx)
233227
end
234228
# ... or too new
235229
if !in(capability(dev), cuda_compat().cap)

src/compatibility.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ const cuda_cap_db = Dict(
4141
v"3.0" => between(v"4.2", v"10.2"),
4242
v"3.2" => between(v"6.0", v"10.2"),
4343
v"3.5" => between(v"5.0", v"11.8"),
44-
v"3.7" => between(v"6.5", highest),
45-
v"5.0" => between(v"6.0", highest),
46-
v"5.2" => between(v"7.0", highest),
47-
v"5.3" => between(v"7.5", highest),
48-
v"6.0" => between(v"8.0", highest),
49-
v"6.1" => between(v"8.0", highest),
50-
v"6.2" => between(v"8.0", highest),
51-
v"7.0" => between(v"9.0", highest),
52-
v"7.2" => between(v"9.2", highest),
44+
v"3.7" => between(v"6.5", v"11.8"),
45+
v"5.0" => between(v"6.0", v"12.9"),
46+
v"5.2" => between(v"7.0", v"12.9"),
47+
v"5.3" => between(v"7.5", v"12.9"),
48+
v"6.0" => between(v"8.0", v"12.9"),
49+
v"6.1" => between(v"8.0", v"12.9"),
50+
v"6.2" => between(v"8.0", v"12.9"),
51+
v"7.0" => between(v"9.0", v"12.9"),
52+
v"7.2" => between(v"9.2", v"12.9"),
5353
v"7.5" => between(v"10.0", highest),
5454
v"8.0" => between(v"11.0", highest),
5555
v"8.6" => between(v"11.1", highest),

src/initialization.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ function __init__()
130130
end
131131

132132
# ensure the loaded runtime is supported
133-
if runtime < v"12.0"
133+
if runtime < v"12"
134134
@error "This version of CUDA.jl only supports CUDA 12 or higher (your toolkit provides CUDA $runtime)"
135135
end
136-
if runtime.major > driver.major
137-
@warn """You are using CUDA $runtime with a driver that only supports up to $(driver.major).x.
136+
if runtime.major != driver.major
137+
@warn """You are using CUDA $runtime with a driver for CUDA $(driver.major).x.
138138
It is recommended to upgrade your driver, or switch to automatic installation of CUDA."""
139139
end
140140

0 commit comments

Comments
 (0)