I run a Debian VM with Plex on, and I pass through the iGPU which can be used by Plex for transcoding. Depending on the model of Intel CPU, the Integrated GPU is quite powerful for Plex transcoding and it has become a widely chosen option rather than buying a discrete GPU for the task. This fix works for Plex running natively on a VM only, I don’t run it in a docker.
William Lam has already blogged about how you can pass the iGPU through to a VM so I won’t be covering that. Please check out his blog for instructions.
The issue I was having is that sometimes Plex would not detect the iGPU and fall back to software transcoding, which is extremely CPU intensive. I’d see error messages in the Plex Media Server log file essentially saying that it could not find suitable hardware to transcode.
A reboot would occasionally fix it, but not always. At first I thought it was that with Debian 11 there is no native i915 driver in the Kernel, and after putting it off for several months, I finally upgraded to Debian 12 however the issue remained. Whilst troubleshooting something else I restarted the Plex service and transcoding started working all of a sudden. I figured the Plex service was starting before the i915 driver was loading, so I put on a 5 second delay on the Plex service and everything has been working perfectly since. Edit the service:
systemctl edit plexmediaserver.service
Then add the following line:
ExecStartPre=/bin/sleep 5
My service looks like this:
Service]
Environment="TMPDIR=/tmp/chris/Plex"
ExecStartPre=/bin/sleep 5
ExecStartPre=/usr/bin/mkdir -p /tmp/chris/Plex
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/chris/.config/"
User=chris
Group=chris
There may be other ways to achieve the same result, but this works perfectly for me.