Install Dependencies
Set up the three prerequisites needed to run Laboratory OS on a GPU machine: Docker, NVIDIA drivers, and the NVIDIA Container Toolkit.
1. Docker
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
newgrp docker
Verify:
docker run --rm hello-world
If you see “Hello from Docker!”, the installation was successful.
2. NVIDIA Drivers
Cloud VMs: Many cloud images ship with NVIDIA drivers pre-installed (AWS Deep Learning AMI, GCP GPU-optimized images, Azure Data Science VM, Lambda instances). Run
nvidia-smifirst — if it works, skip this section entirely.
sudo apt-get update
sudo apt-get install -y ubuntu-drivers-common
sudo ubuntu-drivers autoinstall
sudo reboot
After reboot, confirm the driver is loaded:
nvidia-smi
You should see your GPU listed with its driver version and VRAM.
Troubleshooting: If nvidia-smi is not found after install, make sure you have rebooted — the reboot after ubuntu-drivers autoinstall is required. If you see a Driver/library version mismatch error, reboot to resync the driver and CUDA library versions.
3. NVIDIA Container Toolkit
# Add the NVIDIA package repository
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
# Install
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
# Configure Docker runtime and restart
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
Verify:
docker run --rm --gpus all nvidia/cuda:12.0-base-ubuntu22.04 nvidia-smi
If you see nvidia-smi output inside the container, everything is set up correctly.
Troubleshooting: If you see could not select device driver “nvidia”, run sudo nvidia-ctk runtime configure --runtime=docker followed by sudo systemctl restart docker. If the GPU is visible on the host but not inside the container, make sure you are passing --gpus all to docker run.