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

VVenC library leads to crashes in older CPUs #164

Closed
LukasThyWalls opened this issue Dec 15, 2024 · 9 comments
Closed

VVenC library leads to crashes in older CPUs #164

LukasThyWalls opened this issue Dec 15, 2024 · 9 comments

Comments

@LukasThyWalls
Copy link

Hello.

I think It could be good to share this topic because your builds are also affected with this: BtbN/FFmpeg-Builds#411

In the VVenC bugtracker fraunhoferhhi/vvenc#493

Thanks!

@GyanD
Copy link
Owner

GyanD commented Dec 15, 2024

Looks like I'll have to peg vvenc to an older commit. Tomorrow's build will remain affected but the next one should work.

@GyanD
Copy link
Owner

GyanD commented Dec 15, 2024

If you have an affected CPU, can you triangulate to the most recent build that works on this list - https://github.com/GyanD/codexffmpeg/tags ?

@LukasThyWalls
Copy link
Author

LukasThyWalls commented Dec 15, 2024

If you have an affected CPU, can you triangulate to the most recent build that works on this list - https://github.com/GyanD/codexffmpeg/tags ?

ffmpeg git 2024-06-27 builds Still works,
ffmpeg git 2024-06-30 builds It's the first that doesn't.

(Note: Only to point out, and as explained in the other thread, the Full version are the ones that don't work, the Essential ones don't have that issue as VVenC is an additional library)

Thanks!

@BtbN
Copy link

BtbN commented Dec 15, 2024

I don't think pinning this to an older commit will do anything.
I checked the git history, and it's been like this since the initial commit years ago.
Both that static initializer and it unconditionally passing -mavx2 to the build if you enable SIMD.

@GyanD
Copy link
Owner

GyanD commented Dec 16, 2024

So this affects x86 CPUs without AVX2?

AVX2 was introduced in 2013 (Haswell), so we're talking about 12+ year old CPUs. I'll disable vvenc for now, but I don't think it's good policy to constrain features to target very old HW/SW substrates. These users can use the essentials build or older releases, all of which are available here at Github.

@GyanD
Copy link
Owner

GyanD commented Dec 16, 2024

vvenc removed from latest git build. Please test.

@BtbN
Copy link

BtbN commented Dec 16, 2024

The problem is that it doesn't only crash when using vvenc, but it makes the entire build unusable due to global static initializers in vvenc. So even a plain ffmpeg without any arguments just crashes with SIGILL.
I wouldn't have a problem with vvenc only working on AVX2 capable hardware. This is especially silly since vvenc has runtime cpu extension detection support, but then builds everything with -mavx2 and various other feature flags.

@LukasThyWalls
Copy link
Author

vvenc removed from latest git build. Please test.

ffmpeg git 2024-12-16 builds Full works again.

>ffmpeg
ffmpeg version 2024-12-16-git-d2096679d5-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 14.2.0 (Rev1, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libopenjpeg --enable-libquirc --enable-libuavs3d --enable-libxevd --enable-libzvbi --enable-libqrencode --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxeve --enable-libxvid --enable-libaom --enable-libjxl --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-liblc3 --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      59. 51.100 / 59. 51.100
  libavcodec     61. 27.101 / 61. 27.101
  libavformat    61.  9.101 / 61.  9.101
  libavdevice    61.  4.100 / 61.  4.100
  libavfilter    10.  6.101 / 10.  6.101
  libswscale      8. 12.100 /  8. 12.100
  libswresample   5.  4.100 /  5.  4.100
  libpostproc    58.  4.100 / 58.  4.100
Universal media converter
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

The problem is that it doesn't only crash when using vvenc, but it makes the entire build unusable due to global static initializers in vvenc. So even a plain ffmpeg without any arguments just crashes with SIGILL.

This.

So this affects x86 CPUs without AVX2?

AVX2 was introduced in 2013 (Haswell), so we're talking about 12+ year old CPUs. I'll disable vvenc for now, but I don't think it's good policy to constrain features to target very old HW/SW substrates. These users can use the essentials build or older releases, all of which are available here at Github.

I wouldn't have a problem with vvenc only working on AVX2 capable hardware. This is especially silly since vvenc has runtime cpu extension detection support, but then builds everything with -mavx2 and various other feature flags.

First, It's not AVX2, is SSE4.1.

Second, I want to add that I can buy the old CPU thing, I know, those CPUs are old, although in some cases also they can use in a computer with at most 32 GB RAM (Mine is 12 GB for example), and are still serviceable for a few things.

But the point is It crash directly, with no output, and that was the initial report, and later an ask to add the proper documentation of the requirements, because the point is there wasn't any information about this in any of the projects. Funny enough, I didn't came from the same project that the original report (Initial report is yt-dlp, me was looking up info of the same issue but with streamlink in my case, what both not are even a heavy video processing projects).

I wish It could keep the compatibility with these old CPUs, maybe simply not working or only crashing when is going to be used, making this library available there for newer CPUs, because without that library at least there is no crash at the beginning, showing that is what was crashing the entire thing (and also we can bring the "less e-waste" topic there).

But even If it's not possible, you need to know because that library is forcing the requirements up and you are not building ffmpeg with that parameters, the library is doing it without you knowing, and If anyway It doesn't work in those CPUs, you should use those parameters too (I don't know if they are already using it for the entire ffmpeg when is injected by the library, or is only used by the library, which is worse).

And also in that case, this should be documented, and at this point isn't, even in the VVenC library.

Thanks!

@GyanD
Copy link
Owner

GyanD commented Dec 17, 2024

But the point is It crash directly, with no output, and that was [the initial report](https://github.com/yt-dlp/FFmpeg-Builds/
...
I wish It could keep the compatibility with these old CPUs, maybe simply not working or only crashing when is going to be used, making this library available there for newer CPUs, because without that library at least there is no crash at the beginning, showing that is what was crashing the entire thing (and also we can bring the "less e-waste" topic there).

My point is I don't think it's good policy to constrain features because of inoperability on very old systems, which likely constitute a single-digit percentage share of users, especially considering the essentials build continues to work. I'll probably re-add vvenc soon after documenting the requirements.

@GyanD GyanD closed this as completed Dec 17, 2024
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

3 participants