-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for device_cgroup_rules in rootless mode #25365
Comments
Well we do not make the rules about the permissions, the kernel does. And AFAIK device_cgroup_rules are converted to an ebpf program and such programs are only allowed by the kernel when created as real root. As such podman can do nothing about this and we return this error to make it clear that this will not work. Though looking at our man page it is not mentioned there so it should be documented there as well. cc @giuseppe In case I am wrong about the ebpf part. |
Thanks for your answer! Would it be possible to just ignore it when running Podman rootless (and maybe show a short message on the terminal) instead of just aborting the composing? :) |
@Luap99 you are right about ebpf. Only root in the initial user namespace can use that. Rootless users can't configure the devices cgroup. @loxoron218 I don't think we can just ignore it, if the user specifies to block access to some devices and we just ignore it, that can be considered a security vulnerability. Can you show me how the |
@giuseppe The one used by Immich's machine learning looks like something like this:
|
Feature request description
When using Podman in rootless mode, configurations involving
device_cgroup_rules
and hardware acceleration (e.g., GPUs, Intel OpenVINO, ARM Mali) are not supported. This limits the ability to run machine learning workloads or other applications that require access to hardware devices in a rootless environment.For example, when using the Immich Machine Learning service with an extends file that includes hardware acceleration configurations (e.g.,
device_cgroup_rules
, devices, or volumes for /dev/dri, /dev/bus/usb, etc.), the following error occurs:Error: device cgroup rules are not supported in rootless mode or in a user namespace
Error: no container with name or ID "immich_machine_learning" found: no such container
Suggest potential solution
Implement support for device_cgroup_rules and related device configurations in rootless mode. This could involve:
Have you considered any alternatives?
Commenting out
device_cgroup_rules
, the container builds as expected.Running it with sudo (or with Docker) works too, but defeats the purpose I guess of using Podman
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: