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

openblas: apply patch to prevent SIGILL on aarch64 #117004

Conversation

mschwaig
Copy link
Member

The applied patch contains the changes from this PR:
OpenMathLib/OpenBLAS#3060

This patch prevents gcc from reordering instructions in a way
that can cause crashes with SIGILL on aarch64.

This issue crashes python when importing numpy on aarch64:
numpy/numpy#18131

Motivation for this change

Without this python -c "import numpy" crashes with SIGILL on aarch64.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@r-rmcgibbo
Copy link

r-rmcgibbo commented Mar 20, 2021

Result of nixpkgs-review pr 117004 at ccf5c6c2 run on aarch64-linux 1

192 packages marked as broken and skipped:
  • bareos
  • blastem
  • bonfire
  • cassandra_2_1
  • cassandra_2_2
  • clmagma
  • coq_8_5
  • coq_8_6
  • deeptools
  • forge
  • ...
4 packages failed to build (new failures):
2390 packages skipped due to time constraints:
  • MIDIVisualizer
  • R
  • abcl
  • actdiag (python38Packages.actdiag)
  • adapta-gtk-theme
  • adoptopenjdk-icedtea-web
  • aiodnsbrute
  • alloy (alloy5)
  • alloy4
  • almanah
  • ...
122 packages built successfully:

Result of nixpkgs-review pr 117004 at ccf5c6c2 run on x86_64-linux 1

144 packages marked as broken and skipped:
  • bareos
  • bonfire
  • cassandra_2_1
  • cassandra_2_2
  • fractal
  • gimpPlugins.exposureBlend
  • gimpPlugins.texturize
  • glimpsePlugins.exposureBlend
  • glimpsePlugins.texturize
  • gnome-podcasts
  • ...
2692 packages skipped due to time constraints:
  • MIDIVisualizer
  • R
  • abcl
  • actdiag (python38Packages.actdiag)
  • adapta-gtk-theme
  • adoptopenjdk-icedtea-web
  • aiodnsbrute
  • alloy (alloy5)
  • alloy4
  • almanah
  • ...
117 packages built successfully:

Copy link
Member

@veprbl veprbl left a comment

Choose a reason for hiding this comment

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

I would refer to patch by the commit hash

@SuperSandro2000
Copy link
Member

/rebase staging

mschwaig and others added 3 commits March 20, 2021 14:59
The applied patch contains the changes from this PR:
OpenMathLib/OpenBLAS#3060

This patch prevents gcc from reordering instructions in a way
that can cause crashes with SIGILL on aarch64.

This issue crashes python when importing numpy on aarch64:
numpy/numpy#18131
Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
@github-actions github-actions bot changed the base branch from master to staging March 20, 2021 14:59
@github-actions github-actions bot force-pushed the openblas-apply-patch-to-prevent-sigill-on-aarch64 branch from 7d472d8 to 0226220 Compare March 20, 2021 14:59
@github-actions github-actions bot closed this Mar 20, 2021
@github-actions
Copy link
Contributor

Rebased, please reopen the pull request to restart CI

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

Just curious: why does the output contain an empty bin directory?


This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 117004 run on x86_64-linux 1

1 package built:
  • openblas

Copy link
Member

@veprbl veprbl left a comment

Choose a reason for hiding this comment

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

LGTM

@mschwaig
Copy link
Member Author

Just curious: why does the output contain an empty bin directory?

I don't know. It's there on both x86_64-linux and aarch64-linux but I did not figure out how it is created.

@veprbl veprbl merged commit de2c3e0 into NixOS:staging Mar 21, 2021
mschwaig added a commit to mschwaig/tensorflow-hello-world-nix-flake that referenced this pull request Apr 16, 2021
The updated version of nixpkgs includes
NixOS/nixpkgs#117004
so that TensorFlow should now work with the
openblas version from nixpkgs on aarch64 as well.
@mschwaig mschwaig deleted the openblas-apply-patch-to-prevent-sigill-on-aarch64 branch March 23, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants