Skip to content

Commit 42b5759

Browse files
github-actions[bot]CompatHelper JuliaranochaJoshuaLampertvchuravy
authored
use CUDACore instead of CUDA v6
* CompatHelper: bump compat for CUDA in [weakdeps] to 6, (keep existing compat) * CompatHelper: bump compat for CUDA to 6 for package test, (keep existing compat) (#2926) Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org> * make CUDA extension for CUDACore and CUDATools instead of complete CUDA * Update ext/TrixiCUDAExt.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * only CUDA v6 in tests * update compat bounds according to downgrade CI * compat bounds for test directory according to downgrade * Drop NVML usage * fix benchmark * Apply suggestions from code review Co-authored-by: Valentin Churavy <v.churavy@gmail.com> * Apply suggestions from code review Co-authored-by: Joshua Lampert <51029046+JoshuaLampert@users.noreply.github.com> * rename extension to TrixiCUDACoreExt * order --------- Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org> Co-authored-by: Hendrik Ranocha <ranocha@users.noreply.github.com> Co-authored-by: Joshua Lampert <51029046+JoshuaLampert@users.noreply.github.com> Co-authored-by: Valentin Churavy <v.churavy@gmail.com>
1 parent 29765b9 commit 42b5759

4 files changed

Lines changed: 46 additions & 77 deletions

File tree

Project.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
5757

5858
[weakdeps]
5959
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
60-
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
60+
CUDACore = "bd0ed864-bdfe-4181-a5ed-ce625a5fdea2"
6161
Convex = "f65535da-76fb-5f13-bab9-19810c17039a"
6262
ECOS = "e2685f51-7e38-5353-a97d-a921fd2c8199"
6363
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
@@ -68,7 +68,7 @@ SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
6868

6969
[extensions]
7070
TrixiAMDGPUExt = "AMDGPU"
71-
TrixiCUDAExt = "CUDA"
71+
TrixiCUDACoreExt = "CUDACore"
7272
TrixiConvexECOSExt = ["Convex", "ECOS"]
7373
TrixiMakieExt = "Makie"
7474
TrixiNLsolveExt = "NLsolve"
@@ -81,15 +81,15 @@ AMDGPU = "2.2.1"
8181
AcceleratedKernels = "0.4.3"
8282
Accessors = "0.1.42"
8383
Adapt = "4.4"
84-
Atomix = "1.0.1"
85-
CUDA = "5.9.1"
84+
Atomix = "1.1.3"
85+
CUDACore = "6.0.1"
8686
CodeTracking = "1.0.5, 2, 3"
8787
ConstructionBase = "1.5.8"
8888
Convex = "0.16"
89-
DataStructures = "0.18.15, 0.19"
89+
DataStructures = "0.19"
9090
DelimitedFiles = "1"
91-
DiffEqBase = "6.184, 7"
92-
DiffEqCallbacks = "2.35, 3, 4"
91+
DiffEqBase = "6.215, 7"
92+
DiffEqCallbacks = "4.9"
9393
Downloads = "1.6"
9494
ECOS = "1.1.2"
9595
EllipsisNotation = "1.0"
@@ -101,29 +101,29 @@ KernelAbstractions = "0.9.38"
101101
LinearAlgebra = "1"
102102
LinearMaps = "2.7, 3.0"
103103
LoopVectorization = "0.12.171"
104-
MPI = "0.20.23"
104+
MPI = "0.20.25"
105105
Makie = "0.22, 0.23, 0.24"
106106
MuladdMacro = "0.2.4"
107107
NLsolve = "4.5.1"
108108
Octavian = "0.3.28"
109109
OffsetArrays = "1.13"
110-
OrdinaryDiffEqCore = "1.26, 2, 3, 4.2"
110+
OrdinaryDiffEqCore = "3.27, 4.2"
111111
P4est = "0.4.12"
112112
Plots = "1.38.13"
113113
Polyester = "=0.7.16, 0.7.18"
114114
PrecompileTools = "1.2.1"
115115
Preferences = "1.5"
116116
Printf = "1"
117117
RecipesBase = "1.3.4"
118-
RecursiveArrayTools = "3.37, 4"
118+
RecursiveArrayTools = "3.52, 4"
119119
Reexport = "1.2.2"
120-
SciMLBase = "2.128, 3"
120+
SciMLBase = "2.154, 3"
121121
SimpleUnPack = "1.1"
122122
SparseArrays = "1"
123123
SparseConnectivityTracer = "1.0.1"
124124
StableRNGs = "1.0.2"
125125
StartUpDG = "1.1.5"
126-
Static = "1.1.1"
126+
Static = "1.2"
127127
StaticArrayInterface = "1.5.1"
128128
StaticArrays = "1.9.8"
129129
StrideArrays = "0.1.29"

benchmark/CUDA/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Trixi = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb"
99
Trixi = {path = "../.."}
1010

1111
[compat]
12-
CUDA = "5.8.2"
12+
CUDA = "6"
1313
JSON = "1.4.0"
1414
OrdinaryDiffEqLowStorageRK = "1.12.0"
1515
TimerOutputs = "0.5.25"
Lines changed: 16 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Package extension for adding CUDA-based features to Trixi.jl
2-
module TrixiCUDAExt
2+
module TrixiCUDACoreExt
33

4-
using CUDA: CUDA, CuArray, CuDeviceArray, CUDABackend, KernelAdaptor, @device_override
4+
using CUDACore: CUDACore, CuArray, CuDeviceArray, CUDABackend, KernelAdaptor,
5+
@device_override
56
import Trixi
67

78
function Trixi.storage_type(::Type{<:CuArray})
@@ -28,82 +29,50 @@ function Trixi.trixi_backend_info!(setup, ::CUDABackend)
2829
push!(setup, "Backend" => "KernelAbstractions CUDA")
2930
# Reimplementation of CUDA.versioninfo() to fit with Trixi's summary box format
3031
# see https://github.com/JuliaGPU/CUDA.jl/blob/9f56ee20afef4a770a028066d2fa9e7825d258da/src/utilities.jl#L41
31-
if !CUDA.functional()
32+
if !CUDACore.functional()
3233
push!(setup, "CUDA" => "CUDA not functional")
3334
return nothing
3435
end
3536

3637
push!(setup, "CUDA toolchain:" => "")
37-
push!(setup, " - runtime" => string(CUDA.runtime_version()))
38+
push!(setup, " - runtime" => string(CUDACore.runtime_version()))
3839
push!(setup,
39-
" - toolkit" => CUDA.local_toolkit ? "local installation" :
40+
" - toolkit" => CUDACore.local_toolkit ? "local installation" :
4041
"artifact installation")
41-
42-
if CUDA.has_nvml()
43-
driver_str = string(CUDA.NVML.driver_version())
44-
else
45-
driver_str = "unknown"
46-
end
47-
driver_str *= " for $(CUDA.driver_version())"
48-
push!(setup, " - driver" => driver_str)
49-
push!(setup, " - compiler" => string(CUDA.compiler_version()))
42+
push!(setup, " - driver" => string(CUDACore.driver_version()))
43+
push!(setup, " - compiler" => string(CUDACore.compiler_version()))
5044

5145
# Skip CUDA libraries
5246
# Skip Julia packages
5347
# Skip Toolchain
5448
# Skip Environment
5549
# Skip Preferences
5650

57-
devs = CUDA.devices()
51+
devs = CUDACore.devices()
5852
if isempty(devs)
5953
push!(setup, "CUDA devices" => "none")
6054
else
6155
push!(setup, "CUDA devices:" => "")
6256
end
6357
for (i, dev) in enumerate(devs)
64-
function query_nvml()
65-
mig = CUDA.uuid(dev) != CUDA.parent_uuid(dev)
66-
nvml_gpu = CUDA.NVML.Device(CUDA.parent_uuid(dev))
67-
nvml_dev = CUDA.NVML.Device(CUDA.uuid(dev); mig)
68-
69-
str = CUDA.NVML.name(nvml_dev)
70-
cap = CUDA.NVML.compute_capability(nvml_gpu)
71-
mem = CUDA.NVML.memory_info(nvml_dev)
72-
73-
(; str, cap, mem)
74-
end
75-
7658
function query_cuda()
77-
str = CUDA.name(dev)
78-
cap = CUDA.capability(dev)
79-
mem = CUDA.device!(dev) do
80-
# this requires a device context, so we prefer NVML
81-
(free = CUDA.free_memory(), total = CUDA.total_memory())
59+
str = CUDACore.name(dev)
60+
cap = CUDACore.capability(dev)
61+
mem = CUDACore.device!(dev) do
62+
(free = CUDACore.free_memory(), total = CUDACore.total_memory())
8263
end
8364
(; str, cap, mem)
8465
end
8566

86-
str, cap, mem = if CUDA.has_nvml()
87-
try
88-
query_nvml()
89-
catch err
90-
if !isa(err, CUDA.NVML.NVMLError) ||
91-
!in(err.code,
92-
[CUDA.NVML.ERROR_NOT_SUPPORTED, CUDA.NVML.ERROR_NO_PERMISSION])
93-
rethrow()
94-
end
95-
query_cuda()
96-
end
97-
else
98-
query_cuda()
99-
end
67+
str, cap, mem = query_cuda()
68+
10069
push!(setup,
10170
" $i" => "$str (sm_$(cap.major)$(cap.minor), $(Base.format_bytes(mem.free)) / $(Base.format_bytes(mem.total)) available)")
10271
end
10372
end
10473

10574
function Trixi.trixi_device_memory_use(::CUDABackend)
106-
info = CUDA.MemoryInfo()
75+
info = CUDACore.MemoryInfo()
10776
used_bytes = info.total_bytes - info.free_bytes
10877
return used_bytes
10978
end

test/Project.toml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
4444
TrixiTest = "0a316866-cbd0-4425-8bcb-08103b2c1f26"
4545

4646
[compat]
47-
ADTypes = "1.14"
47+
ADTypes = "1.16"
4848
AMDGPU = "2.2.1"
4949
Accessors = "0.1.42"
5050
Adapt = "4.4"
5151
Aqua = "0.8"
52-
CUDA = "5.9.1"
52+
CUDA = "6"
5353
CairoMakie = "0.13, 0.14, 0.15"
5454
Convex = "0.16"
5555
DelimitedFiles = "1"
@@ -62,28 +62,28 @@ ForwardDiff = "0.10.38, 1"
6262
GPUCompiler = "1.4 - 1.9"
6363
Krylov = "0.10"
6464
LinearAlgebra = "1"
65-
LinearSolve = "3.54"
66-
MPI = "0.20.23"
65+
LinearSolve = "3.73"
66+
MPI = "0.20.25"
6767
NLsolve = "4.5.1"
68-
OrdinaryDiffEqBDF = "1.1, 2"
69-
OrdinaryDiffEqCore = "1.26, 2, 3, 4.2"
70-
OrdinaryDiffEqFeagin = "1, 2"
71-
OrdinaryDiffEqHighOrderRK = "1.1, 2"
72-
OrdinaryDiffEqLowOrderRK = "1.2, 2"
73-
OrdinaryDiffEqLowStorageRK = "1.2, 2, 3"
74-
OrdinaryDiffEqSDIRK = "1.1, 2"
75-
OrdinaryDiffEqSSPRK = "1.2, 2"
76-
OrdinaryDiffEqStabilizedRK = "1.3, 2"
77-
OrdinaryDiffEqTsit5 = "1.1, 2"
68+
OrdinaryDiffEqBDF = "1.24, 2"
69+
OrdinaryDiffEqCore = "3.27, 4.2"
70+
OrdinaryDiffEqFeagin = "1.10, 2"
71+
OrdinaryDiffEqHighOrderRK = "1.11, 2"
72+
OrdinaryDiffEqLowOrderRK = "1.12, 2"
73+
OrdinaryDiffEqLowStorageRK = "1.14, 2, 3"
74+
OrdinaryDiffEqSDIRK = "1.14, 2"
75+
OrdinaryDiffEqSSPRK = "1.13, 2"
76+
OrdinaryDiffEqStabilizedRK = "1.10, 2"
77+
OrdinaryDiffEqTsit5 = "1.11, 2"
7878
Plots = "1.38.13"
7979
Printf = "1"
8080
Quadmath = "0.5.10, 1"
8181
Random = "1"
82-
SciMLBase = "2.128, 3"
83-
SciMLOperators = "1.13"
82+
SciMLBase = "2.154, 3"
83+
SciMLOperators = "1.15"
8484
SparseArrays = "1"
8585
SparseConnectivityTracer = "1.0.1"
86-
SparseMatrixColorings = "0.4.21"
86+
SparseMatrixColorings = "0.4.27"
8787
StableRNGs = "1.0.2"
8888
Test = "1"
8989
TrixiTest = "0.2.1"

0 commit comments

Comments
 (0)