Can't start containers with GPU access on Linux Mint

When I run

docker run --runtime=nvidia --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody

I get this error

docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].

Environment:

  • OS: Linux Mint 22 Cinnamon:6.2.9
  • Linux Kernel: 6.8.0-47-generic
  • Graphics card: NVIDIA Corporation GA104 [GeForce RTX 3060 Ti Lite Hash Rate]
  • Docker Desktop version: 4.34.3 (170107)
  • Docker version: 27.3.1, build ce12230

Steps to reproduce:

  1. Install Docker Desktop (file docker-desktop-amd64.deb) using debian installer
  2. Follow the steps at Installing the NVIDIA Container Toolkit Using the apt method.
  3. Manually update the config because docker desktop doesn’t use the config at /etc/docker instead it uses the one at /home/username/.docker which the steps at NVidia - Configuring Docker modify.
  4. Run docker run --runtime=nvidia --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody to confirm functionality.
    (these steps are to the best of my memory…)

My docker config now looks like this:

{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "runtimes": {
    "nvidia": {
      "args": [],
      "path": "nvidia-container-runtime"
    }
  }
}

Expected:
Starts the container and I see gpu stats in the logs

Actual:
Get an error in the terminal saying docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].

I’ve searched high and low for an answer to this, but any advice or solutions are extremely welcome. Not even LLMs can answer my question :sunglasses: :sweat_smile: