Package Base Details: libjpeg-xl-git

Git Clone URL: (read-only, click to copy)
Keywords: jpegxl jxl libjpegxl
Submitter: dbermond
Maintainer: dbermond
Last Packager: dbermond
Votes: 5
Popularity: 0.71
First Submitted: 2020-02-01 14:20
Last Updated: 2021-02-07 15:29

Latest Comments

« First ‹ Previous 1 2 3 4 5

dbermond commented on 2020-03-03 01:28

@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

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'

RubenKelevra commented on 2020-03-02 20:47

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

@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

@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

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

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
// #define HWY_DISABLE_AVX2

RubenKelevra commented on 2020-02-26 16:50

Thanks for this package!

Tried to compile it and run into an error: