Skip to content

Instantly share code, notes, and snippets.

@aidin-foroughi
Last active October 24, 2023 22:47
Show Gist options
  • Select an option

  • Save aidin-foroughi/80c8e706f12957b1c44c74eb6f3105a9 to your computer and use it in GitHub Desktop.

Select an option

Save aidin-foroughi/80c8e706f12957b1c44c74eb6f3105a9 to your computer and use it in GitHub Desktop.
azure vm recipe

Oct 24 2023

VM Image: Ubuntu 22.04 Make sure secure boot is not enabled.

sudo apt-get install build-essential to install gcc. CUDA toolkit needs it.

At the moment, driver version 535 seems to work fine. The cuda toolkit that is bundled with that version of of the driver is 12.2.2.

https://developer.nvidia.com/cuda-12-2-2-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=runfile_local

wget https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux.run
sudo sh cuda_12.2.2_535.104.05_linux.run

Install docker like so:

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

# Add the repository to Apt sources:
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-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
$ sudo docker run hello-world

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker

$ docker run hello-world

Refer to docker-nvidia to make GPU passthru work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment