-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
cudaPackages: add jetson support #242050
cudaPackages: add jetson support #242050
Conversation
Result of |
1c84b91
to
3f5805d
Compare
@SomeoneSerge I ended up adding support for multiple arch in a PR I have brewing: #240498 As you’ve noticed, it’s a bit of trouble currently to figure out whether to choose the Linux4Tegra or SBSA packages for aarch64. Is there a different double we have for Jetson specifically? |
pkgs/development/compilers/cudatoolkit/redist/build-cuda-redist-package.nix
Outdated
Show resolved
Hide resolved
@ConnorBaker, I'm still unsure what exactly the sbsa builds are for, but I do know that the builds marked linux-aarch64 are meant for jetsons, which is why in this PR I give those the priority RE: #240498 Great! I guess the question is how long is it going to take you to merge that PR v. merge this and rebase yours? I tried to limit mine to enabling jetson support specifically with the purpose of avoiding collisions, but I guess it's not that simple 🙃 |
@SomeoneSerge I definitely need to take out the multi-arch stuff from that PR; it's a can of worms. Here's a summary of what I've learned: Both the Linux 4 Tegra (Jetson devices, NVIDIA redist manifests refer to this as That means if we want to support both, we need to:
For the first point: Unlike other GPUs which can be slotted into both x86_64 or SBSA (ARM) servers, Jetson capabilities are tied to For the second point: we must know whether we are building for Jetson so we can correctly decide whether to use the |
Oh, I see. So we might want to
Is it that we need this, or is it something "nice to have"?
I think I finally get it, thanks! SBSA binaries are for when we wire a pci-e gpu to a generic aarch64 host? |
If we continue to use only a single
If we introduce a
Yes -- apparently SBSA is the name of a specification for ARM-based servers https://en.wikipedia.org/wiki/Server_Base_System_Architecture. |
I pushed an example in the last commit: the idea would be just to override
Instead of a hard-coded list, we could form one from Jetson device owners may overlay their nixpkgs with What's maybe embarrassing is that Alternatively,we could introduce a |
Take a look at the changes I made to
Overall, those changes allow us to build the user-requested Jetson capabilities. (They must be requested by the user through |
"8.7" | ||
]; | ||
}; | ||
manifestAttribute = "linux-aarch64"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would hinder future attempts at cross-compilation:
❯ nix eval -f cross-jetson.nix cudaPackages.cuda_nvcc.manifestAttribute
"linux-aarch64"
❯ nix eval -f cross-jetson.nix buildPackages.cudaPackages.cuda_nvcc.manifestAttribute
"linux-aarch64"
Expected: "linux-aarch64", "linux-x86_64"
Consequence (watch out, I could be wrong about everything):
- We should always choose a tag (linux-x86_64, linux-aarch64, linux-sbsa) that is compatible with the current
hostPlatform.system
- For the CUDA libraries that come with PTX text (e.g. libcublas) we should choose, among host-compatible tags, one that ships all of the requested cuda capabilities. If there isn't one, we should mark the package broken. We should not mark nvcc as broken
# cross-jetson.nix
(import ./. {
config.allowUnfree = true;
config.cudaSupport = true;
config.cudaCapabilities = [ "7.2" ];
# config.cudaCapabilities = [ "8.6" ];
overlays = [ (final: prev: { cudaPackages = prev.cudaPackages_jetson; }) ];
}).pkgsCross.aarch64-multiplatfor
PoC: SomeoneSerge#4
b7685fd
to
679ad3d
Compare
Superseded by #256324 |
Description of changes
It's a pretty small patch recovering jetson support as originally attempted in #194791, hopefully can be merged without any extra effort once ofborg goes through. I successfully built
cuda_nvcc
on an nvidia jetson host. One prerequisite for getting more complex stuff to work (like pytorch) would be #233581CC #158350 @NixOS/cuda-maintainers
Things done
What doesn't work
Idk how to use cross, but I tried this on an x86-64 host and it failed:
It's a shot in the dark, but I think this might be related to #226165