-
Notifications
You must be signed in to change notification settings - Fork 251
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
Building libjxl dependency Highway 0.14.0 halfway results in "Error running executable: Illegal instruction" #408
Comments
Hi @kylxbn , thanks for this extensive report :) gtest does indeed run tests during the build to "discover" what tests it should run. I think the libjxl version is less important than which version of Highway we are using. 0.14.0 should have support for SSSE3, which your CPU supports. To debug this, we can watch for build output like: If we're not getting to that point because the Highway tests are failing first, we can set the |
Thank you very much for your assistance regarding this matter! I tried building Highway again, and I was able to see such an output!
Oops! It looks like AVX2/AVX3 is indeed being used, but unfortunately, my CPU looks like it does not support it! In that case, I guess disabling the tests would be useless, since Highway itself is built with AVX support and so, would probably just crash once libjxl uses it? I will be very willing to provide more information regarding this issue if needed! It might be hard to find such an old CPU like this, anyway :D |
@kylxbn thank you for sharing the output! Can you help gather more information by running gdb highway_test? (that is the one that failed in your initial report, so it was built, but you can also use other tests if they were built in your second build attempt) It would be helpful to know which instruction is failing (r to run, then disassemble /m 0x1234, where the latter is the address of the crash), and hopefully also a stack trace to show how we got there (bt full). |
Sure! I have some learning to do (I know what GDB, disassembly, stack traces, etc. are, but I have never used GDB before so this will be a new experience :P ) I'll get back as soon as I have the data to report! Thank you very much for being patient with me! I sincerely appreciate it. |
I think this may be a manifestation of google/highway#318 - we had two "enums" mistakenly set to the same value. I am changing it to an enum class to prevent such errors. |
I tried to build google/highway again using the latest master branch and I am sorry to inform that the same error still persists. I tried to run the test executable with GDB but unfortunately, it seems that cmake (or the build system) deletes the executable after building because it is failing:
with the significant line being
By the way, this is in no way hurrying people or anything! Just asking for guidance. Just thought I'd try to be helpful in any way I can. Again, thank you very much for your patience regarding this issue! |
I've got the same issue building the main branch on Debian using "ci.sh", the file wasn't deleted, gdb says
|
@kylxbn thank you for checking this again! hm, that's surprising. We do have a new tool to help diagnose this. Can you share the three lines in the build output starting with "Compiled HWY_TARGETS:"? @error256 Thanks for letting us know. The issue appears to be that your CPU does not support rdtscp. I believe that is supported since Intel Nehalem. Out of curiosity, are you running AMD or something else? |
… thanks @error256 PiperOrigin-RevId: 394184820
… thanks @error256 PiperOrigin-RevId: 394184820
… thanks @error256 PiperOrigin-RevId: 394187316
An old Pentium D, it's more than enough for most tasks, so I still use it sometimes, but usually not for anything like building libraries, I just happened to. |
@error256 got it, thanks for sharing :) |
Hello! Thank you for your assistance. I tried compiling the latest Git again, but I’m not sure if it even reaches the point that all |
But I did try going into the source directory and running
The complete output is available here. I had to interrupt the build because it’s using up all 4GB of my RAM and it’s causing my system to run on swap. I’d try again later, though! |
FWIW I also experience this error when building 0.5 on a virtualized macos 10.15. Though not on bare hardware - guessing the virtualized cpu confuses the detection. |
Any update on this? |
If there's still an issue, please re-open on their github. |
Hello. Hopefully I'm doing this right.
Describe the bug
I am trying to build libjxl (0.5) from the Arch Linux User Repository (AUR) and halfway while building its dependency Highway (0.14.0) from the AUR also , I get this error when I am using the GCC:
When I try using the clang compiler, I get this:
This has been happening since libjxl 0.3.x days (not sure if even older versions are affected, since I only tried compiling 0.3.x), and I was thinking that it was just that my CPU is really old (since it doesn't support SSE 4.2). But I guess I better ask for confirmation regarding this, too.
To Reproduce
I have Paru as my AUR helper, and just trying to install libjxl with it will trigger the error.
It seems to be failing while building the test binaries for Highway. I'm not really familiar with how Highway works, but it looks like it will build test executables, then try to execute it. However, maybe because of that missing SSE 4.2 support on my CPU, some inline assembly code fails to run, resulting in that "Illegal instruction" error and the build failing.
Expected behavior
I was hoping that an Illegal instruction error would not occur.
Environment
fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl cpuid aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm pti tpr_shadow vnmi flexpriority vpid dtherm ida
Compile flags:
Additional context
This is an old laptop and it probably does not support SSE 4.2. While using SIMD instructions is cool and all, maybe a fallback to good old x86_64 ISA would be good if the CPU does not support SIMD? I'm honestly not even sure if the compiler can detect it and if it can be done with stuff like preprocessor commands, but... Just a suggestion? I'm honestly not that familiar with C++.
This was how the build files were generated when I am using GCC
and this is for clang:
Hopefully this is useful! Please tell me if I can provide any more details and I would happily help.
The text was updated successfully, but these errors were encountered: