docker build implicitly assumes CPU features that I don't have

asked 2025-08-26 16:54:07 +0200

thome gravatar image

Hi

I've been using sagemath with the docker image for quite a few years on a collection of x86_64 lab machines. It worked well until 10.6, even on old machines ("old" means 10 years old and more).

With the sagemath/sagemath:10.7 image (sha256:cff1baec214e7893efeb750f0b827ab24228002554a02ee0f7804936aab3323f), I'm no longer able to use sagemath on some of my older machines. A trivial reproducer is:

sage: GF(1009)['x'].gen()**17

which triggers a SIGILL (see also cado-nfs issue #30126, where I give more details)

Those machines happen to miss the adx CPU feature (adcx and addx CPU insns). It so happens that the build of the sagemath/sagemath:10.7 docker image did indeed include these instructions, so chaos is pretty much unavoidable. Such wasn't the case with 10.6:

localhost ~ $ docker run sagemath/sagemath:10.6 grep -i adx /home/sage/sage/local/include/flint/flint-config.h
/* Define if system has the ADX instruction set */
/* #undef FLINT_HAVE_ADX */
localhost ~ $ docker run sagemath/sagemath:10.7 grep -i adx /home/sage/sage/local/include/flint/flint-config.h
/* Define if x86_64 ADX assembly is available */
#define FLINT_HAVE_ASSEMBLY_x86_64_adx 1

I see that similar problems have appeared in the past, see e.g. sagemath issue #33863. So maybe it's this same old story that SAGE_FAT_BINARY doesn't really work, and we all depend on the specifics of the builder machine.

Does anyone know what exactly has changed between 10.6 and 10.7 that could explain this regression?

Do I have any option beyond building from source on these 10+-year-old machines?

edit retag flag offensive close merge delete

Comments

See https://hub.docker.com/r/sagemath/sag... for possible better channels where to report this issue.

rburing gravatar imagerburing ( 2025-08-27 11:28:01 +0200 )edit