forked from actions/runner-images
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ubicloud] Add GPU runner image template
Add nvidia-cuda-toolkit to the GPU image (#2) Add nvidia-cuda-toolkit and cuda-drivers cuda-12-4 add cudnn add cudnn to env just install cudnn
- Loading branch information
Showing
4 changed files
with
545 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
24 changes: 24 additions & 0 deletions
24
images/ubuntu/scripts/ubicloud/nvidia-container-toolkit.sh
This file contains 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,24 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
# Inspired by: https://github.com/nv-gha-runners/vm-images/blob/main/linux/installers/nvidia-container-toolkit.sh | ||
|
||
KEYRING="/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg" | ||
APT="/etc/apt/sources.list.d/nvidia-container-toolkit.list" | ||
|
||
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o "${KEYRING}" | ||
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ | ||
sed "s#deb https://#deb [signed-by=${KEYRING}] https://#g" | \ | ||
sudo tee "${APT}" | ||
|
||
sudo apt-get update | ||
|
||
sudo apt-get install -y --no-install-recommends nvidia-container-toolkit | ||
|
||
sudo rm -rf "${APT}" "${KEYRING}" | ||
|
||
# Add nvidia runtime to docker and set as default | ||
sudo nvidia-ctk runtime configure --runtime docker --set-as-default | ||
|
||
sudo systemctl restart docker | ||
docker info |
This file contains 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,21 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
# Inspired by: https://github.com/nv-gha-runners/vm-images/blob/main/linux/installers/nvidia-driver.sh | ||
|
||
# Source the helpers for use with the script | ||
source $HELPER_SCRIPTS/etc-environment.sh | ||
|
||
KEYRING=cuda-keyring_1.1-1_all.deb | ||
ARCH=x86_64 | ||
#NV_DRIVER_VERSION=550 | ||
CUDA_TOOLKIT_VERSION=12-4 | ||
|
||
wget -q "https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/${ARCH}/${KEYRING}" | ||
sudo dpkg --install "${KEYRING}" | ||
sudo apt-get update | ||
|
||
sudo apt-get -y install "cuda-${CUDA_TOOLKIT_VERSION}" "cudnn9-cuda-12" | ||
prepend_etc_environment_path "/usr/local/cuda/bin" | ||
|
||
sudo dpkg --purge "$(dpkg -f "${KEYRING}" Package)" |
Oops, something went wrong.