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

Document the minimal processor requirements #411

Open
nihil-admirari opened this issue Oct 19, 2024 · 22 comments
Open

Document the minimal processor requirements #411

nihil-admirari opened this issue Oct 19, 2024 · 22 comments

Comments

@nihil-admirari
Copy link
Contributor

Got an issue about illegal instruction on a processor from 2010. Builds before 30 July 2024 were operational. Apparently support for older hardware was dropped since them, but what are the exact requirements?

@BtbN
Copy link
Owner

BtbN commented Oct 19, 2024

I'm not aware of any minimum processor requirements.
People have suggested optimizing for x86-64-v3, but I rejected that, so it really should work on any amd64 CPU as far as compiler options are concerned.
If an individual dependency decides to use more modern instructions unconditionally, that's sadly out of my control and also hard to track down.

@BtbN
Copy link
Owner

BtbN commented Nov 6, 2024

Did anything come from this? The builds are supposed to be generic x86_64.

@nihil-admirari
Copy link
Contributor Author

I haven't investigated it myself. Asked @chaos7x to run ffmpeg under gdb to find out which instruction is causing the SIGILL.

@LukasThyWalls
Copy link

Hello.

In my case, I found the latest FFmpeg bundled with Streamlink didn't work for me, and looking up I ended here.

I have an AMD Athlon II X3 450/Phenom II X4 B50.

Testing with windbg, I found It crash with an illegal instruction pinsrq xmm0, r11, 1 which, is a SSE4.1 instruction which this CPU doesn't have.

Testing releases, the last one working for me is Auto-Build 2024-08-31 12:50 (7.0.2-GPL), next one Auto-Build 2024-09-30 15:36 (7.1-GPL) doesn't.

I tried to look up for platform/flags/arch in makefile/configure files but I'm not familiar with your workflow.

Thanks.

@BtbN
Copy link
Owner

BtbN commented Dec 12, 2024

There are no such flags anywhere, which should normally mean it's generic x86_64 and should work on any CPU.
I still don't know what and where causes the instructions to be used.

@LukasThyWalls
Copy link

I'm not saying there is something, I didn't see anything too, but you know more than me.

Here is the Windbg output

************* Preparing the environment for Debugger Extensions Gallery repositories **************
   ExtensionRepository : Implicit
   UseExperimentalFeatureForNugetShare : true
   AllowNugetExeUpdate : true
   NonInteractiveNuget : true
   AllowNugetMSCredentialProviderInstall : true
   AllowParallelInitializationOfLocalRepositories : true
   EnableRedirectToChakraJsProvider : false

   -- Configuring repositories
      ----> Repository : LocalInstalled, Enabled: true
      ----> Repository : UserExtensions, Enabled: true

>>>>>>>>>>>>> Preparing the environment for Debugger Extensions Gallery repositories completed, duration 0.016 seconds

************* Waiting for Debugger Extensions Gallery to Initialize **************

>>>>>>>>>>>>> Waiting for Debugger Extensions Gallery to Initialize completed, duration 0.703 seconds
   ----> Repository : UserExtensions, Enabled: true, Packages count: 0
   ----> Repository : LocalInstalled, Enabled: true, Packages count: 42

Microsoft (R) Windows Debugger Version 10.0.27725.1000 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.

CommandLine: E:\Lukas ThyWalls\Escritorio\ffmpeg\ffmpeg-n7.1-latest-win64-gpl-7.1\bin\ffmpeg.exe

************* Path validation summary **************
Response                         Time (ms)     Location
Deferred                                       srv*
Symbol search path is: srv*
Executable search path is: 
ModLoad: 00007ff7`6d890000 00007ff7`770a9000   ffmpeg_g.exe
ModLoad: 00007ffe`a8f30000 00007ffe`a9128000   ntdll.dll
ModLoad: 00007ffe`a86a0000 00007ffe`a8762000   C:\Windows\System32\KERNEL32.DLL
ModLoad: 00007ffe`a6c50000 00007ffe`a6f4e000   C:\Windows\System32\KERNELBASE.dll

************* Path validation summary **************
Response                         Time (ms)     Location
Deferred                                       srv*
Symbol search path is: srv*
Executable search path is: 
ModLoad: 00007ff6`876d0000 00007ff6`877ab000   conhost.exe
ModLoad: 00007ffe`a8f30000 00007ffe`a9128000   ntdll.dll
ModLoad: 00007ffe`a86a0000 00007ffe`a8762000   C:\Windows\System32\KERNEL32.DLL
ModLoad: 00007ffe`a6c50000 00007ffe`a6f4e000   C:\Windows\System32\KERNELBASE.dll
ModLoad: 00007ffe`a6bb0000 00007ffe`a6c4d000   C:\Windows\System32\msvcp_win.dll
ModLoad: 00007ffe`a6ab0000 00007ffe`a6bb0000   C:\Windows\System32\ucrtbase.dll
ModLoad: 00007ffe`a85d0000 00007ffe`a867d000   C:\Windows\System32\shcore.dll
ModLoad: 00007ffe`a8770000 00007ffe`a880e000   C:\Windows\System32\msvcrt.dll
ModLoad: 00007ffe`a8a40000 00007ffe`a8d93000   C:\Windows\System32\combase.dll
ModLoad: 00007ffe`a72e0000 00007ffe`a7403000   C:\Windows\System32\RPCRT4.dll
ModLoad: 00007ffe`a8240000 00007ffe`a82f1000   C:\Windows\System32\advapi32.dll
ModLoad: 00007ffe`a7240000 00007ffe`a72df000   C:\Windows\System32\sechost.dll
ModLoad: 00007ffe`a6920000 00007ffe`a6947000   C:\Windows\System32\bcrypt.dll
(2f8c.1cb0): Break instruction exception - code 80000003 (first chance)
ntdll!LdrpDoDebuggerBreak+0x30:
00007ffe`a90007a0 cc              int     3
1:001> g
ModLoad: 00007ffe`a7040000 00007ffe`a71dd000   C:\Windows\System32\user32.dll
ModLoad: 00007ffe`a66f0000 00007ffe`a6712000   C:\Windows\System32\win32u.dll
ModLoad: 00007ffe`a8880000 00007ffe`a88ab000   C:\Windows\System32\GDI32.dll
ModLoad: 00007ffe`a65d0000 00007ffe`a66e7000   C:\Windows\System32\gdi32full.dll
ModLoad: 00007ffe`a88b0000 00007ffe`a88df000   C:\Windows\System32\IMM32.DLL
ModLoad: 00007ffe`a7ad0000 00007ffe`a823d000   C:\Windows\System32\shell32.dll
ModLoad: 00007ffe`a3f80000 00007ffe`a401e000   C:\Windows\system32\uxtheme.dll
onecore\windows\core\console\open\src\interactivity\win32\systemconfigurationprovider.cpp(181)\conhost.exe!00007FF6876D434E: (caller: 00007FF6876D4C64) LogHr(1) tid(e84) 80004005 Error no especificado
onecore\windows\core\console\open\src\renderer\gdi\state.cpp(243)\conhost.exe!00007FF6876D6736: (caller: 00007FF6876D885F) LogHr(2) tid(3220) 80004005 Error no especificado
ModLoad: 00007ffe`95ee0000 00007ffe`95ee7000   C:\Program Files (x86)\Sizer\hook64.dll
ModLoad: 00007ffe`a84b0000 00007ffe`a85c5000   C:\Windows\System32\MSCTF.dll
ModLoad: 00007ffe`a8e10000 00007ffe`a8edd000   C:\Windows\System32\OLEAUT32.dll
ModLoad: 00007ffe`96410000 00007ffe`964be000   C:\Windows\SYSTEM32\TextShaping.dll
ModLoad: 00007ffe`8ee90000 00007ffe`8f12a000   C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.4355_none_60b8b9eb71f62e16\comctl32.DLL
ModLoad: 00007ffe`a4170000 00007ffe`a419f000   C:\Windows\SYSTEM32\dwmapi.dll
ModLoad: 00007ffe`a4470000 00007ffe`a4482000   C:\Windows\SYSTEM32\kernel.appcore.dll
ModLoad: 00007ffe`a6890000 00007ffe`a6912000   C:\Windows\System32\bcryptPrimitives.dll
ModLoad: 00007ffe`9aea0000 00007ffe`9af99000   C:\Windows\SYSTEM32\textinputframework.dll
ModLoad: 00007ffe`a3650000 00007ffe`a3742000   C:\Windows\System32\CoreMessaging.dll
ModLoad: 00007ffe`a32f0000 00007ffe`a364b000   C:\Windows\System32\CoreUIComponents.dll
ModLoad: 00007ffe`a8810000 00007ffe`a887b000   C:\Windows\System32\WS2_32.dll
ModLoad: 00007ffe`a5860000 00007ffe`a5893000   C:\Windows\SYSTEM32\ntmarta.dll
ModLoad: 00007ffe`a2b40000 00007ffe`a2c97000   C:\Windows\SYSTEM32\wintypes.dll
ModLoad: 00000231`9f210000 00000231`9f367000   C:\Windows\SYSTEM32\wintypes.dll
ModLoad: 00007ffe`a7410000 00007ffe`a74b9000   C:\Windows\System32\clbcatq.dll
ModLoad: 00007ffe`a8240000 00007ffe`a82f1000   C:\Windows\System32\ADVAPI32.dll
ModLoad: 00007ffe`a8770000 00007ffe`a880e000   C:\Windows\System32\msvcrt.dll
ModLoad: 00007ffe`a7240000 00007ffe`a72df000   C:\Windows\System32\sechost.dll
ModLoad: 00007ffe`a72e0000 00007ffe`a7403000   C:\Windows\System32\RPCRT4.dll
ModLoad: 00007ffe`a6920000 00007ffe`a6947000   C:\Windows\System32\bcrypt.dll
ModLoad: 00007ffe`a6840000 00007ffe`a688e000   C:\Windows\System32\CFGMGR32.dll
ModLoad: 00007ffe`a6ab0000 00007ffe`a6bb0000   C:\Windows\System32\ucrtbase.dll
ModLoad: 00007ffe`a6950000 00007ffe`a6aac000   C:\Windows\System32\CRYPT32.dll
ModLoad: 00007ffe`a8880000 00007ffe`a88ab000   C:\Windows\System32\GDI32.dll
ModLoad: 00007ffe`a66f0000 00007ffe`a6712000   C:\Windows\System32\win32u.dll
ModLoad: 00007ffe`a65d0000 00007ffe`a66e7000   C:\Windows\System32\gdi32full.dll
ModLoad: 00007ffe`a6bb0000 00007ffe`a6c4d000   C:\Windows\System32\msvcp_win.dll
ModLoad: 00007ffe`a7040000 00007ffe`a71dd000   C:\Windows\System32\USER32.dll
ModLoad: 00007ffe`a88b0000 00007ffe`a88df000   C:\Windows\System32\IMM32.dll
ModLoad: 00007ffe`a7520000 00007ffe`a764b000   C:\Windows\System32\ole32.dll
ModLoad: 00007ffe`a8a40000 00007ffe`a8d93000   C:\Windows\System32\combase.dll
ModLoad: 00007ffe`a8e10000 00007ffe`a8edd000   C:\Windows\System32\OLEAUT32.dll
ModLoad: 00007ffe`a7650000 00007ffe`a7abe000   C:\Windows\System32\SETUPAPI.dll
ModLoad: 00007ffe`a7ad0000 00007ffe`a823d000   C:\Windows\System32\SHELL32.dll
ModLoad: 00007ffe`a71e0000 00007ffe`a7235000   C:\Windows\System32\SHLWAPI.dll
ModLoad: 00007ffe`a8810000 00007ffe`a887b000   C:\Windows\System32\WS2_32.dll
ModLoad: 00007ffe`a0ca0000 00007ffe`a0caa000   C:\Windows\SYSTEM32\AVRT.dll
ModLoad: 00007ffe`a2570000 00007ffe`a2b30000   C:\Windows\SYSTEM32\d2d1.dll
ModLoad: 00007ffe`99d70000 00007ffe`99fef000   C:\Windows\SYSTEM32\DWrite.dll
ModLoad: 00007ffe`a59d0000 00007ffe`a5a0b000   C:\Windows\SYSTEM32\IPHLPAPI.DLL
ModLoad: 00007ffe`8daf0000 00007ffe`8dafc000   C:\Windows\SYSTEM32\Secur32.dll
ModLoad: 00007ffe`9f020000 00007ffe`9f039000   C:\Windows\SYSTEM32\USP10.dll
ModLoad: 00007ffe`a0c50000 00007ffe`a0c5a000   C:\Windows\SYSTEM32\VERSION.dll
ModLoad: 00007ffe`94f70000 00007ffe`94f89000   C:\Windows\SYSTEM32\AVICAP32.dll
ModLoad: 00007ffe`9c1d0000 00007ffe`9c1f7000   C:\Windows\SYSTEM32\WINMM.dll
ModLoad: 00007ffe`8aa40000 00007ffe`8aa6b000   C:\Windows\SYSTEM32\MSVFW32.dll
ModLoad: 00007ffe`9f130000 00007ffe`9f1e0000   C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.19041.4355_none_792ecafd2442822f\COMCTL32.dll
ModLoad: 00007ffe`a6480000 00007ffe`a64b2000   C:\Windows\SYSTEM32\SSPICLI.DLL
(3210.29bc): Break instruction exception - code 80000003 (first chance)
ntdll!LdrpDoDebuggerBreak+0x30:
00007ffe`a90007a0 cc              int     3
0:000> g
ModLoad: 00007ffe`a6890000 00007ffe`a6912000   C:\Windows\System32\bcryptPrimitives.dll
(3210.29bc): Illegal instruction - code c000001d (first chance)
(3210.29bc): Illegal instruction - code c000001d (!!! second chance !!!)
ffmpeg_g!JxlDecoderProcessInput+0x27b743e:
00007ff7`73e335de 66490f3a22c301  pinsrq  xmm0,r11,1

I could compile it and It works, but without the libraries (It's complicated for someone like me).

>ffmpeg
ffmpeg version 7.1 Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 14.2.0 (Rev2, Built by MSYS2 project)
  configuration: --pkg-config-flags=--static --arch=x86_64 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --disable-autodetect --extra-ldflags=-pthread
  libavutil      59. 39.100 / 59. 39.100
  libavcodec     61. 19.100 / 61. 19.100
  libavformat    61.  7.100 / 61.  7.100
  libavdevice    61.  3.100 / 61.  3.100
  libavfilter    10.  4.100 / 10.  4.100
  libswscale      8.  3.100 /  8.  3.100
  libswresample   5.  3.100 /  5.  3.100
  libpostproc    58.  3.100 / 58.  3.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'

So, I tried the gyan.dev full 7.1 and master builds have the same problem, so It's not from your builds. But the essentials ones from there works, so, for sure is one of the extra libraries included in the full version:

chromaprint frei0r ladspa libaribb24 libaribcaption libbluray libbs2b libcaca libcdio libcodec2 libdav1d libdavs2 libflite libilbc libjxl liblc3 liblensfun libmodplug libmysofa libplacebo libqrencode libquirc librav1e librist libshaderc libshine libsnappy libsoxr libsvtav1 libtwolame libuavs3d libvvenc libxavs2 libxevd libxeve libzvbi opencl vulkan

Still a needle in a haystack. Any advice to find more information? Should report this in the ffmpeg bugtracker? Or maybe is not the right site? (ffmpeg works)

@BtbN
Copy link
Owner

BtbN commented Dec 14, 2024

It would need reported in the bugtracker of the respective library, ffmpeg itself can't do anything about it either.
An option to pinpoint it would be to make a build with debug symbols (there's an addin for it, but it's huge, several gigabytes), Then the debugger should point to the offending library.

@BtbN
Copy link
Owner

BtbN commented Dec 14, 2024

Here's a debug build of latest master:
https://btbn.de/files/ffmpeg-N-118059-g90af8e07b0-linux64-gpl-debug.tar.xz

@LukasThyWalls
Copy link

LukasThyWalls commented Dec 14, 2024

Here's a debug build of latest master: https://btbn.de/files/ffmpeg-N-118059-g90af8e07b0-linux64-gpl-debug.tar.xz

Thanks! But It's for Linux64 and It's 7.0.

Anyway, I tried to use it within cygwin but because It's the 7.0 one works:

(useless output)

Testing all I could, I can only say: All 7.0.2 and below works, and between 7.1 and master, "Essential" work, "Full" builds (like yours 7.1) don't.

Also, the last time I tried to debug something, I found that after compiling the build with debug symbols, the build also disabled any CPU optimisations and It worked, so I was a waste of time. I don't know If here is the same case...

It would need reported in the bugtracker of the respective library, ffmpeg itself can't do anything about it either.

I was guessing that. It's not their fault. But at some point if the compatibility could not be regained, they should know at least.

@BtbN
Copy link
Owner

BtbN commented Dec 14, 2024

Windows debuggers cannot read the symbols gcc produces, so it wouldn't be helpful.
And cygwin can't run linux binaries. You should be able to run it in WSL though.

@LukasThyWalls
Copy link

Windows debuggers cannot read the symbols gcc produces, so it wouldn't be helpful. And cygwin can't run linux binaries. You should be able to run it in WSL though.

Sorry, my fault. I was distracted and It's a thing I usually don't do.

GDB output:

Starting program: ffmpeg/ffmpeg-N-118059-g90af8e07b0-linux64-gpl-debug/bin/ffmpeg 

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.ubuntu.com>
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0x0000555559bb37b7 in vvenc::PelBufferOps::PelBufferOps (this=0x55555e848bc0 <vvenc::g_pelBufOP>) at /50-vvenc/source/Lib/CommonLib/Buffer.cpp:455
warning: 455	/50-vvenc/source/Lib/CommonLib/Buffer.cpp: No such file or directory

So, I suppose, that points to VVenC and. specifically, to here?.

Looking in the README of the Gyan builds, the 7.0.2 Full Build that works uses vvenc v1.12.0-6-g4488526, and the 7.1 Full Build that doesn't uses vvenc v1.12.0-17-g0e7d4d3.

Thanks for the tips!

@BtbN
Copy link
Owner

BtbN commented Dec 15, 2024

Is that just a plain "ffmpeg" invocation, without any further arguments?

@LukasThyWalls
Copy link

LukasThyWalls commented Dec 15, 2024

Is that just a plain "ffmpeg" invocation, without any further arguments?

Yes.

Just realised that It's something to be mention before: The crash comes directly executing ffmpeg without any arguments.

In Windows, meanwhile with 7.0 (the last one of yours that work) shows this:

>ffmpeg
ffmpeg version n7.0-7-gd38bf5e08e-20240406 Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 13.2.0 (crosstool-NG 1.26.0.65_ecc5e41)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --enable-libdvdread --enable-libdvdnav --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libaribcaption --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-libs=-lgomp --extra-ldflags=-pthread --extra-ldexeflags= --cc=x86_64-w64-mingw32-gcc --cxx=x86_64-w64-mingw32-g++ --ar=x86_64-w64-mingw32-gcc-ar --ranlib=x86_64-w64-mingw32-gcc-ranlib --nm=x86_64-w64-mingw32-gcc-nm --extra-version=20240406
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.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'

>

7.1 does this:

>ffmpeg

>

I suppose, in Linux, it will show the same or only "Illegal Instruction" (I think I did that but I don't remember the output, I only copied the gdb output).

@BtbN
Copy link
Owner

BtbN commented Dec 15, 2024

Something that'd also be interesting would be a backtrace (type bt into gdb after the crash), to find out where it calls vvenc stuff on init from.

@BtbN
Copy link
Owner

BtbN commented Dec 15, 2024

7.0 not crashing also makes sense, since it has no vvenc support.

@BtbN
Copy link
Owner

BtbN commented Dec 15, 2024

It seems like vvenc injects -msse4.1 into the compiler options:

11.15 [ 58%] Building CXX object source/Lib/vvenc/CMakeFiles/vvenc.dir/__/CommonLib/Slice.cpp.obj
11.18 cd /50-vvenc/build/source/Lib/vvenc && /opt/ct-ng/bin/x86_64-w64-mingw32-g++ --sysroot=/opt/ct-ng/x86_64-w64-mingw32/sysroot -DHAVE_PTHREADS -DTARGET_SIMD_X86=1 -DVVENC_SOURCE -D_WIN32_WINNT=0x0600 @CMakeFiles/vvenc.dir/includes_CXX.rsp -static-libgcc -static-libstdc++ -I/opt/ffbuild/include -O2 -pipe -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-semantic-interposition -DVVENC_ENABLE_THIRDPARTY_JSON -DVVENC_ENABLE_THIRDPARTY_JSON -O3 -DNDEBUG -std=gnu++14 -fvisibility=hidden -fno-keep-inline-dllexport -msse4.1 -Werror -Wall -Wno-unused-function -Wno-unused-variable -Wno-sign-compare -fdiagnostics-show-option -Wno-ignored-attributes -MD -MT source/Lib/vvenc/CMakeFiles/vvenc.dir/__/CommonLib/Slice.cpp.obj -MF CMakeFiles/vvenc.dir/__/CommonLib/Slice.cpp.obj.d -o CMakeFiles/vvenc.dir/__/CommonLib/Slice.cpp.obj -c /50-vvenc/source/Lib/CommonLib/Slice.cpp

So that's most likely what's causing this. Now, the question is if that can just somehow be turned off, or if the call on init can be avoided somehow, so that at least everything except vvenc works on older archs.
If neither is the case somehow, vvenc might need to be removed again.

@BtbN
Copy link
Owner

BtbN commented Dec 15, 2024

It's a combination of them using a static initializer for the buffer: https://github.com/fraunhoferhhi/vvenc/blob/0c2c21eba8b336a273e7dc6e5e7fc0a95e8c5fcc/source/Lib/CommonLib/Buffer.cpp#L500
And hard-enabling all CPU extensions up to avx2: https://github.com/fraunhoferhhi/vvenc/blob/0c2c21eba8b336a273e7dc6e5e7fc0a95e8c5fcc/source/Lib/vvenc/CMakeLists.txt#L110

I have thus now disabled vvenc from the builds. There is no way to remedy this outside of a major redesign by vvenc upstream.
And I'd rather have the builds work on CPUs without avx2 than support vvenc.

@LukasThyWalls
Copy link

Something that'd also be interesting would be a backtrace (type bt into gdb after the crash), to find out where it calls vvenc stuff on init from.

I know you figured out, but as you asked for, and I could not shared earlier:

Starting program: ffmpeg/ffmpeg-N-118059-g90af8e07b0-linux64-gpl-debug/bin/ffmpeg 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0x0000555559bb37b7 in vvenc::PelBufferOps::PelBufferOps (this=0x55555e848bc0 <vvenc::g_pelBufOP>) at /50-vvenc/source/Lib/CommonLib/Buffer.cpp:455
warning: 455	/50-vvenc/source/Lib/CommonLib/Buffer.cpp: No such file or directory
#0  0x0000555559bb37b7 in vvenc::PelBufferOps::PelBufferOps (this=0x55555e848bc0 <vvenc::g_pelBufOP>) at /50-vvenc/source/Lib/CommonLib/Buffer.cpp:455
#1  0x0000555557ee5c5c in __libc_csu_init ()
#2  0x00007ffff7ccc264 in __libc_start_main_impl (main=0x555555a20a86 <main>, argc=1, argv=0x7fffffffdf58, init=0x555557ee5c10 <__libc_csu_init>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdf48) at ../csu/libc-start.c:343
#3  0x00005555559f232a in _start ()

Thanks!

@BtbN
Copy link
Owner

BtbN commented Dec 15, 2024

Could you try if this build still crashes: https://btbn.de/files/ffmpeg-N-118066-g8ad34e97b6-win64-gpl.zip
It'll definitely still crash when actually using vvenc, but I tried making at least the static initializers not require and advanced instructions.

@LukasThyWalls
Copy link

Could you try if this build still crashes: https://btbn.de/files/ffmpeg-N-118066-g8ad34e97b6-win64-gpl.zip It'll definitely still crash when actually using vvenc, but I tried making at least the static initializers not require and advanced instructions.

Still crash in the same way than the others: There is no output and Windbg points the same illegal instruction that was mentioned above.

@BtbN
Copy link
Owner

BtbN commented Dec 15, 2024

How about this one? https://btbn.de/files/ffmpeg-N-118066-g8ad34e97b6-win64-gpl-2.zip
It adds another flag to those functions. I unfortunately can't reproduce the crash myself on any machine I got access to.

@LukasThyWalls
Copy link

How about this one? https://btbn.de/files/ffmpeg-N-118066-g8ad34e97b6-win64-gpl-2.zip It adds another flag to those functions. I unfortunately can't reproduce the crash myself on any machine I got access to.

No difference.

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