Alvaro-Kothe opened a new issue, #49640:
URL: https://github.com/apache/arrow/issues/49640

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   According to the Arrow [C++ environment variables 
documentation](https://arrow.apache.org/docs/cpp/env_vars.html#envvar-ARROW_USER_SIMD_LEVEL),
 the default SIMD level is SSE4.2. However, importing `pyarrow._compute` 
executes AVX instructions even when running on a CPU that only supports up to 
SSE4.2.
   
   ## Reproduction
   
   Setup venv and install pyarrow from PyPI:
   ```console
   $ python -m venv venv && venv/bin/pip install --no-cache pyarrow
   ... Successfully installed pyarrow-23.0.1
   ```
   
   Then run the Python interpreter under QEMU emulating a Westmere CPU (which 
supports SSE4.2 but not AVX):
   ```console
   $ qemu-x86_64-static -cpu Westmere venv/bin/python -c 'import 
pyarrow._compute'
   qemu: uncaught target signal 4 (Illegal instruction) - core dumped
   ```
   
   The disassembly of the coredump shows that it uses AVX instructions.
   
   ```gdb
   (gdb) disassemble $pc-16,$pc+16
   Dump of assembler code from 0x7f2ff65ceb32 to 0x7f2ff65ceb52:
      0x00007f2ff65ceb32:  push   r12
      0x00007f2ff65ceb34:  push   rbp
      0x00007f2ff65ceb35:  mov    rbp,rdi
      0x00007f2ff65ceb38:  push   rbx
      0x00007f2ff65ceb39:  sub    rsp,0x48
      0x00007f2ff65ceb3d:  call   0x7f2ff5c3c1d0
   => 0x00007f2ff65ceb42:  vmovdqu xmm0,XMMWORD PTR [rax]
      0x00007f2ff65ceb46:  vpextrq rax,xmm0,0x1
      0x00007f2ff65ceb4c:  vmovdqa XMMWORD PTR [rsp+0x10],xmm0
   ```
   
   Setting `ARROW_USER_SIMD_LEVEL` to `None` or `SSE4_2` didn't help.
   
   
   ### Component(s)
   
   Python


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to