Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initialisation fail on ubuntu 18.04, on M3-8100Y model of the lattepanda alpha #8

Closed
Changliu52 opened this issue Mar 17, 2020 · 8 comments

Comments

@Changliu52
Copy link

Hi @bmegli
I can compile the package with no problem.
but when I ran ./realsense-nhve-h264 127.0.0.1 9766 infrared 640 480 30 5 /dev/dri/renderD128

The terminal outputs the error as below:

[AVHWDeviceContext @ 0x56125936bd20] Opened VA display via DRM device /dev/dri/renderD128.
[AVHWDeviceContext @ 0x56125936bd20] libva: VA-API version 1.1.0
[AVHWDeviceContext @ 0x56125936bd20] libva: va_getDriverName() returns 0
[AVHWDeviceContext @ 0x56125936bd20] libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
[AVHWDeviceContext @ 0x56125936bd20] libva: Found init function __vaDriverInit_1_1
[AVHWDeviceContext @ 0x56125936bd20] libva: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so init failed
[AVHWDeviceContext @ 0x56125936bd20] libva: va_openDriver() returns -1
[AVHWDeviceContext @ 0x56125936bd20] Failed to initialise VAAPI connection: -1 (unknown libva error).
hve: failed to create a VAAPI device
nhve: failed to initalize hardware encoder
unable to initalize, try to specify device e.g:

./realsense-nhve-h264 127.0.0.1 9766 color 640 360 30 5 /dev/dri/renderD128
./realsense-nhve-h264 127.0.0.1 9766 infrared 640 360 30 5 /dev/dri/renderD128

The vainfo outputs the same error

libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
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

Note, I'm using the new M3-8100Y model of the lattepanda alpha.
Please advice possible solutions

@bmegli
Copy link
Owner

bmegli commented Mar 18, 2020

Hi @Changliu52,

Just curious, do you have both M3-7Y30 and M3-8100Y?

I confirm the problem on Amber Lake Y M3-8100Y on Ubuntu 18.04

I have M3-8100Y GPD Win2 as remote robot controller (but I used 19.04 MATE, which had support for GPD Win2 other hardware).

The situation on AmberLake Y with default OS configuration seems to be funny:

  • VAAPI doesn't work in Ubuntu 18.04
  • VAAPI works in 19.04, however I think I had problems with bitrate control
  • VAAPI works in 20.04 (daily build 18.III.2020), however there are no entry points for HEVC and HEVC Main10 encoding

More details in HVE issue

I am looking into that.

This is doable:

  • hardware supports it
  • correct software stack supports hardware

There are some hacky workarounds for CoffeLake, like here, this example is too hacky to use but shows that problem and workaround should exist.

Edit:

  • crossed out link (tested with live USB, doesn't do anything)
  • turns out I was using 19.04, not 19.10

@Changliu52
Copy link
Author

Changliu52 commented Mar 18, 2020

Just curious, do you have both M3-7Y30 and M3-8100Y?

Yes, Just got the M3-8100Y delivered last weekend, so was trying out different setups on the new one, while leaving the old one for some of my old stuffs.

Since it is quite empty now, so I can try different OS and setup.
So for the time being, I think I will get the reinstallation on the M3-7Y30 with 18.04, and test out different configurations on M3-8100Y following bmegli/hardware-video-encoder#21.

Thank you so much for the clarification!

@bmegli bmegli reopened this Mar 19, 2020
@bmegli
Copy link
Owner

bmegli commented Mar 19, 2020

Good news.

20.04 has both drivers (iHD and i965). M3-8100Y works with both drivers.

Initial testing with HVE shows that it is enough to force i965 with environment variable and everything seems to work.

Like this:

LIBVA_DRIVER_NAME=i965 ./hve-encode-raw-hevc10 10 /dev/dri/renderD128

See more details in HVE if you are interested.

Looks like 20.04 is the future. Go figure!

@Changliu52
Copy link
Author

That's fantastic! Great work @bmegli !
Would you think the bitrate control can work well also?

@bmegli
Copy link
Owner

bmegli commented Mar 22, 2020

Would you think the bitrate control can work well also?

It works.

You run it like this:

LIBVA_DRIVER_NAME=i965 ./realsense-nhve-hevc 192.168.0.100 9768 depth 848 480 30 500 /dev/dri/renderD128 8000000 0.000015625

@bmegli bmegli closed this as completed Mar 22, 2020
@Changliu52
Copy link
Author

Hi @bmegli
I was testing the on the 20.04 on M3-8100Y.
I have set LIBVA_DRIVER_NAME=i965

the encoder seems to still have problem to initialise. The console output is:

AVHWDeviceContext @ 0x55af43cac0c0] Trying to use DRM render node for device 0.
[AVHWDeviceContext @ 0x55af43cac0c0] libva: VA-API version 1.7.0
[AVHWDeviceContext @ 0x55af43cac0c0] libva: User environment variable requested driver 'i965'
[AVHWDeviceContext @ 0x55af43cac0c0] libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
[ INFO] [1599692843.153209344]: Device with serial number 938422076491 was found.

[ INFO] [1599692843.153343191]: Device with physical ID 2-2-2 was found.
[ INFO] [1599692843.153456225]: Device with name Intel RealSense D435 was found.
[ INFO] [1599692843.153897987]: Device with port number 2-2 was found.
[ INFO] [1599692843.156157938]: getParameters...
[AVHWDeviceContext @ 0x55af43cac0c0] libva: Found init function __vaDriverInit_1_6
[AVHWDeviceContext @ 0x55af43cac0c0] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x55af43cac0c0] Initialised VAAPI connection: version 1.7
[AVHWDeviceContext @ 0x55af43cac0c0] VAAPI driver: Intel i965 driver for Intel(R) Kaby Lake - 2.4.0.
[AVHWDeviceContext @ 0x55af43cac0c0] Driver not found in known nonstandard list, using standard behaviour.
[h264_vaapi @ 0x55af43cf9680] Input surface format is nv12.
[h264_vaapi @ 0x55af43cf9680] Using VAAPI profile VAProfileH264ConstrainedBaseline (13).
[h264_vaapi @ 0x55af43cf9680] Using VAAPI entrypoint VAEntrypointEncSlice (6).
[h264_vaapi @ 0x55af43cf9680] Using VAAPI render target format YUV420 (0x1).
[h264_vaapi @ 0x55af43cf9680] RC mode: VBR.
[h264_vaapi @ 0x55af43cf9680] RC target: 50% of 2000000 bps over 500 ms.
[h264_vaapi @ 0x55af43cf9680] RC buffer: 1000000 bits, initial fullness 750000 bits.
[h264_vaapi @ 0x55af43cf9680] RC framerate: 30/1 (30.00 fps).
[h264_vaapi @ 0x55af43cf9680] Using intra and P-frames (supported references: 4 / 1).
[h264_vaapi @ 0x55af43cf9680] All wanted packed headers available (wanted 0xd, found 0x1f).
[AVHWDeviceContext @ 0x55af43d1d580] Trying to use DRM render node for device 0.
[AVHWDeviceContext @ 0x55af43d1d580] libva: VA-API version 1.7.0
[AVHWDeviceContext @ 0x55af43d1d580] libva: User environment variable requested driver 'i965'
[AVHWDeviceContext @ 0x55af43d1d580] libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
[AVHWDeviceContext @ 0x55af43d1d580] libva: Found init function __vaDriverInit_1_6
[AVHWDeviceContext @ 0x55af43d1d580] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x55af43d1d580] Initialised VAAPI connection: version 1.7
[AVHWDeviceContext @ 0x55af43d1d580] VAAPI driver: Intel i965 driver for Intel(R) Kaby Lake - 2.4.0.
[AVHWDeviceContext @ 0x55af43d1d580] Driver not found in known nonstandard list, using standard behaviour.
[h264_vaapi @ 0x55af43d3ee40] Input surface format is bgr0.
[h264_vaapi @ 0x55af43d3ee40] No usable encoding profile found.
hve: cannot open video encoder codec
nhve: failed to initalize hardware encoder
[ERROR] [1599692843.173446829]: nhve is unable to initialise!

@Changliu52
Copy link
Author

referencing to new issue #25

@bmegli
Copy link
Owner

bmegli commented Nov 23, 2021

@Changliu52

We now have working m3-8100Y in 18.04, tested with ffmpeg_image_transport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants