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

Add patch to make SIMD instructions optional at runtime on Windows #93

Merged
merged 3 commits into from
Apr 8, 2023

Conversation

ryanvolz
Copy link
Contributor

@ryanvolz ryanvolz commented Apr 6, 2023

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • [ ] Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

Over at @conda-forge/gnuradio, I've been receiving reports for a little while from Windows users who experienced crashes whenever an FFT provided by the fftw library was required. At first I thought it was because the builds had AVX support enabled but not SSE2, resulting in my prior PR to fix that. But the reports of crashes have continued, and I think I finally have the issue fixed now with this PR.

Basically, with CMake, enabling SSE2/AVX support would cause the entire library to be built with those SIMD flags, resulting in SIMD instructions being inserted in the library and not gated by the check for whether the runtime CPU supported them. So users without AVX support were seeing crashes because the library hard required AVX instructions. The fix is to patch CMakeLists.txt so that enabled SIMD flags are only applied to the specific files that are intended to use them, which is exactly what is done with configure/make.

I've put in a PR upstream to get the patch incorporated there, but I'm sure my suffering users would love a fixed conda-forge package in the meantime. I've tested this with a locally rebuilt package and the crash does indeed disappear (running in a Windows VM and using the Intel Software Development Emulator to disable AVX instructions), and I've asked for users with actual hardware to test as well.

Because the CMake build was inadvertently lacking the intended feature,
previously enabling SIMD instructions like SSE and AVX would require
that those instructions always be present at runtime on Windows. This
patch makes the compiler use those flags only on the appropriate source
files so that the instructions are optional at runtime as intended.
@conda-forge-webservices
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@ryanvolz
Copy link
Contributor Author

ryanvolz commented Apr 7, 2023

FYI, the upstream PR has been merged.

@jschueller jschueller merged commit 43dcbd8 into conda-forge:main Apr 8, 2023
@ryanvolz ryanvolz deleted the windows_fix branch April 12, 2023 15:50
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.

2 participants