Bug 6458

Summary: libva error: /usr/lib64/dri/i965_drv_video.so init failed
Product: Fedora Reporter: Cristian Ciupitu <cristian.ciupitu>
Component: libva-intel-driverAssignee: Nicolas Chauvet <kwizart>
Status: RESOLVED EOL    
Severity: enhancement CC: leigh123linux
Priority: P1    
Version: f38   
Hardware: x86_64   
OS: GNU/Linux   
namespace:

Description Cristian Ciupitu 2022-10-31 15:04:45 CET
I'm using libva-intel-driver-2.4.1-9.fc37.x86_64

    $ LIBVA_DRIVER_NAME=i965 vainfo
    libva info: VA-API version 1.15.0
    libva info: User environment variable requested driver 'i965'
    libva info: Trying to open /usr/lib64/dri/i965_drv_video.so
    libva info: Found init function __vaDriverInit_1_15
    libva error: /usr/lib64/dri/i965_drv_video.so init failed
    libva info: va_openDriver() returns -1
    vaInitialize failed with error code -1 (unknown libva error),exit


The CPU is Intel Core i7-3770 CPU (Ivy Bridge) with the integrated HD Graphics 4000.

I'm also running:
 - kernel-6.0.5-300.fc37.x86_64
 - xorg-x11-server-Xorg-1.20.14-8.fc37.x86_64
 - xorg-x11-drv-intel-2.99.917-53.20200205.fc37.x86_64

Because the motherboard does not really have a VGA port and it was causing me trouble, I disabled it long time ago by booting with video=VGA-1:d.
I also have /etc/X11/xorg.conf.d/99-intel-hd4000-DP1.conf containing this:

    Section "Device"
      Identifier  "Intel HD4000"
      Driver      "intel"
      BusId       "PCI:00:02:0"
      Option      "Monitor-VGA1" "Dummy Monitor for Intel VGA1"
      Option      "Monitor-HDMI1" "Dummy Monitor for Intel HDMI1"
      Option      "Monitor-HDMI2" "Dummy Monitor for Intel HDMI2"
      Option      "Monitor-DP1" "Monitor for Intel DP1"
      Option      "Monitor-DP2" "Dummy Monitor for Intel DP2"
      Option      "TearFree" "true"
    EndSection

    Section "Monitor"
      Identifier "Dummy Monitor for Intel VGA1"
      Option     "Ignore" "true"
    EndSection

    Section "Monitor"
      Identifier "Dummy Monitor for Intel HDMI1"
      Option     "Ignore" "true"
    EndSection

    Section "Monitor"
      Identifier "Dummy Monitor for Intel HDMI2"
      Option     "Ignore" "true"
    EndSection

    Section "Monitor"
      Identifier "Monitor for Intel DP1"
    EndSection

    Section "Monitor"
      Identifier "Dummy Monitor for Intel DP2"
      Option     "Ignore" "true"
    EndSection
Comment 1 Nicolas Chauvet 2022-11-16 14:51:19 CET
Most recent intel should use the modesetting driver instead of the install DDX driver.

also can you reproduce without having LIBVA_DRIVER_NAME set as it's supposed to be autodetected automatically.
Comment 2 Cristian Ciupitu 2022-11-18 18:13:36 CET
I've changed the X config to:

    Section "Device"
      Identifier  "Intel HD4000"
      Driver      "modesetting"
      BusId       "PCI:00:02:0"
      Option      "kmsdev" "/dev/dri/card1"
      Option      "Monitor-VGA1" "Dummy Monitor for Intel VGA1"
      Option      "Monitor-HDMI1" "Dummy Monitor for Intel HDMI1"
      Option      "Monitor-HDMI2" "Dummy Monitor for Intel HDMI2"
      Option      "Monitor-DP1" "Monitor for Intel DP1"
      Option      "Monitor-DP2" "Dummy Monitor for Intel DP2"
    EndSection
  
    Section "Monitor"
      Identifier "Dummy Monitor for Intel VGA1"
      Option     "Ignore" "true"
    EndSection
  
    Section "Monitor"
      Identifier "Dummy Monitor for Intel HDMI1"
      Option     "Ignore" "true"
    EndSection
  
    Section "Monitor"
      Identifier "Dummy Monitor for Intel HDMI2"
      Option     "Ignore" "true"
    EndSection
  
    Section "Monitor"
      Identifier "Monitor for Intel DP1"
    EndSection
  
    Section "Monitor"
      Identifier "Dummy Monitor for Intel DP2"
      Option     "Ignore" "true"
    EndSection

and I'm still getting:

    Trying display: wayland
    Trying display: x11
    libva info: VA-API version 1.16.0
    libva info: User environment variable requested driver 'i965'
    libva info: Trying to open /usr/lib64/dri/i965_drv_video.so
    libva info: Found init function __vaDriverInit_1_15
    libva error: /usr/lib64/dri/i965_drv_video.so init failed
    libva info: va_openDriver() returns -1
    vaInitialize failed with error code -1 (unknown libva error),exit
Comment 3 Nicolas Chauvet 2022-11-18 19:13:58 CET
Can you retry with:


LIBVA_TRACE=1 vainfo

And attach the locally created file ?
Comment 4 Cristian Ciupitu 2022-11-28 17:43:42 CET
$ LIBVA_TRACE=1 vainfo
Trying display: wayland
Trying display: x11
libva info: Open new log file 1.164206.thd-0x00000d69 for the thread 0x00000d69
libva info: LIBVA_TRACE is on, save log into 1.164206.thd-0x00000d69
libva info: VA-API version 1.16.0
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
vaInitialize failed with error code -1 (unknown libva error),exit


$ cat 1.164206.thd-0x00000d69
[58590.511561][ctx       none]==========va_TraceInitialize
[58590.511573][ctx       none]=========vaInitialize ret = VA_STATUS_ERROR_UNKNOWN, unknown libva error 
[58590.511580][ctx       none]==========va_TraceTerminate
[58590.511594][ctx       none]=========vaTerminate ret = VA_STATUS_SUCCESS, success (no error)
Comment 5 Nicolas Chauvet 2022-12-29 20:10:56 CET
why do you need to specify the BusID, do you have more than one card ?

What is the output of drmdevice ?
Comment 6 Nicolas Chauvet 2022-12-29 20:50:31 CET
Does it ever work on your hardware ?

Problem is that libva-intel-driver is unmaintained upstream, so if it wasn't working previously it's unlikely that it will be worked on...

You could have a look at the bug tracker / pull requests like 
https://github.com/intel/intel-vaapi-driver/pull/548 where its only a mean to add the missing PCI ID...

Can you show a trace with the LIBVA_DRIVER_NAME=i965 variable added ?
Comment 7 Cristian Ciupitu 2023-01-07 16:54:06 CET
I used to have an Nvidia video card, so the PCI ID had to be mentioned in the X config.

Yes, it used to work, it's one of the reasons I bought this CPU with iGPU, hardware accelerated video playback.

With the original config, i.e. intel xorg driver:

$ env LIBVA_DRIVER_NAME=i965 LIBVA_TRACE=1 vainfo
Trying display: wayland
Trying display: x11
libva info: Open new log file 1.155036.thd-0x0002c22a for the thread 0x0002c22a
libva info: LIBVA_TRACE is on, save log into 1.155036.thd-0x0002c22a
libva info: VA-API version 1.16.0
libva info: User environment variable requested driver 'i965'
libva info: Trying to open /usr/lib64/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_15
libva error: /usr/lib64/dri/i965_drv_video.so init failed
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

$ cat 1.155036.thd-0x0002c22a 
[38092.420138][ctx       none]==========va_TraceInitialize
[38092.420148][ctx       none]=========vaInitialize ret = VA_STATUS_ERROR_UNKNOWN, unknown libva error 
[38092.420154][ctx       none]==========va_TraceTerminate
[38092.420194][ctx       none]=========vaTerminate ret = VA_STATUS_SUCCESS, success (no error)
Comment 8 Cristian Ciupitu 2023-03-13 16:57:38 CET
It seems to work a bit better under Fedora 38 (thirty-eight), although I'm still have libva-intel-driver-2.4.1-9.fc37.x86_64.

$ LIBVA_TRACE=1 vainfo
Trying display: wayland
Trying display: x11
libva info: Open new log file 1.155252.thd-0x00008dd7 for the thread 0x00008dd7
libva info: LIBVA_TRACE is on, save log into 1.155252.thd-0x00008dd7
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva error: /usr/lib64/dri/iHD_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: Trying to open /usr/lib64/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_15
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.17 (libva 2.17.1)
vainfo: Driver version: Intel i965 driver for Intel(R) Ivybridge Desktop - 2.4.1
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD

$ cat 1.155252.thd-0x00008dd7 
[18132.066772][ctx       none]==========va_TraceInitialize
[18132.066790][ctx       none]=========vaInitialize ret = VA_STATUS_SUCCESS, success (no error) 
[18132.066808][ctx       none]=========vaQueryConfigProfiles ret = VA_STATUS_SUCCESS, success (no error) 
[18132.066818][ctx       none]=========vaQueryConfigEntrypoints ret = VA_STATUS_SUCCESS, success (no error) 
[18132.066828][ctx       none]=========vaQueryConfigEntrypoints ret = VA_STATUS_SUCCESS, success (no error) 
[18132.066839][ctx       none]=========vaQueryConfigEntrypoints ret = VA_STATUS_SUCCESS, success (no error) 
[18132.066848][ctx       none]=========vaQueryConfigEntrypoints ret = VA_STATUS_SUCCESS, success (no error) 
[18132.066858][ctx       none]=========vaQueryConfigEntrypoints ret = VA_STATUS_SUCCESS, success (no error) 
[18132.066867][ctx       none]=========vaQueryConfigEntrypoints ret = VA_STATUS_SUCCESS, success (no error) 
[18132.066873][ctx       none]=========vaQueryConfigEntrypoints ret = VA_STATUS_SUCCESS, success (no error) 
[18132.066878][ctx       none]=========vaQueryConfigEntrypoints ret = VA_STATUS_SUCCESS, success (no error) 
[18132.066883][ctx       none]=========vaQueryConfigEntrypoints ret = VA_STATUS_SUCCESS, success (no error) 
[18132.066888][ctx       none]=========vaQueryConfigEntrypoints ret = VA_STATUS_SUCCESS, success (no error) 
[18132.066893][ctx       none]=========vaQueryConfigEntrypoints ret = VA_STATUS_SUCCESS, success (no error) 
[18132.066898][ctx       none]=========vaQueryConfigEntrypoints ret = VA_STATUS_ERROR_UNSUPPORTED_PROFILE, the requested VAProfile is not supported 
[18132.067141][ctx       none]==========va_TraceTerminate
[18132.067158][ctx       none]=========vaTerminate ret = VA_STATUS_SUCCESS, success (no error)
Comment 9 Nicolas Chauvet 2023-03-13 17:46:38 CET
You haven't mentioned using any env variable there.


Do you have dropped any xorg config file ?

Also can you verify your GPU is listed like in this MR ?
https://github.com/intel/intel-vaapi-driver/pull/548


I can fix the _vaDriverInit_1_17 by rebuilding it...
Comment 10 Cristian Ciupitu 2023-03-13 21:20:49 CET
Nope, it's not in the merge request. I have Ivy Bridge.

The X config is in #comment 1

P.S. If it's appropriate the version for this bug report should probably be changed to f38 or cloned. I for one I'm not running Fedora 37 anymore, I've upgraded.
Comment 11 Nicolas Chauvet 2023-03-17 16:44:07 CET
Is there any improvements with libva-intel-driver-2.4.1-11.20221130gitab755cb.fc38 from rpmfusion-free-updates-testing ?
Comment 12 Cristian Ciupitu 2023-03-17 23:57:33 CET
Not really.

# vainfo 
Trying display: wayland
Trying display: x11
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva error: /usr/lib64/dri/iHD_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: Trying to open /usr/lib64/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.17 (libva 2.17.1)
vainfo: Driver version: Intel i965 driver for Intel(R) Ivybridge Desktop - 2.4.0.pre1 (2.4.0.pre1)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD

# mpv --no-config --hwdec=vaapi juddertest_60.mp4
 (+) Video --vid=1 (*) (h264 1920x1072 60.000fps)
[vaapi] libva: /usr/lib64/dri/iHD_drv_video.so init failed
Using hardware decoding (vaapi).
VO: [gpu] 1920x1072 vaapi[nv12]
V: 00:00:00 / 00:01:04 (1%)

Exiting... (Quit)
Comment 13 leigh scott 2024-05-21 07:43:30 CEST
Fedora Linux 38 entered end-of-life (EOL) status on 2024-05-21.

Fedora Linux 38 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora
Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.