Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jan 26, 2024

Conversation

brechtvl
Copy link
Contributor

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.

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.

Signed-off-by: Brecht Van Lommel <brecht@blender.org>
@brechtvl
Copy link
Contributor Author

CC @markreidvfx

@doug-walker
Copy link
Collaborator

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

@brechtvl
Copy link
Contributor Author

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
Copy link
Collaborator

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

Copy link
Contributor

@markreidvfx markreidvfx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! That must have been tricky to track down. I think we also need to check both bits of the Extended Control Register register too.

src/OpenColorIO/CPUInfo.cpp Outdated Show resolved Hide resolved
Signed-off-by: Brecht Van Lommel <brecht@blender.org>
Copy link
Contributor

@markreidvfx markreidvfx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We will probably want to backport this to 2.3.

Copy link
Collaborator

@doug-walker doug-walker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @brechtvl for this fix! My goal is to accelerate a 2.3.2 release due to this.

Copy link
Contributor

@KelSolaar KelSolaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! (Nasty one!)

@doug-walker doug-walker merged commit 0c90ded into AcademySoftwareFoundation:main Jan 26, 2024
23 checks passed
@doug-walker
Copy link
Collaborator

@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.

doug-walker pushed a commit to autodesk-forks/OpenColorIO that referenced this pull request Jan 29, 2024
…twareFoundation#1935)

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

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.

Signed-off-by: Brecht Van Lommel <brecht@blender.org>

* Fix another case pointed out in review

Signed-off-by: Brecht Van Lommel <brecht@blender.org>

---------

Signed-off-by: Brecht Van Lommel <brecht@blender.org>
(cherry picked from commit 0c90ded)
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
doug-walker added a commit that referenced this pull request Jan 30, 2024
* Fix ssse3 detection typo (#1929)

Signed-off-by: Mark Reid <mindmark@gmail.com>
(cherry picked from commit 003b6a1)
Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* fix: use system `include pystring.h` for `ConfigUtils.cpp` (#1921)

Signed-off-by: Rui Chen <rui@chenrui.dev>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit e747e9c)
Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Fix narrowing conversion error on riscv64 (#1924)

Signed-off-by: phancb <nxhsdu@qq.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit a95febc)
Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Add manylinux_2_28 Python wheels (#1933)

Signed-off-by: Rémi Achard <remiachard@gmail.com>
Co-authored-by: Michael Dolan <michdolan@gmail.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit f925099)
Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Enhance ociochecklut to print the output after each step in a multi-t… (#1925)

* Enhance ociochecklut to print the output after each step in a multi-transform LUT

Signed-off-by: pylee <penne.y.lee@intel.com>

* Review feedback to enable printe of transforms list when using -s flag.

Signed-off-by: pylee <penne.y.lee@intel.com>

* Print transform description for each step instead.

Signed-off-by: pylee <penne.y.lee@intel.com>

---------

Signed-off-by: pylee <penne.y.lee@intel.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit aadf595)
Signed-off-by: Doug Walker <doug.walker@autodesk.com>

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

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

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.

Signed-off-by: Brecht Van Lommel <brecht@blender.org>

* Fix another case pointed out in review

Signed-off-by: Brecht Van Lommel <brecht@blender.org>

---------

Signed-off-by: Brecht Van Lommel <brecht@blender.org>
(cherry picked from commit 0c90ded)
Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Increment library version to 2.3.2

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

---------

Signed-off-by: Mark Reid <mindmark@gmail.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Rui Chen <rui@chenrui.dev>
Signed-off-by: phancb <nxhsdu@qq.com>
Signed-off-by: Rémi Achard <remiachard@gmail.com>
Signed-off-by: pylee <penne.y.lee@intel.com>
Signed-off-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Mark Reid <mindmark@gmail.com>
Co-authored-by: Rui Chen <rui@chenrui.dev>
Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
Co-authored-by: Rémi Achard <remiachard@gmail.com>
Co-authored-by: Michael Dolan <michdolan@gmail.com>
Co-authored-by: PenneLee <penne.y.lee@intel.com>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants