$ -weight: 600;">sudo snap -weight: 500;">remove --purge -weight: 500;">docker
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">remove -weight: 500;">docker -weight: 500;">docker-engine -weight: 500;">docker.io containerd runc
-weight: 600;">sudo snap -weight: 500;">remove --purge -weight: 500;">docker
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">remove -weight: 500;">docker -weight: 500;">docker-engine -weight: 500;">docker.io containerd runc
-weight: 600;">sudo snap -weight: 500;">remove --purge -weight: 500;">docker
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">remove -weight: 500;">docker -weight: 500;">docker-engine -weight: 500;">docker.io containerd runc
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install ca-certificates -weight: 500;">curl
-weight: 600;">sudo -weight: 500;">install -m 0755 -d /etc/-weight: 500;">apt/keyrings
-weight: 600;">sudo -weight: 500;">curl -fsSL [https://download.-weight: 500;">docker.com/linux/ubuntu/gpg](https://download.-weight: 500;">docker.com/linux/ubuntu/gpg) -o /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc
-weight: 600;">sudo chmod a+r /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc] [https://download.-weight: 500;">docker.com/linux/ubuntu](https://download.-weight: 500;">docker.com/linux/ubuntu) \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.list > /dev/null
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install ca-certificates -weight: 500;">curl
-weight: 600;">sudo -weight: 500;">install -m 0755 -d /etc/-weight: 500;">apt/keyrings
-weight: 600;">sudo -weight: 500;">curl -fsSL [https://download.-weight: 500;">docker.com/linux/ubuntu/gpg](https://download.-weight: 500;">docker.com/linux/ubuntu/gpg) -o /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc
-weight: 600;">sudo chmod a+r /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc] [https://download.-weight: 500;">docker.com/linux/ubuntu](https://download.-weight: 500;">docker.com/linux/ubuntu) \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.list > /dev/null
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install ca-certificates -weight: 500;">curl
-weight: 600;">sudo -weight: 500;">install -m 0755 -d /etc/-weight: 500;">apt/keyrings
-weight: 600;">sudo -weight: 500;">curl -fsSL [https://download.-weight: 500;">docker.com/linux/ubuntu/gpg](https://download.-weight: 500;">docker.com/linux/ubuntu/gpg) -o /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc
-weight: 600;">sudo chmod a+r /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc] [https://download.-weight: 500;">docker.com/linux/ubuntu](https://download.-weight: 500;">docker.com/linux/ubuntu) \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.list > /dev/null
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -weight: 500;">docker-ce -weight: 500;">docker-ce-cli containerd.io -weight: 500;">docker-buildx-plugin -weight: 500;">docker-compose-plugin -y
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -weight: 500;">docker-ce -weight: 500;">docker-ce-cli containerd.io -weight: 500;">docker-buildx-plugin -weight: 500;">docker-compose-plugin -y
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -weight: 500;">docker-ce -weight: 500;">docker-ce-cli containerd.io -weight: 500;">docker-buildx-plugin -weight: 500;">docker-compose-plugin -y
-weight: 500;">curl -fsSL [https://nvidia.github.io/libnvidia-container/gpgkey](https://nvidia.github.io/libnvidia-container/gpgkey) | -weight: 600;">sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ && -weight: 500;">curl -s -L [https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list](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' | \ -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/nvidia-container-toolkit.list -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y nvidia-container-toolkit
-weight: 500;">curl -fsSL [https://nvidia.github.io/libnvidia-container/gpgkey](https://nvidia.github.io/libnvidia-container/gpgkey) | -weight: 600;">sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ && -weight: 500;">curl -s -L [https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list](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' | \ -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/nvidia-container-toolkit.list -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y nvidia-container-toolkit
-weight: 500;">curl -fsSL [https://nvidia.github.io/libnvidia-container/gpgkey](https://nvidia.github.io/libnvidia-container/gpgkey) | -weight: 600;">sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ && -weight: 500;">curl -s -L [https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list](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' | \ -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/nvidia-container-toolkit.list -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y nvidia-container-toolkit
-weight: 600;">sudo nvidia-ctk runtime configure --runtime=-weight: 500;">docker
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">restart -weight: 500;">docker
-weight: 600;">sudo nvidia-ctk runtime configure --runtime=-weight: 500;">docker
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">restart -weight: 500;">docker
-weight: 600;">sudo nvidia-ctk runtime configure --runtime=-weight: 500;">docker
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">restart -weight: 500;">docker
-weight: 600;">sudo -weight: 500;">docker run --rm --gpus all nvidia/cuda:12.2.2-base-ubuntu24.04 nvidia-smi
-weight: 600;">sudo -weight: 500;">docker run --rm --gpus all nvidia/cuda:12.2.2-base-ubuntu24.04 nvidia-smi
-weight: 600;">sudo -weight: 500;">docker run --rm --gpus all nvidia/cuda:12.2.2-base-ubuntu24.04 nvidia-smi
services: ollama-ai: image: ollama/ollama:latest container_name: gpuyard-ollama -weight: 500;">restart: always ports: - "11434:11434" volumes: - ./ollama_data:/root/.ollama deploy: resources: reservations: devices: - driver: nvidia count: all # Passes all available GPUs to the container capabilities: [gpu]
services: ollama-ai: image: ollama/ollama:latest container_name: gpuyard-ollama -weight: 500;">restart: always ports: - "11434:11434" volumes: - ./ollama_data:/root/.ollama deploy: resources: reservations: devices: - driver: nvidia count: all # Passes all available GPUs to the container capabilities: [gpu]
services: ollama-ai: image: ollama/ollama:latest container_name: gpuyard-ollama -weight: 500;">restart: always ports: - "11434:11434" volumes: - ./ollama_data:/root/.ollama deploy: resources: reservations: devices: - driver: nvidia count: all # Passes all available GPUs to the container capabilities: [gpu] - A Dedicated GPU Server: Running Ubuntu 24.04 LTS.
- Root or Sudo Access: Required for package installation.
- NVIDIA Drivers Installed: Verify this by running nvidia-smi in your terminal. You should see a table displaying your GPU model and CUDA version. (If you see "command not found," -weight: 500;">install the proprietary NVIDIA drivers first). - Error: "could not select device driver with capabilities: [[gpu]]" Cause: Docker isn't aware of the NVIDIA runtime. Fix: You likely forgot to -weight: 500;">restart the Docker daemon in Step 4. Run -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">restart -weight: 500;">docker.
- Cause: Docker isn't aware of the NVIDIA runtime.
- Fix: You likely forgot to -weight: 500;">restart the Docker daemon in Step 4. Run -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">restart -weight: 500;">docker.
- Error: "Failed to initialize NVML: Driver/library version mismatch" Cause: Your host system updated the NVIDIA Linux kernel drivers in the background, but the old driver is still loaded in memory. Fix: A simple bare-metal server reboot (-weight: 600;">sudo reboot) will align the kernel modules.
- Cause: Your host system updated the NVIDIA Linux kernel drivers in the background, but the old driver is still loaded in memory.
- Fix: A simple bare-metal server reboot (-weight: 600;">sudo reboot) will align the kernel modules. - Cause: Docker isn't aware of the NVIDIA runtime.
- Fix: You likely forgot to -weight: 500;">restart the Docker daemon in Step 4. Run -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">restart -weight: 500;">docker. - Cause: Your host system updated the NVIDIA Linux kernel drivers in the background, but the old driver is still loaded in memory.
- Fix: A simple bare-metal server reboot (-weight: 600;">sudo reboot) will align the kernel modules.