Weird behaviour on hyprid laptop
Been fighting an unrelated issue for weeks with brave & hwdec not working but as a side effect of trying to get to the bottom of that one I noticed a 'bug'? maybe? Honestly I'm not even sure it is but its worth reporting as others have had the same behaviour too.
My laptop has an Intel/NVIDIA hybrid GPU setup and with intel-media-driver installed vainfo works as expected. with intel-media-driver & libva-nvidia-driver installed vainfo uses iHD which I would expect since the intel is the primary card. The issue arises when you try to force vainfo to use the NVIDIA, in that case vainfo throws a hard crash. To use NVDEC at all on my GPU I have to swap over to dedicated GPU mode.
libva info: VA-API version 1.19.0 libva info: User environment variable requested driver 'nvidia' libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so libva info: Found init function __vaDriverInit_1_0 libva error: /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so init failed libva info: va_openDriver() returns 1 vaInitialize failed with error code 1 (operation failed),exit
https://github.com/brave/brave-browser/issues/35953 ^ Bug on brave, unrelated but this user has the exact same behaviour
because you have two card, if you "force vainfo to use NVIDIA", you just set the LIBVA_DRIVER_NAME? I suppose you also need to use vainfo --device to specify the device
because you have two card, if you "force vainfo to use NVIDIA", you just set the LIBVA_DRIVER_NAME? I suppose you also need to use vainfo --device to specify the device
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
I did not set device however. I see from the brave thread that that is a possibility. Should it really be necessary though? Would it be possible to have libva detect this automatically? Or just detect there's more than one DRM device and if loading the driver returns a 1 try the next device instead?
I did not set device however. I see from the brave thread that that is a possibility. Should it really be necessary though? Would it be possible to have libva detect this automatically? Or just detect there's more than one DRM device and if loading the driver returns a 1 try the next device instead?
it should be a good idea, but is conflict with current design, current libva just try the related load library for a given kernel mode driver. the mapping is something like https://github.com/intel/libva/blob/master/va/drm/va_drm_utils.c#L53-L69 now, you are asking try to load all candidates for one vendor...
Possibly unrelated but chromium based browsers just grab the first card and uses that with vaGetDisplayDRM. Also it ignores DRI_PRIME - that's used for rendering and not video acceleration. What's shitty is that /dev/dri/renderD1XX devices are not stable - the kernel initializes them in parallel so you might get the first card as the nvidia one. For me it's semi random. Forcing the driver with LIBVA_DRIVER_NAME will not work reliably and just load the wrong driver for your card. For myself, i fixed with a patch that i can specify the card device from an env variable, ignoring the fd passed to vaGetDisplayDRM, and making that point to /dev/dri/by-path/xxx