Skip to content

Commit 1a6b715

Browse files
cuda support for 12.3 .. 12.5 (#1119)
* cuda support for 12.3 .. 12.5 * cuda 12.3 to 12.5 support * patch version update * review comments addressed
1 parent d849e12 commit 1a6b715

File tree

6 files changed

+126
-13
lines changed

6 files changed

+126
-13
lines changed

src/nvidia-cuda/devcontainer-feature.json

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "nvidia-cuda",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"name": "NVIDIA CUDA",
55
"description": "Installs shared libraries for NVIDIA CUDA.",
66
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/nvidia-cuda",
@@ -28,6 +28,9 @@
2828
"cudaVersion": {
2929
"type": "string",
3030
"proposals": [
31+
"12.5",
32+
"12.4",
33+
"12.3",
3134
"12.2",
3235
"12.1",
3336
"12.0",
@@ -45,15 +48,15 @@
4548
"cudnnVersion": {
4649
"type": "string",
4750
"proposals": [
48-
"8.9.5.29",
49-
"8.9.4.25",
50-
"8.9.3.28",
51-
"8.9.2.26",
52-
"8.9.1.23",
53-
"8.9.0.131",
54-
"8.8.1.3",
55-
"8.8.0.121",
56-
"8.7.0.84",
51+
"8.9.5.29",
52+
"8.9.4.25",
53+
"8.9.3.28",
54+
"8.9.2.26",
55+
"8.9.1.23",
56+
"8.9.0.131",
57+
"8.8.1.3",
58+
"8.8.0.121",
59+
"8.7.0.84",
5760
"8.6.0.163",
5861
"8.5.0.96",
5962
"8.4.1.50",
@@ -67,7 +70,14 @@
6770
"8.2.1.32",
6871
"8.2.0.53",
6972
"8.1.1.33",
70-
"8.1.0.77"
73+
"8.1.0.77",
74+
"9.0.0.312",
75+
"9.1.0.70",
76+
"9.1.1.17",
77+
"9.2.0.82",
78+
"9.2.1.18",
79+
"9.3.0.75",
80+
"9.4.0.58"
7181
],
7282
"default": "8.6.0.163",
7383
"description": "Version of cuDNN to install"

src/nvidia-cuda/install.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ apt-get update -yq
5959
cuda_pkg="cuda-libraries-${CUDA_VERSION/./-}"
6060
nvtx_pkg="cuda-nvtx-${CUDA_VERSION/./-}"
6161
toolkit_pkg="cuda-toolkit-${CUDA_VERSION/./-}"
62+
major_cudnn_version=$(echo "${CUDNN_VERSION}" | cut -d '.' -f 1)
63+
major_cuda_version=$(echo "${CUDA_VERSION}" | cut -d '.' -f 1)
6264
if ! apt-cache show "$cuda_pkg"; then
6365
echo "The requested version of CUDA is not available: CUDA $CUDA_VERSION"
6466
exit 1
@@ -69,7 +71,15 @@ apt-get install -yq "$cuda_pkg"
6971

7072
if [ "$INSTALL_CUDNN" = "true" ]; then
7173
# Ensure that the requested version of cuDNN is available AND compatible
72-
cudnn_pkg_version="libcudnn8=${CUDNN_VERSION}-1+cuda${CUDA_VERSION}"
74+
#if major cudnn version is 9, then we need to install libcudnn9-cuda-<major_version> package
75+
#else we need to install libcudnn8-cuda-<major_version> package
76+
if [[ $major_cudnn_version -ge "9" ]]
77+
then
78+
cudnn_pkg_version="libcudnn9-cuda-${major_cuda_version}=${CUDNN_VERSION}-1"
79+
else
80+
cudnn_pkg_version="libcudnn8=${CUDNN_VERSION}-1+cuda${CUDA_VERSION}"
81+
fi
82+
7383
if ! apt-cache show "$cudnn_pkg_version"; then
7484
echo "The requested version of cuDNN is not available: cuDNN $CUDNN_VERSION for CUDA $CUDA_VERSION"
7585
exit 1
@@ -81,7 +91,13 @@ fi
8191

8292
if [ "$INSTALL_CUDNNDEV" = "true" ]; then
8393
# Ensure that the requested version of cuDNN development package is available AND compatible
84-
cudnn_dev_pkg_version="libcudnn8-dev=${CUDNN_VERSION}-1+cuda${CUDA_VERSION}"
94+
if [[ $major_cudnn_version -ge "9" ]]
95+
then
96+
cudnn_dev_pkg_version="libcudnn9-dev-cuda-${major_cuda_version}=${CUDNN_VERSION}-1"
97+
else
98+
cudnn_dev_pkg_version="libcudnn8-dev=${CUDNN_VERSION}-1+cuda${CUDA_VERSION}"
99+
fi
100+
85101
if ! apt-cache show "$cudnn_dev_pkg_version"; then
86102
echo "The requested version of cuDNN development package is not available: cuDNN $CUDNN_VERSION for CUDA $CUDA_VERSION"
87103
exit 1
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Optional: Import test library
6+
source dev-container-features-test-lib
7+
8+
# Check installation of libcudnn9-cuda-12 (9.4.0)
9+
check "libcudnn.so.9.4.0" test 1 -eq "$(find /usr -name 'libcudnn.so.9.4.0' | wc -l)"
10+
11+
# Check installation of cuda-nvtx-11-7 (11.7)
12+
# check "cuda-12-4+nvtx" test -e '/usr/local/cuda-12.4/targets/x86_64-linux/include/nvtx3'
13+
14+
# Report result
15+
reportResults
16+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Optional: Import test library
6+
source dev-container-features-test-lib
7+
8+
# Check installation of libcudnn9-cuda-12 (9.4.0)
9+
check "libcudnn.so.9.4.0" test 1 -eq "$(find /usr -name 'libcudnn.so.9.4.0' | wc -l)"
10+
11+
# Check installation of cuda-nvtx-11-7 (11.7)
12+
# check "cuda-12-4+nvtx" test -e '/usr/local/cuda-12.4/targets/x86_64-linux/include/nvtx3'
13+
14+
# Report result
15+
reportResults
16+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Optional: Import test library
6+
source dev-container-features-test-lib
7+
8+
# Check installation of libcudnn9-cuda-12 (9.4.0)
9+
check "libcudnn.so.9.4.0" test 1 -eq "$(find /usr -name 'libcudnn.so.9.4.0' | wc -l)"
10+
11+
# Check installation of cuda-nvtx-11-7 (11.7)
12+
# check "cuda-12-4+nvtx" test -e '/usr/local/cuda-12.4/targets/x86_64-linux/include/nvtx3'
13+
14+
# Report result
15+
reportResults
16+

test/nvidia-cuda/scenarios.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,44 @@
2020
"cudnnVersion": "8.5.0.96"
2121
}
2222
}
23+
},
24+
"install_cudnn_123_version": {
25+
"image": "debian",
26+
"features": {
27+
"nvidia-cuda": {
28+
"installCudnn": true,
29+
"installNvtx": true,
30+
"installCudnnDev": true,
31+
"installToolkit": true,
32+
"cudaVersion": "12.3",
33+
"cudnnVersion": "9.4.0.58"
34+
}
35+
}
36+
},
37+
"install_cudnn_124_version": {
38+
"image": "debian",
39+
"features": {
40+
"nvidia-cuda": {
41+
"installCudnn": true,
42+
"installNvtx": true,
43+
"installCudnnDev": true,
44+
"installToolkit": true,
45+
"cudaVersion": "12.4",
46+
"cudnnVersion": "9.4.0.58"
47+
}
48+
}
49+
},
50+
"install_cudnn_latest_version": {
51+
"image": "debian",
52+
"features": {
53+
"nvidia-cuda": {
54+
"installCudnn": true,
55+
"installNvtx": true,
56+
"installCudnnDev": true,
57+
"installToolkit": true,
58+
"cudaVersion": "12.5",
59+
"cudnnVersion": "9.4.0.58"
60+
}
61+
}
2362
}
2463
}

0 commit comments

Comments
 (0)