Docker compose (via dockge): should Nvidia drivers be "natively visible"?

Hello all

Electric Eel allowed a tickbox, when installing an app, to load “the Nvidia drivers” (or when you installed the app catalogues, or something).

Does that mean that I can run a docker compose which wants to use nvidia drivers, and it should work?

Or do I need to separately install the Nvidia toolkit? I hope not - it looks too difficult for me in TrueNAS and it might wreck it!

I did try to follow earlier threads as best I could but I didn’t understand.

This is what I want to do in my docker compose:

services:
  frigate:
    ...
    image: ghcr.io/blakeblackshear/frigate:stable
    deploy:    # <------------- Add this section
      resources:
        reservations:
          devices:
            - driver: nvidia
              device_ids: ['0'] # this is only needed when using multiple GPUs
              count: 1 # number of GPUs
              capabilities: [gpu]

having tried it, Frigate seems to crash out after a few minutes (and I don’t yet know why but I presume it might be Nvidia related).

I forgot to add: running the Frigate app and it uses Nvidia OK and indeed its shell shows me this:

and similarly when I ssh into trueNAS and run nvidia-smi:

but whether that means a docker instance would see the same, I don’t know.

my settings for gpu passthrough in jellyfin looks similar, like this

    deploy:
         resources:
            reservations:
              devices:
                - driver: nvidia
                  count: 1
                  capabilities: [gpu]

so i don’t think the settigs are a problem…

That’s useful to know - thanks. I’ll try some more experiments, based on the assumption that Nvidia drivers are effectively an integrated part of the TrueNAS appliance and not in need of additional work by me.

edit: I get an error
Error response from daemon: could not select device driver "nvidia" with capabilities: [[gpu]]

even though my docker compose says the same as yours:

    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]

I did some more searching (a lot more!) and found the AI help system in Frigate docs quite useful. The problem I describe above is due to me not having the Nvidia toolkit installed, because I thought having access to the Nvidia drivers would suffice. I was wrong: I have opened a separate post and I refer to it here