AcademySoftwareFoundation / OpenColorIO

A color management framework for visual effects and animation.
https://opencolorio.org
BSD 3-Clause "New" or "Revised" License
1.78k stars 452 forks source link

Fix AVX instructions used on CPUs that don't support them #1935

Closed brechtvl closed 8 months ago

brechtvl commented 8 months ago

It's supposed to check all bits are enabled, not just one of them. This causes a crash using OpenColorIO on older CPUs.

Thanks to Ray Molenkamp for help tracking this down.

brechtvl commented 8 months ago

CC @markreidvfx

doug-walker commented 8 months ago

Thank you for the fix @brechtvl ! Do you have any more information about specifically which CPUs are affected?

brechtvl commented 8 months ago

This was based on a bug report from a user, we haven't heard back from them yet to know the exact CPU model. But it was a relatively old one that support instructions only up to SSE 4.1.

Still it's the AVX check that fails. So it wouldn't be surprising if CPUs that support up to SSE 4.2 are affected too, and that's the current minimum requirement for Blender, Maya and Houdini.

But I don't know the exact conditions for when that XSAVE bit is enabled while the AVX bit is not.

doug-walker commented 8 months ago

Linking this Blender issue, which seems to be the original report, for reference.

doug-walker commented 8 months ago

@brechtvl , we noticed that Ray Molenkamp posted an OCIO_CPUINFO.exe in the Blender forum as a way of troubleshooting this. If you or he would like to contribute that to OCIO (e.g., under src/apps or share/troubleshooting), we would welcome that.