[PR #5875] [MERGED] core: Fix VAAPI passthrough for unprivileged LXC containers via devX #5819

Closed
opened 2026-02-26 14:35:21 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/5875
Author: @MickLesk
Created: 7/9/2025
Status: Merged
Merged: 7/9/2025
Merged by: @tremor021

Base: mainHead: MickLesk-patch-1


📝 Commits (2)

  • 94f835e core: Fix VAAPI passthrough for unprivileged LXC containers via devX mapping
  • cf71bc7 formatting

📊 Changes

2 files changed (+26 additions, -43 deletions)

View changed files

📝 misc/build.func (+26 -42)
📝 misc/core.func (+0 -1)

📄 Description

✍️ Description

This PR improves VAAPI passthrough handling for unprivileged LXC containers (CT_TYPE=1) in the build_container() function.

🔧 Changes

  • Avoids using lxc.mount.entry and lxc.cgroup2.devices.allow for unprivileged containers to prevent container startup failures (autodev hook error)
  • Instead, sets dev0: and dev1: entries in the LXC config:
    • dev0: /dev/dri/card0,gid=44
    • dev1: /dev/dri/renderD128,gid=104
  • These entries are safe for unprivileged containers and ensure device visibility in the Proxmox WebUI
  • Automatically detects devices and applies only when required (based on app name and hardware availability)
  • vainfo and ffmpeg -hwaccels confirm functional VAAPI passthrough

📌 Context

The previous VAAPI passthrough logic caused failures on unprivileged containers due to invalid device mappings.
This fix ensures safe usage while preserving full hardware acceleration support for compatible apps (e.g. Jellyfin, Plex, Frigate).

🧪 Validation

Tested with:

  • Unprivileged LXC (CT_TYPE=1)
  • Intel iGPU (iHD driver)
  • Jellyfin & ffmpeg inside container
  • Devices correctly visible and functional

Link: #5443

Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE/pull/5875 **Author:** [@MickLesk](https://github.com/MickLesk) **Created:** 7/9/2025 **Status:** ✅ Merged **Merged:** 7/9/2025 **Merged by:** [@tremor021](https://github.com/tremor021) **Base:** `main` ← **Head:** `MickLesk-patch-1` --- ### 📝 Commits (2) - [`94f835e`](https://github.com/community-scripts/ProxmoxVE/commit/94f835e90e83490a71b4c08a8b44826a826c47ee) core: Fix VAAPI passthrough for unprivileged LXC containers via devX mapping - [`cf71bc7`](https://github.com/community-scripts/ProxmoxVE/commit/cf71bc79e8bb72c0cbbedd1ee1087b9a556a2d8e) formatting ### 📊 Changes **2 files changed** (+26 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `misc/build.func` (+26 -42) 📝 `misc/core.func` (+0 -1) </details> ### 📄 Description ## ✍️ Description This PR improves VAAPI passthrough handling for unprivileged LXC containers (`CT_TYPE=1`) in the `build_container()` function. ## 🔧 Changes - Avoids using `lxc.mount.entry` and `lxc.cgroup2.devices.allow` for unprivileged containers to prevent container startup failures (`autodev hook` error) - Instead, sets `dev0:` and `dev1:` entries in the LXC config: - `dev0: /dev/dri/card0,gid=44` - `dev1: /dev/dri/renderD128,gid=104` - These entries are safe for unprivileged containers and ensure device visibility in the Proxmox WebUI - Automatically detects devices and applies only when required (based on app name and hardware availability) - `vainfo` and `ffmpeg -hwaccels` confirm functional VAAPI passthrough ## 📌 Context The previous VAAPI passthrough logic caused failures on unprivileged containers due to invalid device mappings. This fix ensures safe usage while preserving full hardware acceleration support for compatible apps (e.g. Jellyfin, Plex, Frigate). ## 🧪 Validation Tested with: - Unprivileged LXC (CT_TYPE=1) - Intel iGPU (iHD driver) - Jellyfin & ffmpeg inside container - Devices correctly visible and functional ## 🔗 Related PR / Issue Link: #5443 ## ✅ Prerequisites (**X** in brackets) - [x] **Self-review completed** – Code follows project standards. - [x] **Tested thoroughly** – Changes work as expected. - [x] **No security risks** – No hardcoded secrets, unnecessary privilege escalations, or permission issues. --- ## 🛠️ Type of Change (**X** in brackets) - [x] 🐞 **Bug fix** – Resolves an issue without breaking functionality. - [ ] ✨ **New feature** – Adds new, non-breaking functionality. - [ ] 💥 **Breaking change** – Alters existing functionality in a way that may require updates. - [ ] 🆕 **New script** – A fully functional and tested script or script set. - [ ] 🌍 **Website update** – Changes to website-related JSON files or metadata. - [ ] 🔧 **Refactoring / Code Cleanup** – Improves readability or maintainability without changing functionality. - [ ] 📝 **Documentation update** – Changes to `README`, `AppName.md`, `CONTRIBUTING.md`, or other docs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 14:35:21 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ProxmoxVE#5819
No description provided.