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

[staging-next] python3Packages.torch: fix build with gcc 12 #214887

Merged
merged 2 commits into from
Feb 6, 2023

Conversation

NickCao
Copy link
Member

@NickCao NickCao commented Feb 6, 2023

Description of changes
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@vcunat
Copy link
Member

vcunat commented Feb 6, 2023

@ofborg build python3.pkgs.torch
(I want to verify aarch64-linux, as the current older gcc won't accept all -W* flags.)

@vcunat
Copy link
Member

vcunat commented Feb 6, 2023

Uh, the x86_64-darwin failure is weird, as on Hydra it did built before this PR:
https://hydra.nixos.org/job/nixpkgs/staging-next/python310Packages.torch.x86_64-darwin

@NickCao
Copy link
Member Author

NickCao commented Feb 6, 2023

Both of the changes looks innocent, what do a few missing headers and warning flags have to do with AVX512 support?

@NickCao
Copy link
Member Author

NickCao commented Feb 6, 2023

@ofborg build python3.pkgs.torch

@NickCao
Copy link
Member Author

NickCao commented Feb 6, 2023

Apparently clang does not recognize these flags:

warning: unknown warning option '-Werror=maybe-uninitialized'; did you mean '-Werror=uninitialized'? [-Wunknown-warning-option]

It might be tripping over the AVX512 detection.

@vcunat
Copy link
Member

vcunat commented Feb 6, 2023

Yes, log from the failure:

Performing C SOURCE FILE Test NNPACK_ARCH_IS_X86_32 failed with the following output:
Change Dir: /tmp/nix-build-python3.10-torch-1.13.1.drv-1/source/build/CMakeFiles/CMakeScratch/TryCompile-01Emo4

Run Build Command(s):/nix/store/0p0rgsa68yywqndpz3hbxi5ra8z560ig-ninja-1.11.1/bin/ninja cmTC_3f1b0 && [1/2] Building C object CMakeFiles/cmTC_3f1b0.dir/src.c.o
FAILED: CMakeFiles/cmTC_3f1b0.dir/src.c.o 
/nix/store/hkj2pn7z2v6rl5ifp98w2dgmdg7c33v1-clang-wrapper-11.1.0/bin/clang -DNNPACK_ARCH_IS_X86_32  -std=gnu11 -MD -MT CMakeFiles/cmTC_3f1b0.dir/src.c.o -MF CMakeFiles/cmTC_3f1b0.dir/src.c.o.d -o CMakeFiles/cmTC_3f1b0.dir/src.c.o -c /tmp/nix-build-python3.10-torch-1.13.1.drv-1/source/build/CMakeFiles/CMakeScratch/TryCompile-01Emo4/src.c
warning: unknown warning option '-Werror=maybe-uninitialized'; did you mean '-Werror=uninitialized'? [-Wunknown-warning-option]
/tmp/nix-build-python3.10-torch-1.13.1.drv-1/source/build/CMakeFiles/CMakeScratch/TryCompile-01Emo4/src.c:3:10: error: AVX only on x86_64
        #error AVX only on x86_64
         ^
1 warning and 1 error generated.

@NickCao
Copy link
Member Author

NickCao commented Feb 6, 2023

I hate the timeouts...

@vcunat vcunat merged commit 47f15f5 into NixOS:staging-next Feb 6, 2023
@vcunat
Copy link
Member

vcunat commented Feb 6, 2023

I believe we have good enough verification, given the diff, target branch, etc.

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.

2 participants