🧩 ai-stack

Rootless Podman GPU Passthrough for AMD ROCm

Getting ROCm working inside rootless Podman is mostly about two device nodes and the right group membership. Here's the complete checklist.

Minimal working service

devices: ["/dev/kfd", "/dev/dri"]
group_add: ["<render-gid>", "<video-gid>"]   # getent group render / video
security_opt: ["seccomp=unconfined"]
environment: ["HIP_VISIBLE_DEVICES=0"]

Verify from inside the container with rocminfo | grep gfx — on RDNA4 you should see gfx1201.

Technical FAQ

Which devices does ROCm need in the container?

Two: /dev/kfd (the ROCm compute interface) and /dev/dri (the DRM render nodes). Add both with devices: in compose or --device on the CLI.

I get 'permission denied' on /dev/kfd in a rootless container. Fix?

The container user must be in the host's render and video groups. Add their GIDs with group_add (find them via getent group render and getent group video).

What is HIP_VISIBLE_DEVICES for?

It selects which GPU ROCm uses. Set HIP_VISIBLE_DEVICES=0 to pin to the first/discrete GPU; check rocm-smi if an integrated GPU also appears and shifts indices.

Why do I need seccomp=unconfined?

Some ROCm/HIP ioctls are blocked by the default seccomp profile in rootless mode. security_opt: [seccomp=unconfined] is the simplest fix; a custom profile allowing the needed syscalls also works.

A bind-mounted volume is owned by root and my non-root container user can't write it. Why?

Rootless Podman maps your host user to container root by default, so a non-root in-container user can't write host-mounted paths. Use --userns=keep-id:uid=<uid>,gid=<gid> so your host user maps to that in-container user and owns the mount.

How do I verify the GPU is actually visible inside the container?

Run podman exec <name> rocminfo | grep gfx (should list your arch, e.g. gfx1201) or rocm-smi. If it errors, re-check the devices and group_add.

Do I need root or sudo to run GPU containers?

No — this is fully rootless. You only need your user in the render/video groups and the device/userns settings above. No daemon, no root.

Get the full stack on GitHub →