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

Pass -mno-avx512f flag to disable AVX512 opcodes in debs #288

Draft
wants to merge 1 commit into
base: ros2
Choose a base branch
from

Conversation

cottsay
Copy link
Member

@cottsay cottsay commented Oct 10, 2023

It seems that when we build packages on Xeon systems which support the AVX512 extension, the corresponding opcode is used in the resulting binaries. This leads to SIGILL on platforms which don't support the extension, so we should explicitly disable it to maintain wide compatibility.

I verified that the flag was passed through to gcc by invoking the buildfarm locally using generate_release_script.

It seems that when we build packages on Xeon systems which support the
AVX512 extension, the corresponding opcode is used in the resulting
binaries. This leads to SIGILL on platforms which don't support the
extension, so we should explicitly disable it to maintain wide
compatibility.
@j-rivero
Copy link

If this is going to affect arm builds, we might have a problem:

arm-unknown-linux-gnueabihf-g++: error: unrecognized command-line option '-mno-avx512f'

https://godbolt.org/z/fEb9P1jKh

@cottsay
Copy link
Member Author

cottsay commented Oct 10, 2023

If this is going to affect arm builds, we might have a problem

Unlike ros-infrastructure/ros_buildfarm#1012, this approach is arch-specific. These build files are amd64-only (the arch is specified near the end of the file).

Copy link

@j-rivero j-rivero left a comment

Choose a reason for hiding this comment

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

Good to me. GCC/Clang on Focal/Jammy seems to support the option just fine.

Copy link

@claraberendsen claraberendsen left a comment

Choose a reason for hiding this comment

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

LGTM, as long as @clalancette approves. From my understanding from the previous discussion this is the best approach for an easy revert if necessary no?

@clalancette
Copy link

LGTM, as long as @clalancette approves. From my understanding from the previous discussion this is the best approach for an easy revert if necessary no?

I will point out that I thought our decision was to do nothing here. But given that this is easy to revert if it causes problems, we can go ahead with it.

@cottsay
Copy link
Member Author

cottsay commented Oct 11, 2023

I will point out that I thought our decision was to do nothing here.

You're right - I got excited trying to find the lowest-cost solution. Since I'll be away for a while, I'll leave this PR open but convert it to a draft. If you guys feel the need to move forward with it, it should be ready to merge and deploy.

Thanks everyone for the reviews.

@cottsay cottsay marked this pull request as draft October 11, 2023 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants