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

DG1 Non functional on kernel 5.19, 6.0 & 6.0 with drm-tip #243

Closed
gizahNL opened this issue Oct 10, 2022 · 8 comments
Closed

DG1 Non functional on kernel 5.19, 6.0 & 6.0 with drm-tip #243

gizahNL opened this issue Oct 10, 2022 · 8 comments
Labels
bug Issue is identified as a bug

Comments

@gizahNL
Copy link

gizahNL commented Oct 10, 2022

System information

  • model name : AMD Ryzen 5 3600 6-Core Processor
  • 26:00.0 VGA compatible controller [0300]: Intel Corporation DG1 [Iris Xe Graphics] [8086:4908] (rev 01)
    30:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT / 6800M] [1002:73df] (rev c1)
  • Wayland (irrelevant: DG1 GPU isn't used for Display & only accessed via /dev/dri/renderD# node)

Issue behavior

Describe the current behavior

After upgrading my Ubuntu system away from 22.04 & the associated Kernel upgrade to 5.19 ( I have tried 6.0, and 6.0 with drm-tip since) all encoding via DG1 is non-functional.

Describe the expected behavior

Encoding should work.

Debug information

dpkg -l | grep libva        
ii  libva-dev:amd64                                            2.15.0-1                                   amd64        Video Acceleration (VA) API for Linux -- development files
ii  libva-drm2:amd64                                           2.15.0-1                                   amd64        Video Acceleration (VA) API for Linux -- DRM runtime
ii  libva-drm2:i386                                            2.15.0-1                                   i386         Video Acceleration (VA) API for Linux -- DRM runtime
ii  libva-glx2:amd64                                           2.15.0-1                                   amd64        Video Acceleration (VA) API for Linux -- GLX runtime
ii  libva-wayland2:amd64                                       2.15.0-1                                   amd64        Video Acceleration (VA) API for Linux -- Wayland runtime
ii  libva-x11-2:amd64                                          2.15.0-1                                   amd64        Video Acceleration (VA) API for Linux -- X11 runtime
ii  libva-x11-2:i386                                           2.15.0-1                                   i386         Video Acceleration (VA) API for Linux -- X11 runtime
ii  libva2:amd64                                               2.15.0-1                                   amd64        Video Acceleration (VA) API for Linux -- runtime
ii  libva2:i386                                                2.15.0-1                                   i386         Video Acceleration (VA) API for Linux -- runtime
ii  libvariable-magic-perl                                     0.62-2                                     amd64        module to associate user-defined magic to variables from Perl
  • intel-gmmlib-22.2.0

  • intel-media-22.5.4 (ENABLE_PRODUCTION_KMD=ON/ENABLE_PRODUCTION_KMD=OFF)

  • intel-onevpl-22.5.4

  • onevpl: v2022.2.4

  • No hang reported

vainfo.log

sample_encode h264 -i ./examples/content/cars_320x240.nv12 -w 320 -h 240  -o ./test.h264                                                                                       
CONFIGURE LOADER: required implementation: hw 
CONFIGURE LOADER: required implementation mfxAccelerationMode: MFX_ACCEL_MODE_VIA_VAAPI 
libva info: VA-API version 1.15.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_15
libva info: va_openDriver() returns 0
libva info: VA-API version 1.15.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_15
libva info: va_openDriver() returns 0
Loaded Library configuration: 
    Version: 2.7 
    ImplName: mfx-gen 
    Adapter number : 0 
    Adapter type: integrated
    DRMRenderNodeNum: 128 
Used implementation number: 0 
Loaded modules:
   0: /usr/lib/x86_64-linux-gnu/libmfx-gen.so.1.2.7 
   1: /usr/lib/x86_64-linux-gnu/libmfxhw64.so.1.35 

libva info: VA-API version 1.15.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_15
libva info: va_openDriver() returns 0
Encoding Sample Version 8.4.27.0

Input file format	YUV420
Output video		AVC 
Source picture:
	Resolution	320x240
	Crop X,Y,W,H	0,0,320,240
Destination picture:
	Resolution	320x240
	Crop X,Y,W,H	0,0,320,240
Frame rate	30.00
Bit rate(Kbps)	562
Gop size	0
Ref dist	4
Ref number	0
Idr Interval	0
Target usage	balanced
Memory type	system
Media SDK impl		hw
Media SDK version	2.7

Processing started

[ERROR], sts=MFX_ERR_GPU_HANG(-21), SynchronizeFirstTask, SyncOperation fail or timeout at /home/gijs/Projects/INTEL/oneVPL/tools/legacy/sample_encode/src/pipeline_encode.cpp:178

[ERROR], sts=MFX_ERR_GPU_HANG(-21), GetFreeTask, m_TaskPool.SynchronizeFirstTask failed at /home/gijs/Projects/INTEL/oneVPL/tools/legacy/sample_encode/src/pipeline_encode.cpp:2169

[ERROR], sts=MFX_ERR_GPU_HANG(-21), Run, m_pmfxENC->EncodeFrameAsync failed at /home/gijs/Projects/INTEL/oneVPL/tools/legacy/sample_encode/src/pipeline_encode.cpp:2417

[ERROR], sts=MFX_ERR_GPU_HANG(-21), main, pPipeline->Run failed at /home/gijs/Projects/INTEL/oneVPL/tools/legacy/sample_encode/src/sample_encode.cpp:1960
Frame number: 0
Encoding fps: 0
sample_encode h264 -i ./examples/content/cars_320x240.nv12 -w 320 -h 240  -o ./test.h264
CONFIGURE LOADER: required implementation: hw 
CONFIGURE LOADER: required implementation mfxAccelerationMode: MFX_ACCEL_MODE_VIA_VAAPI 
Loaded Library configuration: 
    Version: 1.35 
    ImplName: mfxhw64 
    Adapter number : 0 
    DRMRenderNodeNum: 128 
Used implementation number: 0 
Loaded modules:
   0: /usr/lib/x86_64-linux-gnu/libmfxhw64.so.1.35 

libva info: VA-API version 1.15.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_15
libva info: va_openDriver() returns 0
Encoding Sample Version 8.4.27.0

Input file format	YUV420
Output video		AVC 
Source picture:
	Resolution	320x240
	Crop X,Y,W,H	0,0,320,240
Destination picture:
	Resolution	320x240
	Crop X,Y,W,H	0,0,320,240
Frame rate	30.00
Bit rate(Kbps)	562
Gop size	0
Ref dist	4
Ref number	0
Idr Interval	0
Target usage	balanced
Memory type	system
Media SDK impl		hw
Media SDK version	1.35

Processing started

[ERROR], sts=MFX_ERR_GPU_HANG(-21), SynchronizeFirstTask, SyncOperation fail or timeout at /home/gijs/Projects/INTEL/oneVPL/tools/legacy/sample_encode/src/pipeline_encode.cpp:178

[ERROR], sts=MFX_ERR_GPU_HANG(-21), GetFreeTask, m_TaskPool.SynchronizeFirstTask failed at /home/gijs/Projects/INTEL/oneVPL/tools/legacy/sample_encode/src/pipeline_encode.cpp:2169

[ERROR], sts=MFX_ERR_GPU_HANG(-21), Run, m_pmfxENC->EncodeFrameAsync failed at /home/gijs/Projects/INTEL/oneVPL/tools/legacy/sample_encode/src/pipeline_encode.cpp:2417

[ERROR], sts=MFX_ERR_GPU_HANG(-21), main, pPipeline->Run failed at /home/gijs/Projects/INTEL/oneVPL/tools/legacy/sample_encode/src/sample_encode.cpp:1960
Frame number: 0
Encoding fps: 0
hello-encode -hw -i ./examples/content/cars_320x240.nv12 -w 320 -h 240
libva info: VA-API version 1.15.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_15
libva info: va_openDriver() returns 0
libva info: VA-API version 1.15.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_15
libva info: va_openDriver() returns 0
Implementation details:
  ApiVersion:           2.7  
  Implementation type:  HW
  AccelerationMode via: VAAPI
  Path: /usr/lib/x86_64-linux-gnu/libmfx-gen.so.1.2.7

libva info: VA-API version 1.15.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_15
libva info: va_openDriver() returns 0
Encoding ./examples/content/cars_320x240.nv12 -> out.h265
Input colorspace: NV12
MFXVideoCORE_SyncOperation error
Encoded 0 frames
@gizahNL gizahNL added the bug Issue is identified as a bug label Oct 10, 2022
@nyanmisaka
Copy link

VAAPI also fails on DG1. intel/media-driver#1415

@dvrogozh
Copy link
Contributor

intel-media-22.5.4 (ENABLE_PRODUCTION_KMD=ON/ENABLE_PRODUCTION_KMD=OFF)

This step is critical. If you updated to use vanilla kernel you must build the driver without ENABLE_PRODUCTION_KMD=ON, i.e. build media-driver by default: cmake ... Can you, please, confirm that above results correspond to such build configuration?

From above results I am surprised to see h264 encoding failing. I am aware of h265 failures (that's intel/media-driver#1415), but not h264.

@gizahNL
Copy link
Author

gizahNL commented Oct 13, 2022

intel-media-22.5.4 (ENABLE_PRODUCTION_KMD=ON/ENABLE_PRODUCTION_KMD=OFF)

This step is critical. If you updated to use vanilla kernel you must build the driver without ENABLE_PRODUCTION_KMD=ON, i.e. build media-driver by default: cmake ... Can you, please, confirm that above results correspond to such build configuration?

From above results I am surprised to see h264 encoding failing. I am aware of h265 failures (that's intel/media-driver#1415), but not h264.

I have tried with both.

For reference: applying intel/media-driver#1500 to media-driver master did fix the encoding issues I was seeing.

@eero-t
Copy link

eero-t commented Oct 14, 2022

If you just want things to work on 22.04, instead of building things yourself, I think you could try Ubuntu's OEM kernel, and Intel's kernel DKMS + user-space driver packages matching that. Documentation: https://dgpu-docs.intel.com/installation-guides/ubuntu/ubuntu-jammy-arc.html

(I think it will still take a while until all dGPU support gets into upstream kernel.)

@gizahNL
Copy link
Author

gizahNL commented Oct 14, 2022

If you just want things to work on 22.04, instead of building things yourself, I think you could try Ubuntu's OEM kernel, and Intel's kernel DKMS + user-space driver packages matching that. Documentation: https://dgpu-docs.intel.com/installation-guides/ubuntu/ubuntu-jammy-arc.html

(I think it will still take a while until all dGPU support gets into upstream kernel.)

I'm very comfortable with building myself, and have little interest in downgrading my workstation ;) But thank you anyway for your suggestion

@eero-t
Copy link

eero-t commented Oct 14, 2022

While the Ubuntu 22.04 OEM kernel is newer (5.17) than 22.04 default kernel (5.15 LTS), I guess it's indeed not so tempting if you e.g. have other devices that need even newer kernel.

@gizahNL
Copy link
Author

gizahNL commented Oct 14, 2022

While the Ubuntu 22.04 OEM kernel is newer (5.17) than 22.04 default kernel (5.15 LTS), I guess it's indeed not so tempting if you e.g. have other devices that need even newer kernel.

I'm on 22.10 ;)

@Jexu
Copy link
Contributor

Jexu commented Nov 8, 2022

Looks above fix works for your issue, so I will close this issue and please re-open it again if having any other questions

@Jexu Jexu closed this as completed Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is identified as a bug
Projects
None yet
Development

No branches or pull requests

5 participants