-
Notifications
You must be signed in to change notification settings - Fork 619
Add new NVIDIA CUDA feature #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
caa4520
Add new Nvidia feature
jungaretti 2e115a9
Remove random empty files
jungaretti 82cf979
Update comments
jungaretti 25a7dc7
Merge branch 'main' into jungaretti/nvidia-feature
joshspicer 0d6fe41
Rename feature to nvidia-cuda
jungaretti f0dee9d
Add feature to tests
jungaretti c729aef
Add version
jungaretti ce560c7
Merge branch 'main' of https://github.com/devcontainers/features into…
jungaretti f329740
Move test to match new name
jungaretti ccc5282
Add final output message
jungaretti 2a7d079
Fix capitalization of NVIDIA
jungaretti 9aef242
Remove option for base CUDA
jungaretti 67309af
Use camelCase
jungaretti 8a44491
Check for required packages
jungaretti 30a4aa6
Use os-release instead of lsb_release
jungaretti 90afb4a
Clean up keyring variables
jungaretti ba1da2a
Collapse keyring lines
jungaretti 62bceba
Always install CUDA libraries
jungaretti 96423df
Add option to install NVTX
jungaretti caf879a
Merge branch 'main' of https://github.com/devcontainers/features into…
jungaretti 3ab6580
Always use ubuntu2004 repo
jungaretti c1a051d
Use test instead of brackets
jungaretti 8a6d52b
Add default values to feature
jungaretti f246115
Add version options for CUDA and cuDNN
jungaretti 52da1e5
Rename CUDA version option
jungaretti d3e145b
Add scenario to test specific CUDA/cuDNN version
jungaretti 287aa65
Rename cuDNN scenario
jungaretti ef45b35
Fix typo in test scenario
jungaretti e6b9356
Update variable casing
jungaretti 11d217a
Add more helpful error messages
jungaretti a89dac0
Remove default values from script
jungaretti d17069e
Use enum for version option
jungaretti 9e6255c
Polish new scenarios
jungaretti c7a61d3
Remove apt_get_update_if_needed and check_packages
jungaretti f4b62d2
Merge branch 'main' of https://github.com/devcontainers/features into…
jungaretti ae65577
Add more versions
jungaretti 7d57487
Improve error messages
jungaretti fe2bada
Comments and feature description
jungaretti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ jobs: | |
| "java", | ||
| "kubectl-helm-minikube", | ||
| "node", | ||
| "nvidia-cuda", | ||
| "oryx", | ||
| "php", | ||
| "powershell", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| { | ||
| "id": "nvidia-cuda", | ||
| "name": "NVIDIA CUDA", | ||
| "description": "Installs shared libraries for NVIDIA CUDA.", | ||
| "version": "1.0.0", | ||
| "options": { | ||
| "installCudnn": { | ||
| "type": "boolean", | ||
| "default": false, | ||
| "description": "Additionally install CUDA Deep Neural Network (cuDNN) shared library" | ||
| }, | ||
| "installNvtx": { | ||
| "type": "boolean", | ||
| "default": false, | ||
| "description": "Additionally install NVIDIA Tools Extension (NVTX)" | ||
| }, | ||
| "cudaVersion": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "11.7", | ||
| "11.6", | ||
| "11.5", | ||
| "11.4", | ||
| "11.3", | ||
| "11.2" | ||
| ], | ||
| "default": "11.7", | ||
| "description": "Version of CUDA to install" | ||
| }, | ||
| "cudnnVersion": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "8.5.0.96", | ||
| "8.4.1.50", | ||
| "8.4.0.27", | ||
| "8.3.3.40", | ||
| "8.3.2.44", | ||
| "8.3.1.22", | ||
| "8.3.0.98", | ||
| "8.2.4.15", | ||
| "8.2.2.26", | ||
| "8.2.1.32", | ||
| "8.2.0.53", | ||
| "8.1.1.33", | ||
| "8.1.0.77" | ||
| ], | ||
| "default": "8.5.0.96", | ||
| "description": "Version of cuDNN to install" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| INSTALL_CUDNN=${INSTALLCUDNN} | ||
| INSTALL_NVTX=${INSTALLNVTX} | ||
| CUDA_VERSION=${CUDAVERSION} | ||
| CUDNN_VERSION=${CUDNNVERSION} | ||
|
|
||
| if [ "$(id -u)" -ne 0 ]; then | ||
| echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Install dependencies | ||
| apt-get update -yq | ||
| apt-get install -yq wget ca-certificates | ||
|
|
||
| # Add NVIDIA's package repository to apt so that we can download packages | ||
| # Always use the ubuntu2004 repo because the other repos (e.g., debian11) are missing packages | ||
| NVIDIA_REPO_URL="https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64" | ||
| KEYRING_PACKAGE="cuda-keyring_1.0-1_all.deb" | ||
| KEYRING_PACKAGE_URL="$NVIDIA_REPO_URL/$KEYRING_PACKAGE" | ||
| KEYRING_PACKAGE_PATH="$(mktemp -d)" | ||
| KEYRING_PACKAGE_FILE="$KEYRING_PACKAGE_PATH/$KEYRING_PACKAGE" | ||
| wget -O "$KEYRING_PACKAGE_FILE" "$KEYRING_PACKAGE_URL" | ||
| apt-get install -yq "$KEYRING_PACKAGE_FILE" | ||
| apt-get update -yq | ||
|
|
||
| # Ensure that the requested version of CUDA is available | ||
| cuda_pkg="cuda-libraries-${CUDA_VERSION/./-}" | ||
| nvtx_pkg="cuda-nvtx-${CUDA_VERSION/./-}" | ||
| if ! apt-cache show "$cuda_pkg"; then | ||
| echo "The requested version of CUDA is not available: CUDA $CUDA_VERSION" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Ensure that the requested version of cuDNN is available AND compatible | ||
| cudnn_pkg_version="libcudnn8=${CUDNN_VERSION}-1+cuda${CUDA_VERSION}" | ||
| if ! apt-cache show "$cudnn_pkg_version"; then | ||
| echo "The requested version of cuDNN is not available: cuDNN $CUDNN_VERSION for CUDA $CUDA_VERSION" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Installing CUDA libraries..." | ||
| apt-get install -yq "$cuda_pkg" | ||
|
|
||
| if [ "$INSTALL_CUDNN" = "true" ]; then | ||
| echo "Installing cuDNN libraries..." | ||
| apt-get install -yq "$cudnn_pkg_version" | ||
| fi | ||
|
|
||
| if [ "$INSTALL_NVTX" = "true" ]; then | ||
| echo "Installing NVTX..." | ||
| apt-get install -yq "$nvtx_pkg" | ||
| fi | ||
|
|
||
| echo "Done!" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
|
|
||
| # Optional: Import test library | ||
| source dev-container-features-test-lib | ||
|
|
||
| # Check installation of libcudnn8 | ||
| check "libcudnn.so.8" test 1 -eq "$(find /usr -name 'libcudnn.so.8' | wc -l)" | ||
|
|
||
| # Check installation of cuda-nvtx-11-<version> | ||
| check "cuda-11+nvtx" test -e '/usr/local/cuda-11/targets/x86_64-linux/include/nvtx3' | ||
|
|
||
| # Report result | ||
| reportResults |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
|
|
||
| # Optional: Import test library | ||
| source dev-container-features-test-lib | ||
|
|
||
| # Check installation of libcudnn8 (8.3.2) | ||
| check "libcudnn.so.8.3.2" test 1 -eq "$(find /usr -name 'libcudnn.so.8.3.2' | wc -l)" | ||
|
|
||
| # Check installation of cuda-nvtx-11-5 (11.5) | ||
| check "cuda-11-5+nvtx" test -e '/usr/local/cuda-11.5/targets/x86_64-linux/include/nvtx3' | ||
|
|
||
| # Report result | ||
| reportResults | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
|
|
||
| # Optional: Import test library | ||
| source dev-container-features-test-lib | ||
|
|
||
| # Check installation of cuda-libraries-11-<version> | ||
| check "libcudart.so.11.0" test 1 -eq "$(find /usr -name 'libcudart.so.11.0' | wc -l)" | ||
| check "libcublas.so.11" test 1 -eq "$(find /usr -name 'libcublas.so.11' | wc -l)" | ||
| check "libcublasLt.so.11" test 1 -eq "$(find /usr -name 'libcublasLt.so.11' | wc -l)" | ||
| check "libcufft.so.10" test 1 -eq "$(find /usr -name 'libcufft.so.10' | wc -l)" | ||
| check "libcurand.so.10" test 1 -eq "$(find /usr -name 'libcurand.so.10' | wc -l)" | ||
| check "libcusolver.so.11" test 1 -eq "$(find /usr -name 'libcusolver.so.11' | wc -l)" | ||
| check "libcusparse.so.11" test 1 -eq "$(find /usr -name 'libcusparse.so.11' | wc -l)" | ||
|
|
||
| # Report result | ||
| reportResults |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.