Last active
April 14, 2023 13:44
-
-
Save suzumura-ss/c983e3ca05e665b05df6e5e2bee5fbf8 to your computer and use it in GitHub Desktop.
Setup WSL2-Ubuntu-20.04 with Docker and CUDA
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
#!/bin/bash | |
sudo apt update | |
sudo apt upgrade -y | |
# Enable systemd | |
echo -e "[boot]\nsystemd=true\n" | sudo tee /etc/wsl.conf > /dev/null | |
# Install Nodejs | |
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs | |
# Install docker engine | |
sudo apt install -y ca-certificates curl gnupg | |
sudo mkdir -m 0755 -p /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/debian/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 \ | |
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ | |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo apt update | |
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
sudo groupadd docker | |
sudo usermod -aG docker $USER | |
# Install cuda | |
# https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=WSL-Ubuntu&target_version=2.0&target_type=deb_network | |
wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-keyring_1.0-1_all.deb | |
sudo dpkg -i cuda-keyring_1.0-1_all.deb | |
sudo apt update | |
sudo apt -y install cuda | |
rm cuda-keyring_1.0-1_all.deb | |
# | |
sudo apt install -y dnsutils net-tools tig tree vim-gtk | |
sudo apt autoremove -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment