viseron icon indicating copy to clipboard operation
viseron copied to clipboard

No VA-API in docker container.

Open akshaal opened this issue 1 year ago • 1 comments

vainfo on host (Intel Alder Lake, gen12):

libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.3.1 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSliceLP
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSliceLP
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointEncSliceLP
      VAProfileVP9Profile1            : VAEntrypointVLD
      VAProfileVP9Profile1            : VAEntrypointEncSliceLP
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointEncSliceLP
      VAProfileVP9Profile3            : VAEntrypointVLD
      VAProfileVP9Profile3            : VAEntrypointEncSliceLP
      VAProfileHEVCMain12             : VAEntrypointVLD
      VAProfileHEVCMain422_10         : VAEntrypointVLD
      VAProfileHEVCMain422_12         : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointEncSliceLP
      VAProfileHEVCMain444_10         : VAEntrypointVLD
      VAProfileHEVCMain444_10         : VAEntrypointEncSliceLP
      VAProfileHEVCMain444_12         : VAEntrypointVLD
      VAProfileHEVCSccMain            : VAEntrypointVLD
      VAProfileHEVCSccMain            : VAEntrypointEncSliceLP
      VAProfileHEVCSccMain10          : VAEntrypointVLD
      VAProfileHEVCSccMain10          : VAEntrypointEncSliceLP
      VAProfileHEVCSccMain444         : VAEntrypointVLD
      VAProfileHEVCSccMain444         : VAEntrypointEncSliceLP
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileHEVCSccMain444_10      : VAEntrypointVLD
      VAProfileHEVCSccMain444_10      : VAEntrypointEncSliceLP

vainfo in the container:

libva info: VA-API version 1.7.0
libva info: User environment variable requested driver 'i965'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_6
libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so init failed
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

LIBVA_DRIVER_NAME=iHD vainfo in the container after installing intel-media-va-driver (the same with intel-media-va-driver-non-free):

libva info: VA-API version 1.7.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed
libva info: va_openDriver() returns 1
vaInitialize failed with error code 1 (operation failed),exit

docker compose file:

    viseron:
        # ..............
        privileged: true # tried with and without
        devices:
            - "/dev/dri"

id abc and ls -l /dev/dri (container):

uid=2034(abc) gid=2034(abc) groups=2034(abc),44(video),109(videowBkY4KCb)
crw-rw---- 1 root video         226,   0 Jul 14 23:02 card0
crw-rw---- 1 root videowBkY4KCb 226, 128 Jul 14 23:02 renderD128

id nvr and ls -l /dev/dri (host):

uid=2034(nvr) gid=2034(nvr) groups=2034(nvr),44(video),109(render)
crw-rw---- 1 root video  226,   0 Jul 12 12:11 card0
crw-rw---- 1 root render 226, 128 Jul 12 12:11 renderD128

(actually these permissions above don't matter, vainfo invoked as root anyway)

the host runs on ubuntu server 22.04 the viseron container appears to be based upon 20.04. I suspect that libva2 and iHD drivers are too old in 20.04. They heavily depend on each other and it's quite a PITA to upgrade them keeping ubuntu 20.04 as is.

I guess it would be quite useful (at least for me) to publish containers of the stable version of viseron using 22.04 as a base layer.

akshaal avatar Jul 14 '22 23:07 akshaal

Moving to 22.04 should be possible after #306 is complete. The Jetson Nano version needs to stay on earlier versions of Ubuntu to avoid dependency issues. The Dockerfiles are reworked in #306 which should allow this.

roflcoopter avatar Jul 20 '22 13:07 roflcoopter