borodust / alien-works

Multiplatform game foundation framework for Common Lisp
MIT License
60 stars 2 forks source link

Foundation libraries require AVX support #1

Open borodust opened 2 years ago

borodust commented 2 years ago

Even when built in LTS environment. Backtrace goes smth like this:

Thread 1 (Thread 0x7fea654dd340 (LWP 31116) "app"):
#0  0x00007fea655c691c in read () from /lib64/libc.so.6
#1  0x00007fea6555a1fa in _IO_file_underflow () from /lib64/libc.so.6
#2  0x00007fea6555b402 in _IO_default_uflow () from /lib64/libc.so.6
#3  0x00007fea6554e9fa in _IO_getline_info () from /lib64/libc.so.6
#4  0x00007fea6554d9e6 in fgets () from /lib64/libc.so.6
#5  0x0000555c1641ceba in ldb_monitor ()
#6  0x0000555c16417e6a in ?? ()
#7  0x0000555c16418027 in lose ()
#8  0x0000555c1642850c in sigill_handler ()
#9  0x0000555c16418a43 in ?? ()
#10 <signal handler called>
#11 0x00007fea6357b9c8 in utils::io::ostream::Buffer::Buffer() () from /tmp/.mount_alien-iTvxcQ/usr/lib/libfilament.clawed.so
#12 0x00007fea6349640e in _GLOBAL__sub_I_Log.cpp () from /tmp/.mount_alien-iTvxcQ/usr/lib/libfilament.clawed.so
#13 0x00007fea65866afe in call_init () from /lib64/ld-linux-x86-64.so.2
#14 0x00007fea65866be4 in _dl_init () from /lib64/ld-linux-x86-64.so.2
#15 0x00007fea6560a0ed in _dl_catch_exception () from /lib64/libc.so.6
#16 0x00007fea6586ae0c in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#17 0x00007fea6560a090 in _dl_catch_exception () from /lib64/libc.so.6
#18 0x00007fea6586a63a in _dl_open () from /lib64/ld-linux-x86-64.so.2
#19 0x00007fea65813248 in dlopen_doit () from /lib64/libdl.so.2
#20 0x00007fea6560a090 in _dl_catch_exception () from /lib64/libc.so.6
#21 0x00007fea6560a14f in _dl_catch_error () from /lib64/libc.so.6
#22 0x00007fea65813989 in _dlerror_run () from /lib64/libdl.so.2
#23 0x00007fea658132d6 in dlopen () from /lib64/libdl.so.2
borodust commented 2 years ago

Backtrace is from Gentoo machine. It seems to work fine across different Manjaro machines though.

borodust commented 2 years ago

It also works on bare Linux Mint 19 Xfce on LiveUSB. Maybe this is related to processor architecture. Foundation libraries built against AVX instruction set and older processors could exhibit this behavior.

borodust commented 2 years ago

Also, one of the reason SIGILL is signalled - instruction is not recognized by CPU, which indirectly supports the theory about processor being too old.

borodust commented 2 years ago

I guess, at some point I need to decide whether AVX is really giving any performance boost. According to latest Steam Hardware Survey ~95% of gamer CPUs should support it. On the other hand, Filament requires OpenGL 4.1 anyway which is available in hardware since around the same time AVX made its hardware debut.

borodust commented 2 years ago

Apparently, there are more or less recent (~2017) CPU without AVX like Pentiums and Celerons, although looks like even those are getting AVX included as of late.