Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Only CQP rate control is available on Elkhart Lake #3008

Closed
rekjanov opened this issue Feb 3, 2023 · 4 comments
Closed

Only CQP rate control is available on Elkhart Lake #3008

rekjanov opened this issue Feb 3, 2023 · 4 comments
Labels

Comments

@rekjanov
Copy link

rekjanov commented Feb 3, 2023

System information

  • model name : Intel Atom(R) x6425E Processor @ 2.00GHz
  • 00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:4571] (rev 01)
  • DRM

Issue behavior

Tried on uptodate Ubuntu Server 22.04.1 with distribution provided media sdk packages, on generic (5.15) and oem (6.1) kernel
Also tried on a from scratch system with stock 5.15 kernel and latest media sdk/va driver 22.5.4 with requirements.

Describe the current behavior

root@test1:/usr/share/mfx/samples# LD_PRELOAD=libmfx-tracer.so.1.35 ./sample_encode h264 -i /dev/zero -o /dev/null -w 1920 -h 1080 -n 1000 -b 2000
libva info: Open new log file /tmp/libva_trace.log.222024.thd-0x000006a1 for the thread 0x000006a1
libva info: LIBVA_TRACE is on, save log into /tmp/libva_trace.log.222024.thd-0x000006a1
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

[ERROR], sts=MFX_ERR_UNSUPPORTED(-3), AllocFrames, Query (for encoder) failed at ./samples/sample_encode/src/pipeline_encode.cpp:966

[ERROR], sts=MFX_ERR_UNSUPPORTED(-3), ResetMFXComponents, AllocFrames failed at ./samples/sample_encode/src/pipeline_encode.cpp:2076

[ERROR], sts=MFX_ERR_UNSUPPORTED(-3), Init, ResetMFXComponents failed at ./samples/sample_encode/src/pipeline_encode.cpp:1857

[ERROR], sts=MFX_ERR_UNSUPPORTED(-3), main, pPipeline->Init failed at ./samples/sample_encode/src/sample_encode.cpp:1787
Frame number: 0
Encoding fps: -nan

but

root@test1:/usr/share/mfx/samples# ./sample_encode h264 -i /dev/zero -o /dev/null -w 1920 -h 1080 -n 1000 -cqp
libva info: Open new log file /tmp/libva_trace.log.222213.thd-0x000006a8 for the thread 0x000006a8
libva info: LIBVA_TRACE is on, save log into /tmp/libva_trace.log.222213.thd-0x000006a8
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
libva info: Save context 0x20000000 into log file /tmp/libva_trace.log.222213.thd-0x000006a8
Encoding Sample Version 8.4.27.0

Input file format	YUV420
Output video		AVC 
Source picture:
	Resolution	1920x1088
	Crop X,Y,W,H	0,0,1920,1080
Destination picture:
	Resolution	1920x1088
	Crop X,Y,W,H	0,0,1920,1080
Frame rate	30.00
QPI	10
QPP	10
QPB	10
Gop size	256
Ref dist	1
Ref number	2
Idr Interval	0
Target usage	balanced
Memory type	vaapi
Media SDK impl		hw
Media SDK version	1.35

Processing started
libva info: Open new log file /tmp/libva_trace.log.222213.thd-0x000006a9 for the thread 0x000006a9
Frame number: 1000

Encoding fps: 244

Processing finished

any other rc doesn't work either

Describe the expected behavior

Debug information

@rekjanov rekjanov added the bug label Feb 3, 2023
@rekjanov
Copy link
Author

rekjanov commented Feb 6, 2023

I also tried, on Ubuntu 22.04.1 with the following updated media components:

  • intel-media-va-driver-non-free:amd64 23.1.0+ds1-1
  • libmfx1:amd64 22.5.4-1
  • libva2:amd64 2.17.0-1
  • libigdgmm12:amd64 22.3.3+ds1-1
    with the same result

@nyanmisaka
Copy link

nyanmisaka commented Feb 7, 2023

I've filed an issue: https://gitlab.freedesktop.org/drm/intel/-/issues/8080

This has been a long time issue due to the neglect of Intel devs.

Intel disabled the HuC loading by default on pre-Gen12 platforms, however Jasper Lake and Elkhart Lake are two stripped version of Gen11, which means they only support CQP rate control by default unless you add the i915.enable_guc=2 option in your kernel parameters but you can't expect any end user can achieve this on their own.

I don't think this is the desired behavior since CBR and VBR rate control methods are the basic feature of any full functional video encoder such as H.264 and HEVC. They should reconsider enable HuC loading on these two chips.

@rekjanov
Copy link
Author

rekjanov commented Feb 7, 2023

Thank you. I figured out about enable_guc=2. The problem is that on 5.15 kernel GuC initialization fails with error -110 (time out). This parameter works on 6.1.10 kernel though. I haven't tried the versions inbeetwen.
To add to confusion, in my previous experience with MediaSDK (18.3) and kernel 4.19 on SKL and APL, I didn't need any GuC/HuC firmware to get cbr/vbr.

@rekjanov rekjanov closed this as completed Feb 7, 2023
@nyanmisaka
Copy link

nyanmisaka commented Feb 7, 2023

5.15 had a known issue that prevent you from using the GuC/HuC fimware.

Only JSL and EHL are affected by this issue and end users have to add this parameter on their own.

Because these two chip doesn't support non-low-power(PAK+kernel+VME) encoding.

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

No branches or pull requests

2 participants