Re: Firefox Hardware acceleration & VA-API how-to

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Video decoding on NVIDIA
Please buy some real Linux hardware.

This doesn't really help at all. Is it supposed to be funny, or is it
just cynical resignation?

After trying to configure HW acceleration on 9xx series GPU, I'll just take that as a serious response.
Consider following points:
  * VDPAU is not compatible with Wayland, our main desktop scenario.
  * Video decoding in Firefox on X11 is limited to X11/EGL, which does not work with the Nvidia proprietary driver (but at least there's a hope for that scenario).
  * There's no NVDEC vaapi backend, and I see opinions that it would be hard to fit NVDEC into vaapi model.
  * Nouveau support ends at VP5 (7xx series).

The wording might be different, but _at the moment_ any recent Nvidia hardware cannot be used for HW video acceleration in Firefox.


currently,for proprietary nvidia hw accel

useful docs

	https://wiki.archlinux.org/title/Hardware_video_acceleration

e.g.

on

	lsb_release -rd
		Description:    Fedora release 35 (Thirty Five)
		Release:        35

with nvidia hw,

	hwinfo --gfxcard | egrep " Model| Device| Driver:"
		Model: "nVidia GP108 [GeForce GT 1030]"
		Device: pci 0x1d01 "GP108 [GeForce GT 1030]"
		Driver: "nvidia"

latest upstream driver,

	nvidia-settings -q NvidiaDriverVersion

		Attribute 'NvidiaDriverVersion' (test.loc:0.0): 495.44
		Attribute 'NvidiaDriverVersion' (test.loc:0[gpu:0]): 495.44

	lsmod | grep nv
		nvidia_uvm           1167360  0
		nvidia_drm             73728  8
		nvidia_modeset       1150976  20 nvidia_drm
		nvidia              36950016  1354 nvidia_uvm,nvidia_modeset
		drm_kms_helper        303104  1 nvidia_drm
		drm                   630784  14 drm_kms_helper,nvidia,drm_ttm_helper,nvidia_drm,ttm


currently, this set of relevant pkgs

	rpm -qa | egrep "libva|nvidia|vdpau|dkms|kernel-devel|glx|^egl|glvnd|libvpx|vulkan"
		dkms-2.8.6-1.fc35.noarch
		egl-utils-8.4.0-12.20210504git0f9e7d9.fc35.x86_64
		glx-utils-8.4.0-12.20210504git0f9e7d9.fc35.x86_64
		kernel-devel-5.14.17-301.fc35.x86_64
		libglvnd-1.3.4-2.fc35.x86_64
		libglvnd-core-devel-1.3.4-2.fc35.x86_64
		libglvnd-devel-1.3.4-2.fc35.x86_64
		libglvnd-egl-1.3.4-2.fc35.x86_64
		libglvnd-gles-1.3.4-2.fc35.x86_64
		libglvnd-glx-1.3.4-2.fc35.x86_64
		libglvnd-opengl-1.3.4-2.fc35.x86_64
		libva-2.13.0-2.fc35.x86_64
		libva-utils-2.13.0-1.fc35.x86_64
		libva-vdpau-driver-0.7.4-110.fc35.x86_64
		libvdpau-1.4-6.fc35.x86_64
		libvdpau-devel-1.4-6.fc35.x86_64
		libvdpau-trace-1.4-6.fc35.x86_64
		libvdpau-va-gl-0.4.2-20.fc35.x86_64
		libvpx-1.10.0-2.fc35.x86_64
		mesa-vdpau-drivers-21.2.5-1.fc35.x86_64
		mesa-vulkan-drivers-21.2.5-1.fc35.x86_64
		vdpauinfo-1.4-1.fc35.x86_64
		vulkan-headers-1.2.189.0-1.fc35.noarch
		vulkan-loader-1.2.189.0-1.fc35.x86_64
		vulkan-loader-devel-1.2.189.0-1.fc35.x86_64
		vulkan-tools-1.2.189.0-1.fc35.x86_64

checking for X11

	grep -iE 'vdpau | dri driver' /var/log/Xorg.0.log
		[    37.637] (II) NVIDIA(0): [DRI2]   VDPAU driver: nvidia

verifying

	ldd `which mpv` | egrep -i "egl|nvidia|vdpau"
		libEGL.so.1 => /lib64/libEGL.so.1 (0x00007fadfdbb4000)
		libwayland-egl.so.1 => /lib64/libwayland-egl.so.1 (0x00007fadfbdbe000)
		libvdpau.so.1 => /lib64/libvdpau.so.1 (0x00007fadfacea000)

	VDPAU_DRIVER=nvidia mpv --hwdec=auto TEST.mp4
		 (+) Video --vid=1 (*) (h264 1920x1080 30.015fps)
		 (+) Audio --aid=1 --alang=eng (*) (aac 2ch 48000Hz)
		Using hardware decoding (nvdec).
		AO: [pulse] 48000Hz stereo 2ch float
		VO: [gpu] 1920x1080 cuda[nv12]
		AV: 00:00:02 / 00:00:39 (7%) A-V:  0.026 ct:  0.256

for FF

	rpm -qa firefox
		firefox-94.0-1.fc35.x86_64

read

	https://www.phoronix.com/scan.php?page=news_item&px=Firefox-94-EGL-Linux-Usage
	https://mozillagfx.wordpress.com/2021/10/30/switching-the-linux-graphics-stack-from-glx-to-egl/

note

	"In X.org, since 94, Firefox will run in EGL mode by default which is sufficient [19]."

user.js settings currently include,

	user_pref("media.ffmpeg.enabled", true);
	user_pref("media.ffmpeg.vaapi.enabled", true);
	user_pref("media.ffmpeg.vaapi-drm-display.enabled", true);
	user_pref("media.ffvpx.enabled", false);
	user_pref("media.navigator.mediadatadecoder_vpx_enabled", true);
	user_pref("media.rdd-ffvpx.enabled", false);
	user_pref("media.rdd-vpx.enabled", false);

check

	grep -iE 'vdpau | dri driver' /var/log/Xorg.0.log
		[   216.777] (II) NVIDIA(0): [DRI2]   VDPAU driver: nvidia
		                                                    ^^^^^^

	hwinfo --gfxcard | grep "SysFS ID"
		SysFS ID: /devices/pci0000:00/0000:00:03.1/0000:09:00.0

	ls -d /sys/devices/pci0000:00/0000:00:03.1/0000:09:00.0/drm/render*
		/sys/devices/pci0000:00/0000:00:03.1/0000:09:00.0/drm/renderD128/

	ls -al /usr/lib64/dri/nvidia_drv_video*
		lrwxrwxrwx 1 root root 18 Jul 22 12:18 /usr/lib64/dri/nvidia_drv_video.so -> vdpau_drv_video.so*
		                                                      ^^^^^^

launch @ shell

	VDPAU_DRIVER=nvidia MOZ_LOG="Dmabuf:5, PlatformDecoderModule:5" firefox

nav to

	https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4

@ shell


	...
	[Child 19933: Main Thread]: D/Dmabuf nsDMABufDevice::IsDMABufVAAPIEnabled: EGL 1 DMABufEnabled 1  media_ffmpeg_vaapi_enabled 1 CanUseHardwareVideoDecoding 1 !XRE_IsRDDProcess 1
	...
	[RDD 20039: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in RDD process
	[RDD 20039: Main Thread]: D/Dmabuf nsDMABufDevice::Configure()
	[RDD 20039: Main Thread]: D/Dmabuf Loading DMABuf system library libgbm.so.1 ...
	...
	[RDD 20039: Main Thread]: D/Dmabuf DMABuf is enabled, using drm node /dev/dri/renderD128
	[RDD 20039: Main Thread]: D/Dmabuf nsDMABufDevice::IsDMABufVAAPIEnabled: EGL 1 DMABufEnabled 1  media_ffmpeg_vaapi_enabled 1 CanUseHardwareVideoDecoding 1 !XRE_IsRDDProcess 0
	[RDD 20039: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
	...
	[Child 19933: MediaPDecoder #2]: D/Dmabuf nsDMABufDevice::IsDMABufVAAPIEnabled: EGL 1 DMABufEnabled 1  media_ffmpeg_vaapi_enabled 1 CanUseHardwareVideoDecoding 1 !XRE_IsRDDProcess 1
	[Child 19933: MediaPDecoder #2]: D/Dmabuf nsDMABufDevice::IsDMABufVideoEnabled: EGL 1 DMABufEnabled 1  !media_ffmpeg_dmabuf_textures_disabled 1 !XRE_IsRDDProcess() 1
	[Child 19933: MediaPDecoder #2]: D/PlatformDecoderModule Initialising VA-API FFmpeg decoder
	libva info: VA-API version 1.13.0
	[Child 19933: MediaPDecoder #2]: D/PlatformDecoderModule Initialising FFmpeg decoder.
	[Child 19933: MediaPDecoder #2]: D/PlatformDecoderModule FFmpeg init successful.
	[Child 19933: MediaPDecoder #2]: D/PlatformDecoderModule Choosing FFmpeg pixel format for video decoding.
	[Child 19933: MediaPDecoder #2]: D/PlatformDecoderModule Requesting pixel format YUV420P.
	[vp9 @ 0x7f8a48d85800] Format yuv420p chosen by get_format().
	[Child 19933: MediaPDecoder #1]: D/PlatformDecoderModule AudioTrimmer[7f8a37ab3e80] ::PrepareTrimmers: sample[0,21000] no trimming information
	[RDD 20039: MediaPDecoder #1]: D/PlatformDecoderModule OpusDataDecoder[7fb627975080] ::Decode: Opus decoder skipping 312 of 960 frames
	[Child 19933: MediaPDecoder #3]: D/PlatformDecoderModule AudioTrimmer[7f8a37ab3e80] ::HandleDecodedResult: sample[0,21000] (decoded[0,13500] no trimming needed
	[Child 19933: MediaPDecoder #2]: D/PlatformDecoderModule DMABuf Got one frame output with pts=0dts=0 duration=33000 opaque=-9223372036854775808
	...


ymmv
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux