Installing CUDA toolkit and NVIDIA drivers in a Container

This option only works with the incus backend in 25.10, not with the newer one form the 26 beta.

you basically have to use the shell and

sudo incus config edit name-of-your-lxc

and add these two lines

nvidia.driver.capabilities: compute,graphics,utility,video
nvidia.runtime: "true"

it should look like this:

architecture: x86_64
config:
  boot.autostart: "false"
  image.architecture: amd64
  image.description: Debian trixie amd64 (20251007_05:24)
  image.os: Debian
  image.release: trixie
  image.serial: "20251007_05:24"
  image.type: squashfs
  image.variant: default
  nvidia.driver.capabilities: compute,graphics,utility,video # <- here
  nvidia.runtime: "true" #<- here
  raw.idmap: |-
    uid 568 568
    gid 568 568
  security.privileged: "false"
  user.autostart: "true"

save, exit and restart your lxc and the hosts driver are now available inside the lxc

Edit: i
it was discribed in this post when incus was first introduced

and of course the incus documentation