You are not logged in.

#1 2024-07-07 02:05:24

jemorgan
Member
Registered: 2021-12-13
Posts: 3

Unable to get hardware acceleration working on AMD system in Wayland

The symptom that brought the hardware decoding issue to my attention is that Firefox appears to crash randomly when I navigate to specific websites. I noticed that the same web pages would always result in a crash, and then I noticed that the webpages that were causing crashes included canvas elements or video.

I worked my way through the Hardware Video Acceleration Arch Wiki page, but I reached a dead end at Verifying VA-API

System Specifics

DE: Hyprland (issue doesn't occur in X)
CPU: AMD Ryzen 7 7800X3D (16) @ 5.050GHz
GPU: AMD ATI 0f:00.0 Raphael (integrated, display is plugged into the dedicated GPU)
GPU: AMD ATI Radeon RX 7900 XT/7900 XTX/7900M (Dedicated)

What I've tried

As per the Arch wiki, installed the following:
1. mesa
2. xf86-video-amdgpu
3. vulkan-radeon
4. libva-mesa-driver
5. mesa-vdpau


At the "verification" step, I get the following output launching mpv with a h.264 file:

mpv --hwdec=auto Big_Buck_Bunny_1080_10s_5MB.mp4
(+) Video --vid=1 (*) (h264 1920x1080 60.000fps)
Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
Cannot load libcuda.so.1
[ffmpeg/video] h264: Device does not support the VK_KHR_video_decode_queue extension!
[ffmpeg/video] h264: Failed setup for format vulkan: hwaccel initialisation returned error.
[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
[ffmpeg/video] h264_v4l2m2m: Could not find a valid device
[ffmpeg/video] h264_v4l2m2m: can't configure decoder
Could not open codec.
VO: [gpu] 1920x1080 yuv420p

And the following with an h.265 file:

❯ mpv --hwdec=auto ./LG\ New\ York\ HDR\ UHD\ 4K\ Demo.zip
Playing: archive://./LG New York HDR UHD 4K Demo.zip|/LG New York HDR UHD 4K Demo.ts
[ffmpeg/demuxer] mpegts: start time for stream 1 is not set in estimate_timings_from_pts
[libarchive] possibly unsupported seeking - switching to reopening
[ffmpeg/demuxer] mpegts: stream 1 : no TS found at start of file, duration not set
[ffmpeg/demuxer] mpegts: Could not find codec parameters for stream 1 (Audio: aac ([15][0][0][0] / 0x000F), 0 channels): unspecified sample format
[ffmpeg/demuxer] Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
(+) Video --vid=1 (hevc 3840x2160 25.000fps)
(+) Audio --aid=1 (aac)
Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
Cannot load libcuda.so.1
[ffmpeg/video] hevc: Device does not support the VK_KHR_video_decode_queue extension!
[ffmpeg/video] hevc: Failed setup for format vulkan: hwaccel initialisation returned error.
[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
[ffmpeg/video] hevc_v4l2m2m: Could not find a valid device
[ffmpeg/video] hevc_v4l2m2m: can't configure decoder
Could not open codec.
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 3840x2160 yuv420p10

With both,

nvtop

reports enc and dec are 0%.

Running

vainfo

gives me the following error:

❯ vainfo
Trying display: wayland
vaInitialize failed with error code -1 (unknown libva error),exit

What else can I try to get hardware acceleration working? The most notable issue I'm encountering is that firefox crashes on any page that attempts to use it (if it's enabled). Disabling hardware acceleration fixes the crashes, but performance takes a noticeable hit and I'd like to see if I can fix the issue before throwing in the towel.

Thanks

Offline

#2 2024-07-07 20:47:50

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,636

Re: Unable to get hardware acceleration working on AMD system in Wayland

I'm assuming a conflict with the two render devices, try to completely disable the integrated GPU in your UEFI.

If you can't do that, see step 5 under: https://wiki.archlinux.org/title/Firefo … celeration

Last edited by V1del (2024-07-07 21:32:04)

Offline

Board footer

Powered by FluxBB