Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If the output results in a "PASS" you should be fine. The GPU is then ready to use.


Using Docker

Our GPU-enabled VMs altso supports NVIDIA Container Toolkit in order to use docker with GPUs. Rule of thumb is to follow the current installation guide from NVIDIA. Don't bother with the driver pre-requsities. We have already sorted those out for you in our image. You will of course need to install docker before you begin. That part is also described in NVIDIA's documentation. We've summed up the commands below. The examples is for Ubuntu only.

Install docker

Code Block
curl https://get.docker.com | sh && sudo systemctl --now enable docker

Install Nvidia Container Toolkit

Code Block
# Enable the repositories
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
   && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \
   && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

# Install the package
sudo apt update && apt -y install nvidia-docker2

# Restart the docker daemon
sudo systemctl restart docker

# Run a test to verifiy that it works
sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

# Optionally run a test with Tensorflow that actually runs a bit of code on the GPU via docker
sudo docker run --gpus all -it --rm tensorflow/tensorflow:latest-gpu \
   python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"