Bug 250325 - graphics/mesa-gallium-va: libva error: /usr/local/lib/dri/radeonsi_drv_video.so init failed
Summary: graphics/mesa-gallium-va: libva error: /usr/local/lib/dri/radeonsi_drv_video....
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-x11 (Nobody)
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-10-13 20:30 UTC by Alexander Vereeken
Modified: 2020-12-03 22:39 UTC (History)
7 users (show)

See Also:
bugzilla: maintainer-feedback? (x11)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Vereeken 2020-10-13 20:30:48 UTC
Hello,

i saw the new mesa update and i have rebuilt mesa-libs, mesa-dri and installed gallium-va and gallium-vdpau.

Now i wanted to confirm if its working but i get:

libva info: VA-API version 1.9.0
libva info: Trying to open /usr/local/lib/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_9
libva error: /usr/local/lib/dri/radeonsi_drv_video.so init failed
libva info: va_openDriver() returns 2
vaInitialize failed with error code 2 (resource allocation failed),exit

and with vdpauinfo i get:

display: :0   screen: 0
Error creating VDPAU device: 23

Have i forgotten something? I using an RX 570

[ 42742.925] (II) AMDGPU(0): [DRI2] Setup complete
[ 42742.925] (II) AMDGPU(0): [DRI2]   DRI driver: radeonsi
[ 42742.925] (II) AMDGPU(0): [DRI2]   VDPAU driver: radeonsi

Before the update, it have worked perfectly. 

Many thanks in advance.
Comment 1 Ivan Rozhuk 2020-10-29 20:52:30 UTC
Same for me:

kodi@kodi# env DISPLAY=unix:0.0 vainfo
libva info: VA-API version 1.9.0
libva info: Trying to open /usr/local/lib/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_9
libva error: /usr/local/lib/dri/radeonsi_drv_video.so init failed
libva info: va_openDriver() returns 2
vaInitialize failed with error code 2 (resource allocation failed),exit
Exit 3
kodi@kodi# vainfo
error: can't connect to X server!
libva info: VA-API version 1.9.0
libva info: Trying to open /usr/local/lib/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_9
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.9 (libva 2.9.1)
vainfo: Driver version: Mesa Gallium driver 20.2.0 for AMD RAVEN (DRM 3.27.0, 12.2-STABLE, LLVM 10.0.1)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
Comment 2 wjenkner 2020-10-30 16:03:05 UTC
Same here with the r600 drivers for an AMD CAICOS.

With graphics/mesa-devel things work perfectly (with the default
libmap.d/mesa-devel.conf).
Comment 3 Jan Beich freebsd_committer freebsd_triage 2020-10-30 17:26:49 UTC
(In reply to rozhuk.im from comment #1)
> kodi@kodi# vainfo
> error: can't connect to X server!

Likely related to -Dglx=disabled because X11 support requires vl_dri*_screen_create implementation, otherwise stubs are used.

https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-20.2.0/src/gallium/auxiliary/vl/vl_winsys.h#L83-84
https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-20.2.0/src/gallium/frontends/va/context.c#L128-132

(In reply to wjenkner from comment #2)
> With graphics/mesa-devel things work perfectly

Thanks for testing as I don't have AMD GPUs. Like -DPREFER_IRIS in bug 250307 the issue appears to be caused by discrepancy of build options between mesa-* ports.
Comment 4 Jan Beich freebsd_committer freebsd_triage 2020-10-30 17:45:12 UTC
Marking as a regression from ports r552109 i.e., mesa-dri + VAAPI split into mesa-gallium-va.
Comment 5 Ivan Rozhuk 2020-10-30 18:58:42 UTC
(In reply to Jan Beich from comment #3)
> env DISPLAY=unix:0.0 vainfo

I run this from ssh + "su -l".
Looks like if no DISPLAY set and it fails connect to it, but show VAAPI caps, probably using "case VA_DISPLAY_DRM".


> Likely related to -Dglx=disabled because X11 support requires vl_dri*_screen_create implementation, otherwise stubs are used.

graphics/mesa-devel have different build options?
Comment 6 Jan Beich freebsd_committer freebsd_triage 2020-10-31 00:54:38 UTC
Oops, I was off a bit. -Dglx=disabled doesn't completely disable X11 support, removing "x11" from -Dplatforms="..." would but it isn't explicitly passed by mesa-gallium-*/Makefile. Looking at -DHAVE_*_PLATFORM it seems only Wayland is auto-enabled.

http://beefy6.nyi.freebsd.org/data/latest-per-pkg/mesa-gallium-va/20.2.0_1/121amd64-default.log
http://beefy6.nyi.freebsd.org/data/latest-per-pkg/mesa-gallium-vdpau/20.2.0_1/121amd64-default.log

(In reply to rozhuk.im from comment #5)
> graphics/mesa-devel have different build options?

mesa-devel builds *_drv_video.so with X11 enabled i.e., -Dglx=auto (default) and -Dplatforms=x11,wayland

mesa-dri and mesa-libs have X11 enabled but clover, libosmesa, mesa-gallium-va, mesa-gallium-vdpau, mesa-gallium-xa have X11 disabled.
Comment 7 gja822 2020-11-12 13:36:46 UTC
I have similar problem with radeonkms r600 (HD3000).
Error 23 with vdpauinfo.
Comment 8 commit-hook freebsd_committer freebsd_triage 2020-12-03 20:55:56 UTC
A commit references this bug:

Author: manu
Date: Thu Dec  3 20:55:35 UTC 2020
New revision: 556929
URL: https://svnweb.freebsd.org/changeset/ports/556929

Log:
   mesa-*: Update to 20.2.3

   - Fix mesa-gallium-va and mesa-gallium-vdpau for X11 usage
   - Add a patch so iris will be prefered for compatible intel GPUs (>=broadwell)

  PR:		250307 250325

Changes:
  head/graphics/libosmesa/Makefile
  head/graphics/mesa-dri/Makefile
  head/graphics/mesa-dri/Makefile.common
  head/graphics/mesa-dri/distinfo
  head/graphics/mesa-dri/files/patch-src_loader_meson.build
  head/graphics/mesa-gallium-va/Makefile
  head/graphics/mesa-gallium-va/pkg-plist
  head/graphics/mesa-gallium-vdpau/Makefile
  head/graphics/mesa-gallium-vdpau/pkg-plist
  head/graphics/mesa-gallium-xa/Makefile
  head/graphics/mesa-libs/Makefile
  head/lang/clover/Makefile
Comment 9 Ivan Rozhuk 2020-12-03 22:33:24 UTC
No more error:
kodi@kodi# env DISPLAY=unix:0.0 vainfo
libva info: VA-API version 1.9.0
libva info: Trying to open /usr/local/lib/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_9
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.9 (libva 2.9.1)
vainfo: Driver version: Mesa Gallium driver 20.2.3 for AMD Radeon(TM) Vega 8 Graphics (RAVEN, DRM 3.27.0, 12.2-STABLE, LLVM 10.0.1)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
Comment 10 Emmanuel Vadot freebsd_committer freebsd_triage 2020-12-03 22:39:27 UTC
(In reply to rozhuk.im from comment #9)
Yeah sorry for the breakage and the time to fix it.
Closing this issue now.