Package Base Details: libjxl-git

Git Clone URL: https://aur.archlinux.org/libjxl-git.git (read-only, click to copy)
Keywords: jpeg-xl
Submitter: dbermond
Maintainer: dbermond
Last Packager: dbermond
Votes: 14
Popularity: 0.000039
First Submitted: 2021-06-02 18:30 (UTC)
Last Updated: 2024-03-01 15:40 (UTC)

Latest Comments

« First ‹ Previous 1 .. 7 8 9 10 11 12 13 Next › Last »

dbermond commented on 2020-03-10 17:03 (UTC)

@RubenKelevra Yes, I think that a package with optimized instructions would be nice in this case. I may create one.

Upstream should allow compilation on older non-sse4 cpus and check for instruction support at runtime, but it looks like that it's not the case. Maybe you can request this to them. Since upstream explicitly states that it requires sse4, I take this with no surprise.

RubenKelevra commented on 2020-03-10 16:18 (UTC)

@dbermond

I'm not able to build libjpeg-xl-git r3.g0709f3a-3 on my machine without AVX2/SSE4:

CMake Error at /usr/share/cmake-3.16/Modules/GoogleTestAddTests.cmake:40 (message):
  Error running test executable.

    Path: '/home/ruben/.cache/yay/libjpeg-xl-git/src/build/tests/quantizer_test'
    Result: Illegal instruction
    Output:

RubenKelevra commented on 2020-03-03 13:14 (UTC)

Okay, the build scripts of software do very regularly exactly this. So I thought it would fit a prepare script as well.

In this case:

How about a copy of this package with avx2 enabled? :)

dbermond commented on 2020-03-03 01:50 (UTC)

@RubenKelevra I've fixed the avx2 patch, so that the package now builds when using the default generic architecture. Thanks for reporting this.

Still requires sse4 at runtime of course.

dbermond commented on 2020-03-03 01:28 (UTC)

@RubenKelevra There is no auto switch, as it should not be this way. Users wanting avx2 support should manually disable the corresponding patch on the PKGBUILD.

PKGBUILDs are not supposed to be like the way you suggested. There should not be exit calls based on hardware, and neither automatic patch file deletion.

RubenKelevra commented on 2020-03-02 20:58 (UTC)

You could just add something like this to your prepare script, to avoid even trying to compile the package with a CPU not able to handle sse4.

And to readd avx2 support dynamically if the CPU supports it.

if [ "$(cat /proc/cpuinfo | grep -E "^flags" | grep -e "sse4_2" | wc -l)" -eq 0 ]; then
    echo "this package requires SSE4 to work"
    exit 1
elif [  "$(cat /proc/cpuinfo | grep -E "^flags" | grep -e "avx2" | wc -l)" -gt 0 ];
    # avx2 detected, remove patch 
    rm '040-libjpeg-xl-git-disable-avx2-avx512.patch'
fi

RubenKelevra commented on 2020-03-02 20:47 (UTC) (edited on 2020-03-02 20:48 (UTC) by RubenKelevra)

Alright, I figured out what's going wrong on the second machine (which got AVX2).

The machine has the default arch settings for c/cpp compiler for the target set, which is just -march=x86_64 and -mtune=generic.

This package requires that -march is set to native and -mtune can be deleted.

This obviously makes more sense on package level, where you would need to overwrite the CFLAGS/CXXFLAGS accordingly.

RubenKelevra commented on 2020-03-02 19:35 (UTC)

@dbermond thanks!

SSE4 is extremely common in processors deployed in the field, but avx2 is not, since many SSE4 processors have still not reached their end of service life to be replaced by something new.

Is the switch dynamic? (Haven't looked at the pkgbuild) since avx2 capable processors should be able to use avx2, since it makes a huge difference.

dbermond commented on 2020-03-02 01:15 (UTC)

@RubenKelevra Thanks for appreciating this package. Regarding the errors, I cannot reproduce them. Package is building fine for me.

I've disabled avx2 support and it should now work in older cpus. Please note that upstream states that it needs the sse4 instruction set, so this will not run in a generic x86_64 cpu which lacks sse4.

RubenKelevra commented on 2020-02-26 19:55 (UTC)

I tried it on a different machine, which got an older processor. Looks like this processor isn't supported :/

https://pastebin.com/4UqWGh3B

Is there a chance that you add the ability to select at build time if the CPU can run AVX2 and patch the file according to documentation?

CPU requirements
When running on Intel/AMD CPUs the software currently requires AVX2 support
(introduced by Intel in 2013 and AMD in 2015). If not supported by the CPU or
VM, the software will print "CPU does not support all enabled targets =>
exiting". You can either run on a more recent CPU/VM, or instruct the software
to only use/require SSE4 by uncommenting the line near the bottom of
third_party/highway/hwy/target.h:
// #define HWY_DISABLE_AVX2