On 2025-05-12 22:32, Cordell Bloor wrote: > On 2025-05-12 10:54, Christian Kastner wrote: >> [3]: Sadly, after much trying, it seems that the analog for [1] in >> rootless containers, using the 'podman+rocm' backend, is not >> possible due to come cgroupsv2 restriction. However, I still >> have the code for that, and I guess I could ship it for people who >> want to try it in rootful containers. > > I take it you are referring to setting environment variables in podman > workers? The ROCR_VISIBLE_DEVICES variable can isolate the GPU at a > fairly low level in the ROCm user land [2]. Or, do you mean only passing > through a subset of devices at all? I forget how you were approaching this.
I was referring to passing in the devices, which seems to be the approach preferred by the official documentation [5], but not possible in rootless containers because of [6]. I did try to switch over to ROCR_VISIBLE_DEVICES at some point, but ran into some impediment. Don't immediately recall what it was. That reminds me though, ROCR_VISIBLE_DEVICES can be passed as-is, without needing magic. IOW, the following should work (though untested): autopkgtest -B <package> --env=ROCR_VISIBLE_DEVICES=xxx -- podman+rocm Best, Christian [5]: https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/docker.html#restricting-gpu-access [6]: https://github.com/containers/podman/issues/21454#issuecomment-1920058541