hw-acceleration
Pass the host's Intel GPU into an existing privileged LXC container and install the VA-API drivers inside it.
hw-acceleration.sh adds the device entries for an Intel integrated GPU to a privileged container's configuration and installs the Intel media drivers in the container, so that applications such as media servers can use hardware transcoding. It is not listed on the website.
Source: tools/pve/hw-acceleration.sh.
Run
In the Proxmox VE host shell, as root:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/hw-acceleration.sh)"Requirements checked by the script
| Check | Result if not met |
|---|---|
pveversion matches pve-manager/8.0 to 8.4 | The script stops. Proxmox VE 8.5 and later and 9.x are not accepted. |
Architecture is not arm64 | "Intel HW acceleration is only available on x86 (Intel) systems.", exit |
At least one container without unprivileged: 1 exists | "No Privileged Containers Found.", exit |
Prompts
| Prompt | Choices | Effect |
|---|---|---|
| "This Will Add Intel HW Acceleration to an existing LXC Container. Proceed?" | Yes / No | No ends the script. |
| "Select a Container To Add Intel HW Acceleration:" (checklist of privileged containers) | Tick exactly one | The container to change. The script uses the result as a single ID and does not validate it. |
Verbose mode? <y/N> | y | Shows the output of apt-get and adduser in the container. |
Do you need the intel-media-va-driver-non-free driver (Debian 12 only)? <y/N> | y / anything else | Chooses the driver set, see below. |
A final box names the tools that were installed: vainfo and intel_gpu_top.
What it changes
On the host, these lines are appended to /etc/pve/lxc/<id>.conf:
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.cgroup2.devices.allow: c 29:0 rwm
lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file
lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=fileIn the container, through pct exec:
| Answer to the driver question | Changes |
|---|---|
y | Writes /etc/apt/sources.list.d/non-free.list with Debian bookworm entries including non-free and non-free-firmware, runs apt-get update and installs intel-media-va-driver-non-free, ocl-icd-libopencl1, intel-opencl-icd, vainfo, intel-gpu-tools. |
| anything else | Installs va-driver-all, ocl-icd-libopencl1, intel-opencl-icd, vainfo, intel-gpu-tools, then chgrp video /dev/dri and chmod 755 /dev/dri. |
In both cases the container's root user is added to the groups video and render.
Reboot the container afterwards. Then check inside it:
vainfoUndo
The script offers none. Remove the six lines from /etc/pve/lxc/<id>.conf and restart the container. The packages and, if written, /etc/apt/sources.list.d/non-free.list stay in the container until you remove them.
Environment variables
| Variable | Default | Purpose |
|---|---|---|
COMMUNITY_SCRIPTS_CORE_URL | https://raw.githubusercontent.com/community-scripts/core/main | Base URL the script loads api/api.func from. |
Limits
- Privileged containers only. Unprivileged containers are not offered.
- The container must be running, because the packages are installed with
pct exec. The script does not start it. - The container must be Debian-based (
apt-get). The non-free option writesbookwormsources regardless of the container's release, so use it on Debian 12 only. - The device numbers are fixed:
226:0(card0),226:128(renderD128) and29:0(fb0). A host with several GPUs may have the Intel GPU under other numbers. - Running the script twice on the same container appends the six lines twice.