portainer: Error when enabling GPU

Bug description I have an existing container for Jellyfin that I want to recreate with GPU enabled. Instead I get an error saying:

Failure e.HostConfig.DeviceRequests is null

Expected behavior Enabling the GPU slider and recreating works

Portainer Logs Nothing helpful seems to show up in logs

Steps to reproduce the issue:

  1. Hit edit on existing container
  2. Enable GPU in Runtime & Resources
  3. Hit deploy the container
  4. See error

Technical details:

  • Portainer version: 2.15.1
  • Docker version (managed by Portainer): 20.10.8
  • Kubernetes version (managed by Portainer): n/a
  • Platform: Ubuntu 22.04.1
  • Command used to start Portainer: docker run -d -p 8000:8000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
  • Browser: Firefox
  • Use Case (delete as appropriate): Using Portainer at Home
  • Have you reviewed our technical documentation and knowledge base? Yes

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 85 (4 by maintainers)

Most upvoted comments


    "message": "could not select device driver \"nvidia\" with capabilities: [[compute utility]]"

@jamescarppe The machine is running Debian 12 with Intel GPU.

Ah, you’re on an Intel GPU. I believe (and I’m confirming this now) that our current support through the GPU functionality is for nvidia GPUs only, as that was what the community user that contributed the base code for the feature originally provided support for.

In the meantime, you can generally provide Intel GPU access to a container by attaching the /dev/dri as a device to your container. In the Portainer UI, you would do this in the Advanced container settings section when creating or editing a container, under the Runtime and Resources tab, through the Device option. Click add device then enter /dev/dri in both boxes:

container-devices-intel-gpu

I’ve tested this locally just now with Jellyfin and an Intel iGPU, and I can see the iGPU usage ticking up when I play media through the Jellyfin container so it’s indeed passing it through correctly.

@gausie

Thank you for the information. I was able to reproduce the issue. I am going to log an internal request to review and resolve.

Thanks!

gpu-testing

Cheers!

That did the trick, with a slight caveat that (in Plex) I had to manually select the card, auto didn’t work.

Enabling the Intel GPU was working till around 2.15 and after that, it errored with null. Integrated Intel GPUs are not ideal but for slight 1080p they can do. It sure is better than pure CPU. ;- ) =

image

image

I finally got it to work for me with a gtx 1060 in ubuntu following these steps

  1. sudo apt search nvidia (to find latest driver)
  2. sudo apt install nvidia-driver-xxx
  3. sudo apt install -y nvidia-container-toolkit
  4. sudo systemctl restart docker
  5. get UUID from /prod/drivers/nvidia/000-0x (number for gpu you want to use)
  6. nano information
  7. add to portainer

Any update on this issue?

If anyone can help me redeploy my image so I can get my 1060 working in my plex docker container, I would be massively indebted to you!

Mac mini M1 GPU id or UUID

Does the one suggested here work? https://osxdaily.com/2022/02/02/find-mac-system-info-terminal-system-profiler/

Not sure if that’ll work or not, but there seems to be just the one UUID for those since they have an integrated GPU?

For now, I have worked around this by including the GPU in my stack compose script. Needs to be using the nvidia runtime:

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


@gausie

Thank you for the information. I was able to reproduce the issue. I am going to log an internal request to review and resolve.

Thanks!

gpu-testing gpu-testing

I’m still getting the exact same error that is highlighted in this post

I see https://github.com/portainer/portainer/pull/8316 still isn’t merged, is this related?