Add intel gpu support to the incus lxc containers on 25.04

’ve recently upgraded to TrueNAS 25.04, which now includes Incus integration. Previously, I was using the jailmaker script to create containers and successfully pass the Intel iGPU (via /dev/dri) into them for hardware-accelerated tasks like video transcoding.

Now I’m trying to migrate my workflow to use Incus-managed containers, but I’ve run into an issue: /dev/dri is not present inside the new containers, so the iGPU isn’t accessible.

On the host, /dev/dri exists and shows the expected devices (card0, renderD128). But inside the container created via Incus, /dev/dri is missing.

What’s the correct/best way to pass the Intel GPU into an Incus container on TrueNAS 25.04?

You can add manually (/dev/dri) using shell:
incus config edit <your_container>
in the section devices add:
devices:
gpu0:
gid: “44”
gputype: physical
pci: “0000:00:02.0”
type: gpu

of course your gid and pci address could be different…

In the TrueNAS shell, you can use lspci to figure out your device:

$ lspci | grep VGA  
00:02.0 VGA compatible controller: Intel Corporation Alder Lake-UP3 GT2 [Iris Xe Graphics] (rev 0c)

This incus command will add the GPU to your container:

sudo incus config device add mycontainer intel-gpu gpu pci=0000:00:02.0 gid=44 gputype=physical

You may want to allow your user to access the device:

sudo incus exec mycontainer -- bash -c "usermod -aG video myuser"

And then test it:

myuser@mycontainer:~$ glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Mesa Intel(R) Iris(R) Xe Graphics (ADL GT2)
1 Like

I’m curious if those containers became incompatible with newer releases of TrueNAS since they were modified in the CLI. At least the warning advises against doing that :smiley:

I’ve tried to add id via cli, and it works. But it brakes the UI

Read here for a bit more info. It shouldn’t break the UI. I have Nvidia GPU’s passed through and are managed fine without any issue.

No it does not break the GUI. It will show “GPU: Unknown” under Devices.

I can add that any invalid entry in the instance config MAY break the GUI. Eg I did not have gputype specified previously and that created problems all the way to even the Datasets page in the GUI.

1 Like