WebPlatformForEmbedded / WPEWebKit

WPE WebKit port (downstream)
211 stars 135 forks source link

wpe via wpevideosrc not following prime-select nvidia gpu #1223

Closed vanderhoff closed 8 months ago

vanderhoff commented 10 months ago

I have set up wpe for gstreamer wpevideosrc on Ubuntu 22.04 on a laptop with a base gpu (intel) and addition GPU nvidia 2060 (m).

I am getting different results depending if using wsl2 from win 11 or native Ubuntu 22.04

standard cmd for all tests LIBGL_ALWAYS_SOFTWARE=false gst-launch-1.0 --eos-on-shutdown wpevideosrc location="https://webglreport.com/" ! videorate ! video/x-raw,framerate=50/1 ! videoconvert ! video/x-raw,width=1920,height=1080,framerate=50/1 ! ximagesink

WSL2 (win11) - reports using apple - but actually using nvidia GPU as expected

image prime-select query: on-demand nvidia-smi: NVIDIA-SMI 530.30.04 Driver Version: 531.29 CUDA Version: 12.1

rendering https://www.kevs3d.co.uk/dev/shaders/distancefield8.html generates 50FPS as expected if changing LIBGL_ALWAYS_SOFTWARE=ftrue, then FPS = 1

**So WSL2 is using the GPU as expected

Ubuntu 22.04 native (same laptop)

image left image shows WPEVIDEOSRC rendering https://www.kevs3d.co.uk/dev/shaders/distancefield8.html generates 2FPS - NOT EXPECTED

right image shows firefox report GPU being used rendering https://www.kevs3d.co.uk/dev/shaders/distancefield8.html generates 50FPS as expected

prime-select query => nvidia nvidia-smi: NVIDIA-SMI 535.113.01 Driver Version: 535.113.01 CUDA Version: 12.2 lspci | grep VGA 00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630] 01:00.0 VGA compatible controller: NVIDIA Corporation TU106M [GeForce RTX 2060 Mobile] (rev a1)

I have also tried prime-select on-demand, but this was the same result is there a flag or way to force wpe to use the GPU in native the same it it does via wsl2?

philn commented 8 months ago

This issue tracker is for downstream deployments of WPE. For upstream questions and bug reports about wpevideosrc, please refer to https://gitlab.freedesktop.org/gstreamer/gstreamer and/or https://discourse.gstreamer.org