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

libnvidia-container: fix cross-compilation for aarch64-linux #372148

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

avnik
Copy link
Contributor

@avnik avnik commented Jan 8, 2025

Fix cross-compilation issues on aarch64-linux

Note: I didn't test resulting binaries on x86, because haven't nvidia in my x86_64 box
(probably need more testing on aarch64 Tegra as well)

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 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
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Jan 8, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Jan 8, 2025
@nix-owners nix-owners bot requested review from msanft and cpcloud January 8, 2025 14:20
@avnik avnik force-pushed the avnik/libnvidia-container-cross branch from cf3ee00 to 8763cdb Compare January 8, 2025 14:23
@msanft
Copy link
Contributor

msanft commented Jan 8, 2025

Will give this a spin on my x86 box tomorrow! Thanks for the patch. Diff LGTM so far, but I'd still want to test it.

@msanft
Copy link
Contributor

msanft commented Jan 9, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 372148


x86_64-linux

✅ 10 packages built:
  • apptainer
  • apptainer-overriden-nixos
  • libnvidia-container
  • nvidia-container-toolkit
  • nvidia-container-toolkit.tools
  • nvidia-docker
  • singularity
  • singularity-overriden-nixos
  • udocker
  • udocker.dist

Copy link
Contributor

@msanft msanft left a comment

Choose a reason for hiding this comment

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

Works! Discovered #372320 in the process of testing, but this is unrelated to this PR.

@philiptaron philiptaron requested a review from a team January 9, 2025 16:15
@wegank wegank added 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package labels Jan 9, 2025
@avnik avnik force-pushed the avnik/libnvidia-container-cross branch from 8763cdb to a5fef0d Compare January 10, 2025 16:17
@avnik
Copy link
Contributor Author

avnik commented Jan 10, 2025

@msanft applied @Mic92 suggestion as well

@Mic92
Copy link
Member

Mic92 commented Jan 10, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 372148


x86_64-linux

✅ 10 packages built:
  • apptainer
  • apptainer-overriden-nixos
  • libnvidia-container
  • nvidia-container-toolkit
  • nvidia-container-toolkit.tools
  • nvidia-docker
  • singularity
  • singularity-overriden-nixos
  • udocker
  • udocker.dist

@Mic92 Mic92 merged commit af58415 into NixOS:master Jan 10, 2025
22 checks passed
@msanft
Copy link
Contributor

msanft commented Jan 20, 2025

I discovered now that this patch causes some dangling library symlinks in the output. Non-critical, but will fix.

It's specifically the below lines causing it:

substituteInPlace mk/common.mk \
  --replace-fail objcopy '$(OBJCOPY)' \
  --replace-fail ldconfig true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different platform than they will be used on 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants