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:
- Hit edit on existing container
- Enable GPU in Runtime & Resources
- Hit deploy the container
- 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)
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/drias 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/driin both boxes: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!
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. ;- ) =
I finally got it to work for me with a gtx 1060 in ubuntu following these steps
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!
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:
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?