Are you pulling your hair out trying to get your AMD Radeon graphics card working in a Proxmox LXC container? Have you been defeated by endless loops of vainfo: failed to initialize display and cryptic Operation not permitted errors? You’re not alone.
Most guides on the internet are written for full VMs or NVIDIA cards, leaving AMD users in a maze of conflicting advice. This guide is different. Born from a real, marathon troubleshooting session, this is the definitive, battle-tested method to achieve flawless Proxmox LXC AMD GPU passthrough.
We’ll get your AMD GPU, like the popular Radeon RX 5700 XT, fully accelerating applications like Immich, Scrypted, Plex, or Jellyfin, unleashing its true potential for hardware transcoding and AI.
Why Is This So Hard? The Core Problem
The primary challenge with unprivileged LXC containers is permissions. An unprivileged container is a secure sandbox where even the root user inside is just a regular user on the host. This security model aggressively prevents the container from accessing hardware directly, leading to the frustrating errors that block so many users.
After extensive testing, the solution is clear: a privileged container is the most reliable path to success for this use case. This guide will walk you through the entire process, from host preparation to the final, working configuration.
Section 1: Preparing Your Proxmox Host
First, we need to ensure your Proxmox host is correctly set up to recognize the GPU and load the necessary components.
Step 1.1: Enable IOMMU
While more critical for full VM passthrough, enabling IOMMU (VT-d for Intel, AMD-Vi for AMD) is a best practice.
- SSH into your Proxmox host and edit the GRUB configuration:Bash
nano /etc/default/grub - Find the line
GRUB_CMDLINE_LINUX_DEFAULT="quiet"and modify it.- For AMD CPUs:
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on" - For Intel CPUs:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"
- For AMD CPUs:
- Save the file (
Ctrl+X,Y,Enter), update GRUB, and reboot:Bashupdate-grub reboot
Step 1.2: Install AMD Firmware (Crucial Step!)
Proxmox is based on Debian, which doesn’t always include the non-free firmware required by AMD GPUs. This is a common failure point.
- On the Proxmox host, install the firmware package:
Bashapt update apt install firmware-amd-graphics - Reboot the host again to ensure it’s loaded.
reboot
Step 1.3: Verify Host Recognition (Do NOT Blacklist)
This is where our guide diverges from most others. For LXC passthrough of a render device, you do not want to blacklist the host driver. The container needs the host to initialize the card and create the device file it will mount.
- After rebooting, verify the host sees the GPU’s render node:Bash
ls -l /dev/dri/ - You should see a successful output like this. The key is
renderD128.total 0 crw-rw---- 1 root video 226, 0 Sep 30 08:30 card0 crw-rw---- 1 root render 226, 128 Sep 30 08:30 renderD128
If you see this, your host is perfect. Do not proceed until this is working.
Section 2: Creating and Configuring the Privileged LXC
Now we’ll create the container and apply the magic configuration.
Step 2.1: Create the LXC Container
Create a new container as you normally would. For this guide, we’ll use Debian or Ubuntu. The key is to create it, but don’t start it yet.
Step 2.2: The Golden LXC Configuration
This is the heart of the solution. We need to convert the container to privileged mode and add the device passthrough lines.
- On the Proxmox host, edit the container’s configuration file. The ID
103 is just an example.nano /etc/pve/lxc/103.conf - Modify and add the following lines:
- Find the line
unprivileged: 1and delete it. This makes the container privileged. - Add the following lines to the end of the file:Code snippet
lxc.apparmor.profile: unconfinedlxc.cgroup2.devices.allow: c 226:128 rwmlxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file
- Find the line
What do these lines do?
lxc.apparmor.profile: unconfined: Relaxes the AppArmor security profile, preventing it from interfering with hardware access.lxc.cgroup2.devices.allow: Gives the container permission to access the character device with major/minor numbers226:128(yourrenderD128node).lxc.mount.entry: Mounts the device file from the host directly into the container.
Section 3: Final Steps Inside the Container
Now, it’s time to start the container and verify our success.
- Start the LXC container from the Proxmox web UI.
- Open the container’s console or SSH into it.
- Install the necessary user-space drivers and tools:Bash
apt update apt install -y mesa-va-drivers vainfo - The moment of truth! Run
vainfo:Bashvainfo
You should be greeted with a glorious wall of text detailing your GPU’s capabilities, free of any errors.
[Image: A screenshot of the successful vainfo output showing the AMD Radeon RX 5700 XT driver version and the list of supported profiles.]
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Mesa Gallium driver ... for AMD Radeon RX 5700 XT ...
vainfo: Supported profile and entrypoints
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
...
Conclusion & Key Takeaways
Congratulations! You have successfully configured Proxmox LXC AMD GPU passthrough. The key takeaways from this journey are:
- Privileged is the Way: For hardware device passthrough, the security restrictions of unprivileged containers are often the ultimate roadblock. A privileged container is the most reliable solution.
- Don’t Blacklist the Host Driver: Unlike full VM passthrough, LXC needs the host to initialize the card so it can mount the
/dev/dri/renderD128device file. - Install Host Firmware: A missing firmware package is a common, silent failure point.
You can now apply this same configuration to your other LXC containers, like Scrypted, to share the power of your AMD GPU across your home lab.
If this guide saved you from throwing your server out the window, share it with others who might be struggling! For more deep dives into self-hosting and hardware, stay tuned to kextcache.com.