Re: git: ef1f7856c102 - main - multimedia/libva-nvidia-driver: better document how to run

From: Rainer Hurling <rhurlin_at_gwdg.de>
Date: Sat, 05 Jul 2025 11:50:21 UTC
Am 05.07.25 um 13:27 schrieb Jan Beich:
> Jan Beich <jbeich@FreeBSD.org> writes:
> 
>> Rainer Hurling <rhurlin@gwdg.de> writes:
>>
>>> Hi Jan,
>>> Thanks for the better documentation.
>>>
>>> On my (current amd64) boxes, 'nv-sgl vainfo' gives
>>>
>>> Trying display: wayland
>>> Trying display: x11
>>> libva info: VA-API version 1.22.0
>>> libva info: Trying to open /usr/local/lib/dri/nvidia_drv_video.so
>>> libva info: va_openDriver() returns -1
>>> vaInitialize failed with error code -1 (unknown libva error),exit
>>>
>>>
>>> Instead of /usr/local/lib/dri/nvidia_drv_video.so there is
>>> /usr/local/lib/dri/nvidia-drm_drv_video.so, installed by
>>> multimedia/libva-nvidia-driver.
>>>
>>> #pkg info -l libva-nvidia-driver-0.0.14_1
>>> libva-nvidia-driver-0.0.14_1:
>>>          /usr/local/lib/dri/nvidia-drm_drv_video.so
>>>          /usr/local/share/licenses/libva-nvidia-driver-0.0.14_1/LICENSE
>>>          /usr/local/share/licenses/libva-nvidia-driver-0.0.14_1/MIT
>>>          /usr/local/share/licenses/libva-nvidia-driver-0.0.14_1/catalog.mk
>>>
>>>
>>> Shouldn't vainfo be able to find the right lib?
>>
>> Can you try https://cgit.FreeBSD.org/ports/commit/?id=6a391a807ce8 ?
> 
> Also try https://cgit.FreeBSD.org/ports/commit/?id=de880d4ed14a
> DRI2 isn't used on Wayland even under Xwayland, so libva-drm should
> guess default driver correctly.
> 
> Upstream default dates back to before Wayland on desktop was practical,
> so there was no reason to install both VDPAU-based and NVDEC-based drivers.
> Nowadays, VDPAU still doesn't support Wayland but Linux distros can
> avoid package conflict via alternatives (Debian) or provides/requires (Arch).
> On FreeBSD nvidia-driver and nvidia-drm-kmod are separate, using NVDEC
> requires CUDA workaround (nv-sglrun from libc6-shim) and Wayland support
> in DEs lags behind Linux, so libva-vdpau-driver is often enough and
> easier to use.

Seems to work like expected now:

~>nv-sglrun vainfo
Trying display: wayland
Trying display: x11
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/local/lib/dri/nvidia-drm_drv_video.so
/usr/local/lib/libc6-shim/libc6.so: shim init
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: VA-API NVDEC driver [direct backend]
vainfo: Supported profile and entrypoints
       VAProfileMPEG2Simple            : VAEntrypointVLD
       VAProfileMPEG2Main              : VAEntrypointVLD
       VAProfileVC1Simple              : VAEntrypointVLD
       VAProfileVC1Main                : VAEntrypointVLD
       VAProfileVC1Advanced            : VAEntrypointVLD
       VAProfileH264Main               : VAEntrypointVLD
       VAProfileH264High               : VAEntrypointVLD
       VAProfileH264ConstrainedBaseline: VAEntrypointVLD
       VAProfileHEVCMain               : VAEntrypointVLD
       VAProfileVP8Version0_3          : VAEntrypointVLD
       VAProfileVP9Profile0            : VAEntrypointVLD
       VAProfileAV1Profile0            : VAEntrypointVLD
       VAProfileHEVCMain10             : VAEntrypointVLD
       VAProfileHEVCMain12             : VAEntrypointVLD
       VAProfileVP9Profile2            : VAEntrypointVLD
       VAProfileHEVCMain444            : VAEntrypointVLD
       VAProfileHEVCMain444_10         : VAEntrypointVLD
       VAProfileHEVCMain444_12         : VAEntrypointVLD


Thanks for the fast resonse and the fix :)

Best wishes,
Rainer