Open SKAntoniou opened 1 month ago
Will note from intel's drivers documentation. On 22.04 I installed these parts:
wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | \
sudo gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg
echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy client" | \
sudo tee /etc/apt/sources.list.d/intel-gpu-jammy.list
sudo apt update && sudo apt upgrade
sudo apt install -y \
intel-platform-vsec-dkms \
intel-platform-cse-dkms intel-fw-gpu
sudo apt install intel-i915-dkms
I have not had any luck installing this on 24.04. Also clinfo does not work. Would normally work like:
sudo apt install clinfo
clinfo | grep "Device Name"
Output =
Device Name Intel(R) Arc(TM) A380 Graphics
Device Name Intel(R) Arc(TM) A380 Graphics
Device Name Intel(R) Arc(TM) A380 Graphics
Device Name Intel(R) Arc(TM) A380 Graphics
On 24.04, it does not output anything.
Hi @SKAntoniou , could you have a quick check by using kernel 6.9 https://kernel.ubuntu.com/mainline/v6.9/? This maybe a kernel issue: https://github.com/jellyfin/jellyfin/issues/11626
Updated to kernel 6.9.1, very slightly better results.
So Command one doesn't stall. It has more error messages, but better than stalling.
sudo ffmpeg -hwaccel qsv -qsv_device /dev/dri/renderD128 \
-i jackryan4k.mkv \
-c:v av1_qsv \
jackryan4k2.mkv
Result now shortened:
EHW Exception: vector::_M_range_check: __n (which is 255) >= this->size() (which is 4)
[av1_qsv @ 0x5e55fb158840] Invalid FrameType:0.
[vost#0:0/av1_qsv @ 0x5e55fb09bc80] Error submitting video frame to the encoder
[vost#0:0/av1_qsv @ 0x5e55fb09bc80] Error encoding a frame: Invalid data found when processing input
[vost#0:0/av1_qsv @ 0x5e55fb09bc80] Task finished with error code: -1094995529 (Invalid data found when processing input)
[vost#0:0/av1_qsv @ 0x5e55fb09bc80] Terminating thread with return code -1094995529 (Invalid data found when processing input)
[out#0/matroska @ 0x5e55faff17c0] video:0KiB audio:198KiB subtitle:0KiB other streams:0KiB global headers:3KiB muxing overhead: 3.777159%
frame= 1 fps=0.0 q=-0.0 Lsize= 205KiB time=00:00:00.00 bitrate=N/A speed= 0x
Conversion failed!
Command two just has more error messages added to the original ones.
sudo ffmpeg -hwaccel qsv -qsv_device ${DEVICE:-/dev/dri/renderD128} -extra_hw_frames 40 -an \
-i /ssdnfs/jackryan4k.mkv \
-c:v av1_qsv -preset veryslow -profile:v main -async_depth 1 \
-b:v 1M -maxrate 2M -bufsize 4M \
-rc_init_occupancy 2M -look_ahead_depth 40 -extbrc 1 \
-b_strategy 1 -adaptive_i 1 -adaptive_b 1 -bf 7 -g 256 -strict -1 \
-fps_mode passthrough -y jackryan4k2.mkv
Results shortened:
Stream mapping:
Stream #0:0 -> #0:0 (hevc (hevc_qsv) -> av1 (av1_qsv))
Press [q] to stop, [?] for help
[av1_qsv @ 0x605c80445000] Error initializing the encoder: invalid video parameters (-15)
[vost#0:0/av1_qsv @ 0x605c80387e80] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[vf#0:0 @ 0x605c803d5e40] Error sending frames to consumers: Invalid argument
[vf#0:0 @ 0x605c803d5e40] Task finished with error code: -22 (Invalid argument)
[vf#0:0 @ 0x605c803d5e40] Terminating thread with return code -22 (Invalid argument)
[vost#0:0/av1_qsv @ 0x605c80387e80] Could not open encoder before EOF
[vost#0:0/av1_qsv @ 0x605c80387e80] Task finished with error code: -22 (Invalid argument)
[vost#0:0/av1_qsv @ 0x605c80387e80] Terminating thread with return code -22 (Invalid argument)
[out#0/matroska @ 0x605c803f85c0] Nothing was written into output file, because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A
Conversion failed!
Hi @SKAntoniou ,You can compile and re-install libmfx(https://github.com/intel/vpl-gpu-rt) to intel-onevpl-24.2.3, which works for me with kernel 6.9.0.
@feiwan1 Hi, I tried compiling libmfx on Ubuntu 24.04 with a 6.9.0 kernel using the instructions on your link, but it didn't work. Is there any chance you could give me more information on how to compile it specifically to intel-onevpl-24.2.3? I couldn't figure that bit out. Thanks.
Hi @SKAntoniou, my steps are: $ git clone https://github.com/intel/vpl-gpu-rt.git $ cd vpl-gpu-rt $ git reset --hard intel-onevpl-24.2.3 $ cmake -DCMAKE_INSTALL_PREFIX=/my/prefix $ make&&make install
Then run a transcode cmdline with -debug verbose
to make sure mfx implementation version is 2.11:
[AVHWDeviceContext @ 0x55ed3095fa40] Initialize MFX session: implementation version is 2.11
My log is in attachment. qsv.log
I ran into the same error on Ubuntu 24.04. I found that I didn't need the 6.9 kernel. I got av1_qsv to work by using 6.8, installing vpl-gpu-rt
from source, and installing everything else from the Ubuntu repos.
apt install -y --no-install-recommends ffmpeg libva-dev libdrm-dev intel-media-va-driver
vpl-gpu-rt
from source as feiwan1 said above. I didn't set the install prefix, so it installed to /opt/intel/mediasdk
export LD_LIBRARY_PATH=/opt/intel/mediasdk/lib
. This was the step that really gave me trouble because I didn't see this documented clearly anywhere.It would be nice if vpl-gpu-rt
could be installed from the Ubuntu repos, but I haven't found if that's possible.
It would be nice if
vpl-gpu-rt
could be installed from the Ubuntu repos, but I haven't found if that's possible.
libmfx-gen1.2 is the VPL runtime package in Ubuntu 24.04.
$ dpkg -l | grep libmfx-gen1.2 ii libmfx-gen1.2 23.2.3-1 amd64 Intel oneVPL GPU Runtime -- shared library
Hey, thanks for all the help on this issue. Sadly, I still can't work out what is happening.
First off, I have been using 24.04 server to test these things but have just now installed a 24.04 desktop VM to see if that was the problem but they are both come with the same errors.
Second: Both -init_hw_device vaapi=va:/dev/dri/renderD128 & -hwaccel qsv methods do not work for me on 24.04. The vaapi method definitely works on 22.04 so very weird that is also broken on 24.04. Various errors depending on if I use the libmfx-gen1.2 or compile vpl-gpu-rt myself. Tried both with updating the kernel but they give the same result. libmfx-gen1.2 will give same errors as stated earlier. vpl-gpu-rt compile errors are below:
Compile myself using commands provided in this thread. The failed to set value at the end comes from "-qsv_device ${DEVICE:-/dev/dri/renderD128}" but if that is ommitted, the error will still occur but just without the end line.
[AVHWDeviceContext @ 0x6182eaf5c380] Use Intel(R) oneVPL to create MFX session, API version is 2.9, the required implementation version is 1.3
[AVHWDeviceContext @ 0x6182eaf5c380] Error creating a MFX session: -9.
Device creation failed: -1313558101.
Failed to set value '/dev/dri/renderD128' for option 'qsv_device': Unknown error occurred
One note is that during the first make command, there are a bunch of warnings or errors that are stated in terminal. I don't know C++ but they do reference a hevc header file which is what my test file I am using is initally encoded as. I will list them all below just incase that helps. This doesn't stop the compiler and am still able to make install after so couldn't tell how serious these errors are.
In file included from /usr/include/c++/13/algorithm:61,
from /home/stephan/vpl-gpu-rt/_studio/shared/include/mfx_error.h:25,
from /home/stephan/vpl-gpu-rt/_studio/shared/include/mfx_trace.h:36,
from /home/stephan/vpl-gpu-rt/_studio/shared/include/mfx_utils.h:32,
from /home/stephan/vpl-gpu-rt/_studio/shared/include/mfxvideo++int.h:36,
from /home/stephan/vpl-gpu-rt/_studio/shared/include/mfx_common.h:25,
from /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:21:
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:167:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/va/va.h:5272,
from /home/stephan/vpl-gpu-rt/_studio/shared/include/mfx_utils.h:39:
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:620:21: note: at offset 19 into destination object ‘_VAEncPictureParameterBufferHEVC::column_width_minus1’ of size 19
620 | uint8_t column_width_minus1[19];
| ^~~~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:167:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:620:21: note: at offset [20, 23] into destination object ‘_VAEncPictureParameterBufferHEVC::column_width_minus1’ of size 19
620 | uint8_t column_width_minus1[19];
| ^~~~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:167:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:620:21: note: at offset [21, 24] into destination object ‘_VAEncPictureParameterBufferHEVC::column_width_minus1’ of size 19
620 | uint8_t column_width_minus1[19];
| ^~~~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:167:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:620:21: note: at offset [22, 25] into destination object ‘_VAEncPictureParameterBufferHEVC::column_width_minus1’ of size 19
620 | uint8_t column_width_minus1[19];
| ^~~~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:167:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:620:21: note: at offset [23, 26] into destination object ‘_VAEncPictureParameterBufferHEVC::column_width_minus1’ of size 19
620 | uint8_t column_width_minus1[19];
| ^~~~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:167:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:620:21: note: at offset [24, 27] into destination object ‘_VAEncPictureParameterBufferHEVC::column_width_minus1’ of size 19
620 | uint8_t column_width_minus1[19];
| ^~~~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:167:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:620:21: note: at offset [25, 28] into destination object ‘_VAEncPictureParameterBufferHEVC::column_width_minus1’ of size 19
620 | uint8_t column_width_minus1[19];
| ^~~~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:167:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:620:21: note: at offset [26, 29] into destination object ‘_VAEncPictureParameterBufferHEVC::column_width_minus1’ of size 19
620 | uint8_t column_width_minus1[19];
| ^~~~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:167:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:620:21: note: at offset [27, 30] into destination object ‘_VAEncPictureParameterBufferHEVC::column_width_minus1’ of size 19
620 | uint8_t column_width_minus1[19];
| ^~~~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:167:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:620:21: note: at offset [28, 31] into destination object ‘_VAEncPictureParameterBufferHEVC::column_width_minus1’ of size 19
620 | uint8_t column_width_minus1[19];
| ^~~~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:167:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:620:21: note: at offset [29, 32] into destination object ‘_VAEncPictureParameterBufferHEVC::column_width_minus1’ of size 19
620 | uint8_t column_width_minus1[19];
| ^~~~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:167:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:620:21: note: at offset [30, 33] into destination object ‘_VAEncPictureParameterBufferHEVC::column_width_minus1’ of size 19
620 | uint8_t column_width_minus1[19];
| ^~~~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:172:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:623:21: note: at offset 21 into destination object ‘_VAEncPictureParameterBufferHEVC::row_height_minus1’ of size 21
623 | uint8_t row_height_minus1[21];
| ^~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:172:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:623:21: note: at offset [22, 27] into destination object ‘_VAEncPictureParameterBufferHEVC::row_height_minus1’ of size 21
623 | uint8_t row_height_minus1[21];
| ^~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:172:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:623:21: note: at offset [23, 28] into destination object ‘_VAEncPictureParameterBufferHEVC::row_height_minus1’ of size 21
623 | uint8_t row_height_minus1[21];
| ^~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:172:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:623:21: note: at offset [24, 29] into destination object ‘_VAEncPictureParameterBufferHEVC::row_height_minus1’ of size 21
623 | uint8_t row_height_minus1[21];
| ^~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:172:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:623:21: note: at offset [25, 30] into destination object ‘_VAEncPictureParameterBufferHEVC::row_height_minus1’ of size 21
623 | uint8_t row_height_minus1[21];
| ^~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:172:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:623:21: note: at offset [26, 31] into destination object ‘_VAEncPictureParameterBufferHEVC::row_height_minus1’ of size 21
623 | uint8_t row_height_minus1[21];
| ^~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:172:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:623:21: note: at offset [27, 32] into destination object ‘_VAEncPictureParameterBufferHEVC::row_height_minus1’ of size 21
623 | uint8_t row_height_minus1[21];
| ^~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:172:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:623:21: note: at offset [28, 33] into destination object ‘_VAEncPictureParameterBufferHEVC::row_height_minus1’ of size 21
623 | uint8_t row_height_minus1[21];
| ^~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:172:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:623:21: note: at offset [29, 34] into destination object ‘_VAEncPictureParameterBufferHEVC::row_height_minus1’ of size 21
623 | uint8_t row_height_minus1[21];
| ^~~~~~~~~~~~~~~~~
In function ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = const short unsigned int*; _OIter = unsigned char*; _UnaryOperation = InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)::<lambda(mfxU16)>]’,
inlined from ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’ at /home/stephan/vpl-gpu-rt/_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp:172:19:
/usr/include/c++/13/bits/stl_algo.h:4309:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
4309 | *__result = __unary_op(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/va/va_enc_hevc.h: In function ‘void InitPPS(const MfxExtBuffer::Param<mfxVideoParam>&, const HEVCEHW::Base::PPS&, VAEncPictureParameterBufferHEVC&)’:
/usr/include/va/va_enc_hevc.h:623:21: note: at offset [30, 35] into destination object ‘_VAEncPictureParameterBufferHEVC::row_height_minus1’ of size 21
623 | uint8_t row_height_minus1[21];
I don't really know what to try and to be honest don't understand how this is not working when you have been able to get it working on your end. For future reference, will probably only be using ubuntu server version as it is easier to manage and test on.
Second: Both -init_hw_device vaapi=va:/dev/dri/renderD128 & -hwaccel qsv methods do not work for me on 24.04. The vaapi method definitely works on 22.04 so very weird that is also broken on 24.04.
Seems you mixed vaapi & qsv hardware acceleration. Please use -init_hw_device qsv[=
Please run vainfo
to check whether the environment for vaapi is correct, then run vpl-inspect
to check whether the environment for vpl is correct.
One note is that during the first make command, there are a bunch of warnings or errors that are stated in terminal. I don't know C++ but they do reference a hevc header file which is what my test file I am using is initally encoded as. I will list them all below just incase that helps. This doesn't stop the compiler and am still able to make install after so couldn't tell how serious these errors are.
This should not be the cause of your error.
Seems you mixed vaapi & qsv hardware acceleration. Please use -init_hw_device qsv[=:[,key=value,...]] to create qsv device when using -hwaccel qsv.
Sorry, I wrote that poorly. I ran the commands correctly, but I was just stating the methods using their options in ffmpeg to be specific. To be clear, I ran them separately, but both methods do not work for me on 24.04.
Please run
vainfo
to check whether the environment for vaapi is correct, then runvpl-inspect
to check whether the environment for vpl is correct.
The vainfo results look mostly correct but don't have the vpl-inspect command. By any chance, do you know what package that is included in or how to manually install it?
The following part is the vainfo result so you can verify that the output is correct (removed the rest of the profiles to keep it short). The start shows an error but in intel's documentation on their site, they run vainfo --display drm | grep Driver
which hides that error so don't know if it matters.
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.20.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.20 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.1.0 ()
vainfo: Supported profile and entrypoints
VAProfileNone : VAEntrypointVideoProc
VAProfileNone : VAEntrypointStats
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
The vainfo results look mostly correct but don't have the vpl-inspect command. By any chance, do you know what package that is included in or how to manually install it?
onevpl-tools
package has vpl-inspect
The start shows an error but in intel's documentation on their site,
You may ignore the error message at the beginning.
vainfo: VA-API version: 1.20 (libva 2.12.0)
vainfo was built against libva 2.12.0 which supports VA-API 1.12, however your current VA-API version is 1.20. So I presumed your VA-API based applications (including FFmpeg) were built against libva 2.12.0, then you upgraded libva to libva 2.20.0. Could you rebuild vainfo, FFmpeg etc against libva 2.20.0 ?
Sorry, I wrote that poorly. I ran the commands correctly, but I was just stating the methods using their options in ffmpeg to be specific. To be clear, I ran them separately, but both methods do not work for me on 24.04.
Could you provide your command line using vaapi and the error message ?
onevpl-tools
package hasvpl-inspect
vpl-inspect output:
Warning - no implementations found by MFXEnumImplementations()
vainfo was the same
Sorry, I wrote that poorly. I ran the commands correctly, but I was just stating the methods using their options in ffmpeg to be specific. To be clear, I ran them separately, but both methods do not work for me on 24.04.
Could you provide your command line using vaapi and the error message ?
sudo ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD128 \
-i /ssdnfs/jackryan4k.mkv \
-c:v av1_qsv jackryan4k2.mp4
gives these errors
[av1_qsv @ 0x56099f9c9e40] Error creating a MFX session: -9.
[vost#0:0/av1_qsv @ 0x56099f9c9a80] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
Error while filtering: Unknown error occurred
If I add -b:v 1M or any bitrate option, the error stays the same.
Hey, so I am trying to use ffmpeg with QSV on 24.04 Ubuntu LTS, 6.8 Kernel. I am going to run through all the errors and cases I encountered. Most of this is just a ffmpeg log, but I thought it would be best to include it all in case I missed anything. Let me know if you need anything.
The ffmpeg commands that work:
This will work without issue. I just want to see if the QSV method will increase performance.
The ffmpeg command that doesn't work:
I want to test if this increases performance, but I can't get this to work. This is what is referenced in the Intel Media Delivery optimisation documentation.
Standard Media Driver Package packages installed:
These errors are the same if intel-media-va-driver-non-free is installed instead.
Command ran - Most basic of command - If I add just -b:v, it remains the same issue:
Result:
This then stalls, and nothing happens.
If I do what it says midway through:
Same errors at the end.
This next part worked on 22.04 HWE with ffmpeg 6.1 package installed (with vaapi option used instead of qsv). This breaks on 24.04 for some reason and gives this error so this may be a 24.04 error. Command Used - If I try to replicate https://github.com/intel/media-delivery/blob/master/doc/quality.rst#av1 commands then it breaks earlier.
Results: