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

GPU Hang on decoding stream #333

Open
akhilxavi opened this issue Jun 19, 2024 · 3 comments
Open

GPU Hang on decoding stream #333

akhilxavi opened this issue Jun 19, 2024 · 3 comments

Comments

@akhilxavi
Copy link

In my Alder Lake N platform running Ubuntu Noble with 6.8.0.35-generic kernel the GPU Hang on HEVC decode of the rtsp stream.
My vainfo is

libva info: VA-API version 1.22.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_22
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0.pre1)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.2.3 (intel/media-driver@90a02f6)

Stream decode command:
ffmpeg -hide_banner -c:v hevc_qsv -probesize 32 -analyzeduration 0 -fflags nobuffer -fflags discardcorrupt -avioflags direct -flags low_delay -async_depth 1 -r 60 -load_plugin hevc_hw -i rtsp://localhost:8554/live.stream -f null -

encode command:
ffmpeg -hide_banner -pixel_format nv12 -video_size 3840x2160 -r 60 -stream_loop 10000 -i single-frame-nv12-4k.yuv -an -c:v hevc_qsv -async_depth 1 -profile:v main -tier 0 -int_ref_type horizontal -int_ref_cycle_size 6 -int_ref_qp_delta 0 -int_ref_cycle_dist 120 -bf 0 -low_power 1 -skip_frame 2 -low_delay_brc 1 -preset veryfast -b:v 200M -g 120 -slices 12 -f rtsp -rtsp_transport tcp rtsp://localhost:8554/live.stream

If I use same decode command for decoding a local file, I am not seeing the issue:

Local file decode:
ffmpeg -hide_banner -c:v hevc_qsv -probesize 32 -analyzeduration 0 -fflags nobuffer -fflags discardcorrupt -avioflags direct -flags low_delay -async_depth 1 -r 60 -load_plugin hevc_hw -i nv12-5000.h265 -f null -

If I set the GOP to a higher value the hang takes some time to happen.

libva/libva-utils/gmmlib/media-driver version?
VA-API version 1.22.0
libva 2.22.0.pre1
Intel iHD driver for Intel(R) Gen Graphics - 24.2.3
intel-gmmlib-22.3.19

GPU hardware infromation by lspci -nn |grep -Ei 'VGA|DISPLAY'?
00:02.0 VGA compatible controller [0300]: Intel Corporation Alder Lake-N [UHD Graphics] [8086:46d1]

"vpl-inspect" is working

gpu-hang.txt
hang-dmesg.txt
hang-vainfo.txt

@feiwan1
Copy link
Contributor

feiwan1 commented Jun 21, 2024

Hi @akhilxavi, any difference between live.stream and nv12-5000.h265? Did you use same encode parameters and input yuv of live.stream to encode nv12-5000.h265?

I checked on Ubuntu 20.04 with kernel 5.15 that no this issue. My stacks:
media-driver:intel-media-24.2.5
libvpl:v2.11.0
vpl-gpu-rt:intel-onevpl-24.2.5

@akhilxavi
Copy link
Author

@feiwan1 Yes encoding parameters are the same. I am using mediamtx as the RTSP server and this issue happens only when I stream RTSP using UDP as transport. If I use TCP this issue is not observed.

RTSP server:
sudo docker run --rm -it -v $PWD/mediamtx.yml:/mediamtx.yml -p 8554:8554 aler9/rtsp-simple-server:v1.6.0

@feiwan1
Copy link
Contributor

feiwan1 commented Jun 24, 2024

Sounds like a issue from RTSP server. If possible to save the stream into local file by using UDP and TCP? And compare what's the difference between them, and if stream by using UDP can be decoded by other decoder?

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