-
Notifications
You must be signed in to change notification settings - Fork 8
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
packages/libnvidia-container-custom: init #1089
base: main
Are you sure you want to change the base?
Conversation
b11f561
to
d3cec84
Compare
This adds a custom implementation of libnvidia-container that can resolve binaries (like `nvidia-smi`) correctly on NixOS. This needs to know the location of the binaries. Unfortunately, it is not possible to supply the package build with the correct paths from the Nix store, as the binaries are built in the driver package, which is specific to the host (i.e. the kernel), and thus is only known in the NixOS build, where we already need to have the package, creating a circular dependency. This adds a vendored version of said package with a workaoround that consist of just having it search in the NixOS PATH (i.e. `/run/current-system/sw`), which is fine, since we only use this package in NixOS-scenarios, but can't be upstreamed since it's incompatible with other distributions.
Make `libnvidia-container-custom` the default `libnvidia-container` in our NixOS build.
d3cec84
to
b1e2cff
Compare
From 8799541f99785d2bd881561386676fb0985e939e Mon Sep 17 00:00:00 2001 | ||
From: Moritz Sanft <[email protected]> | ||
Date: Thu, 10 Oct 2024 14:32:42 +0200 | ||
Subject: [PATCH] fix library resolving |
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.
I don't understand why this needs to be fixed in C code. Can't we just symlink the required binaries from an FHS directory?
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.
Looking at this again, we should be able to get rid from this patch if we patch the PATH
of the OCI hook that calls nvidia-container-cli
. I will check that.
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.
We should be able to drop it if we can get rid of this line upstream and use PATH
instead.
This adds a custom implementation of libnvidia-container that can resolve binaries (like
nvidia-smi
) correctly on NixOS. This needs to know the location of the binaries. Unfortunately, it is not possible to supply the package build with the correct paths from the Nix store, as the binaries are built in the driver package, which is specific to the host (i.e. the kernel), and thus is only known in the NixOS build, where we already need to have the package, creating a circular dependency. This adds a vendored version of said package with a workaoround that consist of just having it search in the NixOS PATH (i.e./run/current-system/sw
), which is fine, since we only use this package in NixOS-scenarios, but can't be upstreamed since it's incompatible with other distributions.