Skip to content

Commit 243671e

Browse files
authored
Enhancements in CUDA Support (#699)
* add cuda tookit installing support * add nvcc installing support * add libcudnn8-dev installing support * add new cuda versions adn cudnn versions * add specificaitons of new option * remove installNvcc installNvcc process is included in installToolkit * add tests for new nvidia-cuda options * fix wrong scenario name * Revert "add specificaitons of new option" This reverts commit 0dcdb92. README.md should be generated by CI workflow. * make cudnn-dev installation isolated * dump minor version to 1.1.0
1 parent 0d2fc3a commit 243671e

File tree

4 files changed

+54
-4
lines changed

4 files changed

+54
-4
lines changed

src/nvidia-cuda/devcontainer-feature.json

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "nvidia-cuda",
3-
"version": "1.0.7",
3+
"version": "1.1.0",
44
"name": "NVIDIA CUDA",
55
"description": "Installs shared libraries for NVIDIA CUDA.",
66
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/nvidia-cuda",
@@ -10,14 +10,27 @@
1010
"default": false,
1111
"description": "Additionally install CUDA Deep Neural Network (cuDNN) shared library"
1212
},
13+
"installCudnnDev": {
14+
"type": "boolean",
15+
"default": false,
16+
"description": "Additionally install CUDA Deep Neural Network (cuDNN) development libraries and headers"
17+
},
1318
"installNvtx": {
1419
"type": "boolean",
1520
"default": false,
1621
"description": "Additionally install NVIDIA Tools Extension (NVTX)"
1722
},
23+
"installToolkit": {
24+
"type": "boolean",
25+
"default": false,
26+
"description": "Additionally install NVIDIA CUDA Toolkit"
27+
},
1828
"cudaVersion": {
1929
"type": "string",
2030
"proposals": [
31+
"12.2",
32+
"12.1",
33+
"12.0",
2134
"11.8",
2235
"11.7",
2336
"11.6",
@@ -32,6 +45,15 @@
3245
"cudnnVersion": {
3346
"type": "string",
3447
"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",
3557
"8.6.0.163",
3658
"8.5.0.96",
3759
"8.4.1.50",

src/nvidia-cuda/install.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ set -e
66
rm -rf /var/lib/apt/lists/*
77

88
INSTALL_CUDNN=${INSTALLCUDNN}
9+
INSTALL_CUDNNDEV=${INSTALLCUDNNDEV}
910
INSTALL_NVTX=${INSTALLNVTX}
11+
INSTALL_TOOLKIT=${INSTALLTOOLKIT}
1012
CUDA_VERSION=${CUDAVERSION}
1113
CUDNN_VERSION=${CUDNNVERSION}
1214

@@ -47,6 +49,7 @@ apt-get update -yq
4749
# Ensure that the requested version of CUDA is available
4850
cuda_pkg="cuda-libraries-${CUDA_VERSION/./-}"
4951
nvtx_pkg="cuda-nvtx-${CUDA_VERSION/./-}"
52+
toolkit_pkg="cuda-toolkit-${CUDA_VERSION/./-}"
5053
if ! apt-cache show "$cuda_pkg"; then
5154
echo "The requested version of CUDA is not available: CUDA $CUDA_VERSION"
5255
exit 1
@@ -67,11 +70,28 @@ if [ "$INSTALL_CUDNN" = "true" ]; then
6770
apt-get install -yq "$cudnn_pkg_version"
6871
fi
6972

73+
if [ "$INSTALL_CUDNNDEV" = "true" ]; then
74+
# Ensure that the requested version of cuDNN development package is available AND compatible
75+
cudnn_dev_pkg_version="libcudnn8-dev=${CUDNN_VERSION}-1+cuda${CUDA_VERSION}"
76+
if ! apt-cache show "$cudnn_dev_pkg_version"; then
77+
echo "The requested version of cuDNN development package is not available: cuDNN $CUDNN_VERSION for CUDA $CUDA_VERSION"
78+
exit 1
79+
fi
80+
81+
echo "Installing cuDNN dev libraries..."
82+
apt-get install -yq "$cudnn_dev_pkg_version"
83+
fi
84+
7085
if [ "$INSTALL_NVTX" = "true" ]; then
7186
echo "Installing NVTX..."
7287
apt-get install -yq "$nvtx_pkg"
7388
fi
7489

90+
if [ "$INSTALL_TOOLKIT" = "true" ]; then
91+
echo "Installing CUDA Toolkit..."
92+
apt-get install -yq "$toolkit_pkg"
93+
fi
94+
7595
# Clean up
7696
rm -rf /var/lib/apt/lists/*
7797

test/nvidia-cuda/install_cudnn_nvxt.sh renamed to test/nvidia-cuda/install_all_options.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@ source dev-container-features-test-lib
88
# Check installation of libcudnn8
99
check "libcudnn.so.8" test 1 -eq "$(find /usr -name 'libcudnn.so.8' | wc -l)"
1010

11+
# Check installation of libcudnn8-dev
12+
check "cudnn.h" test 1 -eq "$(find /usr -name 'cudnn.h' | wc -l)"
13+
1114
# Check installation of cuda-nvtx-11-<version>
1215
check "cuda-11+nvtx" test -e '/usr/local/cuda-11/targets/x86_64-linux/include/nvtx3'
1316

17+
# Check installation of cuda-nvcc-11-<version>
18+
check "cuda-11+nvcc" test -e '/usr/local/cuda-11/bin/nvcc'
19+
1420
# Report result
1521
reportResults

test/nvidia-cuda/scenarios.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
2-
"install_cudnn_nvxt": {
2+
"install_all_options": {
33
"image": "debian",
44
"features": {
55
"nvidia-cuda": {
66
"installCudnn": true,
7-
"installNvtx": true
7+
"installCudnnDev": true,
8+
"installNvtx": true,
9+
"installToolkit": true
810
}
911
}
1012
},
@@ -19,4 +21,4 @@
1921
}
2022
}
2123
}
22-
}
24+
}

0 commit comments

Comments
 (0)