First, run install_docker.sh.
sudo groupadd dockersudo usermod -aG docker $USERLog out and log back in so that your group membership is re-evaluated.
If you're running Linux in a virtual machine, it may be necessary to restart the virtual machine for changes to take effect.
You can also run the following command to activate the changes to groups:
newgrp dockerTo verify that Docker is installed correctly, run the following command:
docker run hello-worldThis command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.
To enable GPU support in Docker containers, run the following script:
./install_nv_container_toolkit.shThis script installs the NVIDIA Container Toolkit, which allows Docker containers to access the GPU using:
docker run --gpus all nvidia/cuda:11.8.0-devel-ubuntu22.04 nvidia-smiAfter the script completes, restart Docker to apply changes:
sudo systemctl restart docker