-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from ASFHyP3/g6_gpu
Update GPU dockerfile to fully support GPU workflow
- Loading branch information
Showing
7 changed files
with
125 additions
and
68 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
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
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
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,32 @@ | ||
#!/bin/bash | ||
|
||
# GPU setup for the Amazon Linux 2023 | ||
|
||
# Install NVIDIA driver | ||
DRIVER_VERSION=550.54.14 | ||
sudo dnf install -y kernel-devel-$(uname -r) kernel-headers-$(uname -r) kernel-modules-extra | ||
curl -fSsl -O https://us.download.nvidia.com/tesla/$DRIVER_VERSION/NVIDIA-Linux-x86_64-$DRIVER_VERSION.run | ||
chmod +x NVIDIA-Linux-x86_64-$DRIVER_VERSION.run | ||
sudo ./NVIDIA-Linux-x86_64-$DRIVER_VERSION.run --tmpdir . --silent | ||
rm ./NVIDIA-Linux-x86_64-$DRIVER_VERSION.run | ||
|
||
# Install and enable Docker | ||
sudo dnf install -y docker git | ||
sudo systemctl start docker | ||
sudo systemctl enable docker | ||
sudo usermod -aG docker ec2-user | ||
|
||
# Install nvidia-container-toolkit | ||
sudo dnf config-manager --add-repo https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | ||
sudo dnf install -y nvidia-container-toolkit | ||
sudo nvidia-ctk runtime configure --runtime=docker | ||
sudo systemctl restart docker | ||
|
||
# Install extra packages | ||
sudo dnf install -y git | ||
|
||
# Cleanup | ||
dnf clean all && rm -rf /var/cache/dnf/* | ||
|
||
# Reboot | ||
sudo reboot |
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
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,30 @@ | ||
#!/bin/bash | ||
|
||
# GPU setup for the Ubuntu 22.04 | ||
|
||
# NVIDIA source setup | ||
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && \ | ||
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ | ||
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ | ||
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list && \ | ||
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb && \ | ||
sudo dpkg -i cuda-keyring_1.1-1_all.deb && \ | ||
rm cuda-keyring_1.1-1_all.deb | ||
|
||
# Docker source setup | ||
sudo apt install -y ca-certificates curl gnupg lsb-release && \ | ||
sudo mkdir -p /etc/apt/keyrings && \ | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \ | ||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
|
||
# Installs | ||
sudo apt-get update && \ | ||
sudo apt-get install -y nvidia-headless-535-server nvidia-utils-535-server nvidia-container-toolkit docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin awscli git && \ | ||
sudo usermod -aG docker ubuntu | ||
|
||
# Cleanup temporary files | ||
sudo apt-get clean | ||
sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
# Reboot | ||
sudo reboot |
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