Closed gauth-fr closed 1 year ago
I have the same issue (on an identical setup), although the fix was simpler. Instead of -type f
, I used -xtype c
. Using a loop over all files and filtering by test
is probably more robust, since I don't know if the rendering device nodes are symlinks on some systems.
My theory is that since not even root can get read access to a file owned by nobody
, find
is unable to determine some bit of key information, and so bails out. I have no theory as for why adding -L
to find
causes it to suddenly see the nodes with -type c
. There are no symlinks involved, so that shouldn't change the behavior, yet it does.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I am also affected by this. I would say that the easy fix would be to change the following line, from:
To something like:
FILES=$(find /dev/dri /dev/dvb /dev/vchiq /dev/vc-mem /dev/video1? -type c -o -type f -print 2>/dev/null)
Here's what happen when I attach a console in the container:
root@test:/# find /dev/dri /dev/dvb /dev/vchiq /dev/vc-mem /dev/video1? -type f
/dev/dri/renderD128
/dev/dri/card0
find: ‘/dev/dvb’: No such file or directory
find: ‘/dev/vchiq’: No such file or directory
find: ‘/dev/vc-mem’: No such file or directory
find: ‘/dev/video1?’: No such file or directory
root@test:/# find /dev/dri /dev/dvb /dev/vchiq /dev/vc-mem /dev/video1? -type c
find: ‘/dev/dvb’: No such file or directory
find: ‘/dev/vchiq’: No such file or directory
find: ‘/dev/vc-mem’: No such file or directory
find: ‘/dev/video1?’: No such file or directory
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I tried sending out a PR but after a month of waiting I decided to give up. I just added a script to fix this at boot.
Terrible experience for a simple contribution.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I tried sending out a PR but after a month of waiting I decided to give up. I just added a script to fix this at boot. Terrible experience for a simple contribution.
We always appreciate PRs, however it's important to try and see things from the maintainer's perspective. I believe there is a mismatch in expectations vs reality.
For you, an individual user with an edge case issue (running in an unsupported manner like docker in lxc, aka container in cointainer), this PR may seem to be a simple contribution. However, what you probably don't realize is, we have dozens of images using this exact logic. What seems like a simple contribution to you is actually a very significant change for us that requires dozens of PRs. That's assuming the behavior change is not going to negatively impact other users for whom things may break.
All these things require a lot of thought, testing and troubleshooting. Sure, we could simply merge your PR and fix your specific issue, but we may break it for thousands of other users and you wouldn't be on the hook for providing support to them.
In any case, one of our team members spun up a container in lxc (jammy) on a debian bullseye VM on esxi and confirmed that as long as the lxc container is running privileged (it really should for docker to work properly) the devices are found by the init script we are using and are listed as character special files.
Just saying that my setup is currently an unprivileged LXC container on proxmox with id mapping for sharing the dri device. It's not true that you need a privileged setup to run docker. And this is still an issue. It's solved with the workaround I suggested.
my setup is currently an unprivileged LXC container
It's your decision to run things in an unsupported manner. Downside is, we won't provide support. To be frank, even the Proxmox team is recommending against running docker inside an lxc container (let alone an unprivileged one): https://forum.proxmox.com/threads/podman-in-lxc-what-do-overlay-not-support-file-handles-and-conflicting-options-userxattr-metacopy-mean.121825/#post-529565
Sure. Fair point. Just sharing all the information needed to possible reproduce the setup in case you are interested. I also understand your decision to not fix this, if it's problematic for others.
This issue is locked due to inactivity
Expected Behavior
Necessary groups for HW acceleration are create and added to user abc.
Current Behavior
On my setup (LXC container on proxmox running docker), this is not the case.
find /dev/dri /dev/dvb /dev/vchiq /dev/vc-mem /dev/video1? -type c -print 2>/dev/null
won't return the devices. However, checking manually with stats or ls or whatever, they (card0 & renderD128) show as character special file.My Bypass
I create a 90-add-group, which is a modified version of 40-gid-video, using find to find regular file then filter in the loop if it's a char special file.
Steps to Reproduce
groups abc
Environment
OS: Proxmox / LXC Ubunto 20.04.4 CPU architecture: x86_64 How docker service was installed: Official repo
Command used to create docker container (run/create/compose/screenshot)
Docker logs (which also contains my custom-cont script)