Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Feature Request] Adding user to device group by default #785

Open
Dvalin21 opened this issue Dec 26, 2022 · 5 comments
Open

[Feature Request] Adding user to device group by default #785

Dvalin21 opened this issue Dec 26, 2022 · 5 comments
Labels
Engineering question Further information is requested

Comments

@Dvalin21
Copy link

I spent the last few hours trying to figure out what was the issue of why my containers couldn't see my gpu.....turns out Frigate NVR could see and is using, but Jellyfin wasn't. Simple fix that apparently not in the documentation, add the current user of the host to the same group that the device is in aka video = card0 and render = renderD128. Possibly during setup of CasaOS there should be an auto detect for GPU and adding making it completely exposed to docker.

@jerrykuku jerrykuku moved this from Need Triage (QA+PM) to Needs Information (User) in CasaOS Issues Dec 26, 2022
@jerrykuku jerrykuku moved this to Need Triage (QA+PM) in CasaOS Issues Dec 26, 2022
@tigerinus
Copy link
Contributor

@Dvalin21

CasaOS runs under root user by default, which should have permissions for everything. Are you referring to something else?

@tigerinus tigerinus added the question Further information is requested label Dec 27, 2022
@Dvalin21
Copy link
Author

Dvalin21 commented Dec 27, 2022 via email

@tigerinus
Copy link
Contributor

I still don't get the idea of what needs to be done. Can you be more explicit?

@mojothemonkey2
Copy link
Contributor

correct me if I'm talking rubbish, but I think it's related to AMD gpus..

so to access Nvidia gpu inside containers, you would use --gpus and --runtime=nvidia.

but this does not work for AMD gpus.
instead for these, you need to add the container user (eg normally uid=1000) to the video/render groups on the host.
and pass --devices=/dev/dri/... for drivers here.
https://jellyfin.org/docs/general/administration/hardware-acceleration/#amd-amf

there is some discussion here about how docker cli should support AMD and other gpus: docker/cli#2063 (comment)
so even the docker community has not sorted this yet.

would be pretty cool if we could give support for various gpus "out of the box".
eg, following the suggestions on the docker cli post, we could:

  • add casaos user to video/render groups during install (as per this ticket).
  • find as many graphics drivers as we can, and for each, append to container run with --devices=/dev/.. .
  • also run with --gpus all and --runtime=nvidia. (may not be needed if we pass the drivers already?).

this way users don't need to worry about the extra gpu settings even.
maybe just a toggle in container settings for them to select gpu on/off.

users would still need to install the correct gpu drivers themselves (as I don't think we should try and manage that).
and it may not be possible to support all apps simultaneously - eg jellyfin uses the closed-source AMD driver, whilst another app migth want the open-source one.

but this could all be a complete rabbit hole of hardware support.

@jerrykuku jerrykuku moved this from Needs Information (User) to Future in CasaOS Issues Jan 10, 2023
@Dvalin21
Copy link
Author

@tigerinus According to the AMD driver install instructions, even with root you need to add the current user of the host to the render and video group. This will allow for the drivers and device to be available to all containers. @mojothemonkey2 you are correct.

@ETWang1991 ETWang1991 removed their assignment Jun 28, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Engineering question Further information is requested
Projects
Status: Future
Development

No branches or pull requests

4 participants