Any advise for a new user to get hw accelerated video working with gpu-passthrough?

Hello everyone,

I used fedora-40 template in HVM mode and kernel provided with qube, I have passed the gpu and related devices to vm.

05:00.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti Rev. A] (rev a1)
05:00.1 Audio device: NVIDIA Corporation TU102 High Definition Audio Controller (rev a1)
05:00.2 USB controller: NVIDIA Corporation TU102 USB 3.1 Host Controller (rev a1)
05:00.3 Serial bus controller: NVIDIA Corporation TU102 USB Type-C UCSI Controller (rev a1)

I’m using nvidia proprietary drivers, nvidia-smi shows 565.77 version. Output from vainfo and vdpauinfo also seems fine and lists HEVC decoder.

When I try to play HEVC encoded video with ā€œmpv --hwdec=autoā€, I get this kind of output:

MESA-LOADER: failed to open bochs-drm: /usr/lib64/dri/bochs-drm_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib64/dri, suffix _dri)
…
[vo/gpu/drm] Picked DRM card 1, primary node /dev/dri/card1 as the default.
…
[vd] Selected codec: HEVC (High Efficiency Video Coding)
…
[vd] Using hardware decoding (nvdec).
…
[vo/gpu] Loading hwdec drivers for format: ā€˜cuda’

full mpv log

From what I understood, that error might not matter but then again, I don’t understand that much.

So it says it’s using hardware decoding but there are dropped frames and nvtop shows over 100% cpu load on 1080p video, so it doesn’t seem to be working any better than software rendering and can’t play 4k videos. So, I don’t think it’s working correctly.

Is this be because I still use qubes display and can this even work without me having its own output on passed through gpu? In ~/.local/share/xorg/Xorg.0.log I have this:

[ 9.130] (II) AIGLX: Screen 0 is not DRI2 capable
[ 9.245] (II) IGLX: Loaded and initialized swrast

Xorg sees two cards but there are errors:

[ 8.885] (II) xfree86: Adding drm device (/dev/dri/card1)
[ 8.886] (II) systemd-logind: got fd for /dev/dri/card1 226:1 fd 13 paused 1
[ 8.886] (EE) Error systemd-logind returned paused fd for drm node
[ 8.886] (II) systemd-logind: releasing fd for 226:1
[ 8.886] (II) xfree86: Adding drm device (/dev/dri/card0)
[ 8.887] (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 14 paused 1
[ 8.887] (EE) Error systemd-logind returned paused fd for drm node
[ 8.887] (II) systemd-logind: releasing fd for 226:0

Xorg log also has this but I have no idea what it means:

[ 9.279] (**) qubesdev: (accel) keeping acceleration scheme 1
[ 9.279] (**) qubesdev: (accel) acceleration profile 0
[ 9.279] (**) qubesdev: (accel) acceleration factor: 2.000
[ 9.279] (**) qubesdev: (accel) acceleration threshold: 4
[ 9.279] (II) qubesdev: On.

It seems so close to be working. Any hints?

Edit:
With mpv --vo=x11 -profile=sw-fast I now get just 16% cpu load on 4k hevc video and no dropped frames. It says that it’s using software decoding but I didn’t get this smooth video with that same command line without a gpu. This is much better than when it supposedly used hardware decoding. I don’t understand what’s going on but I’m happy my videos are playing.

1 Like