!eWOErHSaiddIbsUNsJ:nixos.org

NixOS CUDA

326 Members
CUDA packages maintenance and support in nixpkgs | https://github.com/orgs/NixOS/projects/27/ | https://nixos.org/manual/nixpkgs/unstable/#cuda64 Servers

Load older messages


SenderMessageTime
2 Feb 2023
@ss:someonex.netSomeoneSerge (matrix works sometimes) For context, the piece was introduced in: https://github.com/NixOS/nixpkgs/pull/178397/
It used as a reference some of the extension.nix files from https://github.com/NixOS/nixpkgs/pull/167016
21:51:42
@ss:someonex.netSomeoneSerge (matrix works sometimes)I think you'd have to just edit them in your own fork... :(21:53:14
@realjhol:matrix.orgrealjholoh I see - ok21:53:27
@realjhol:matrix.orgrealjhol

well it mat not be pretty, buth this deos give me what I need:

          cudaPackages = pkgs.cudaPackages_11_4;

          tensorrt = cudaPackages.tensorrt.overrideAttrs (old: let
            fullVersion = "8.2.1.8";
            fileVersionCuda = "11.4";
            fileVersionCudnn = "8.2";
            sha256 = "sha256-PpqcxK0OWuY3MX2STc3fZjgfTbBOJXHw8ubtWipR8kc=";
          in rec {
            pname = "cudatoolkit-${cudaPackages.cudatoolkit.majorVersion}-tensorrt";
            version = fullVersion;
            src = pkgs.requireFile rec {
              name = "TensorRT-${fullVersion}.Linux.x86_64-gnu.cuda-${fileVersionCuda}.cudnn${fileVersionCudnn}.tar.gz";
              inherit sha256;
              message = ''
                To use the TensorRT derivation, you must join the NVIDIA Developer Program and
                download the ${version} Linux x86_64 TAR package for CUDA ${cudaPackages.cudaVersion} from
                ${old.meta.homepage}.

                Once you have downloaded the file, add it to the store with the following
                command, and try building this derivation again.

                $ nix-store --add-fixed sha256 ${name}
              '';
            };

            sourceRoot = "TensorRT-${version}";

            # Tell autoPatchelf about runtime dependencies.
            # (postFixup phase is run before autoPatchelfHook.)
            postFixup =
              let
                mostOfVersion = builtins.concatStringsSep "."
                  (pkgs.lib.take 3 (pkgs.lib.versions.splitVersion version));
              in
              ''
                echo 'Patching RPATH of libnvinfer libs'
                patchelf --debug --add-needed libnvinfer.so \
                  "$out/lib/libnvinfer.so.${mostOfVersion}" \
                  "$out/lib/libnvinfer_plugin.so.${mostOfVersion}" \
                  "$out/lib/libnvinfer_builder_resource.so.${mostOfVersion}"
              '';
          });

22:54:36
@realjhol:matrix.orgrealjhol it would be nice if cudaPackages.tensorrt had an override method so that I could override the version values without having to reimplement half of the derrivation 22:55:27
@ss:someonex.netSomeoneSerge (matrix works sometimes) If you're going to use nixpkgs packages that rely on tensorrt, you might also want to re-evaluate cudaPackages in an overlay to make sure they all use your version of tensorrt 22:57:14
@realjhol:matrix.orgrealjholhmm -- ok that makes sense22:57:57
@ss:someonex.netSomeoneSerge (matrix works sometimes) There's an example in the manual, cf. the overrideScope' bit https://nixos.org/manual/nixpkgs/unstable/#cuda 22:58:51
@realjhol:matrix.orgrealjholthanks! - I'm out of time for today, but I'll take a look tomorrow22:59:28
@ss:someonex.netSomeoneSerge (matrix works sometimes)Cheers!22:59:43
6 Feb 2023
@tpw_rules:matrix.orgtpw_rulesignore this, just trying to get an unread notification to go away...18:11:06
@hexa:lossy.networkhexaleft the threads beta, because unread notifications were driving me nuts19:43:58
@ss:someonex.netSomeoneSerge (matrix works sometimes)does this message show up as a simple reply now?19:44:47
@hexa:lossy.networkhexayes, it does19:44:54
@tpw_rules:matrix.orgtpw_rulesoh please tell me how to do that20:44:06
7 Feb 2023
@hexa:lossy.networkhexahttps://github.com/NixOS/nixpkgs/pull/21509117:32:46
8 Feb 2023
@hexa:lossy.networkhexa
In reply to @tpw_rules:matrix.org
oh please tell me how to do that
in element labs settings there is a big leave button 😄
11:55:20
9 Feb 2023
@connorbaker:matrix.orgconnor (he/him) joined the room.17:34:22
@ss:someonex.netSomeoneSerge (matrix works sometimes)

A recurring theme really: webkitgtk, plasma-desktop, &c &c depend on gst-plugins-bad, which depends on opencv, which depends on config.cudaSupport. Toggling config.cudaSupport -> rebuilding gst-plugins-bad -> rebuilding webkitgtk, and all of these rebuilds are false-positives in the sense, that just rewriting runpaths in gst-plugins-bad to point at the new (cuda-enabled) opencv would have probably worked just fine

https://matrix.to/#/!KqkRjyTEzAGRiZFBYT:nixos.org/$g1YvCdKTL93lLBfdCAs7VrHKtBzWEmgHvztNbbog0MU?via=nixos.org&via=matrix.org&via=tchncs.de

17:36:51
10 Feb 2023
@jovulic:matrix.orgjv joined the room.12:52:42
@jovulic:matrix.orgjv left the room.12:55:06
@ss:someonex.netSomeoneSerge (matrix works sometimes)https://youtu.be/H3AQnlpxk0c?t=5723:13:41
@ss:someonex.netSomeoneSerge (matrix works sometimes)Note https://github.com/NixOS/nixpkgs/pull/21557823:15:51
11 Feb 2023
@jovulic:matrix.orgjv joined the room.05:30:10
@jovulic:matrix.orgjvHey, uhm, would this be the place I would talk about getting an nvidia gpu functional within a container?05:43:14
@FRidh:matrix.orgFRidh
In reply to @ss:someonex.net

A recurring theme really: webkitgtk, plasma-desktop, &c &c depend on gst-plugins-bad, which depends on opencv, which depends on config.cudaSupport. Toggling config.cudaSupport -> rebuilding gst-plugins-bad -> rebuilding webkitgtk, and all of these rebuilds are false-positives in the sense, that just rewriting runpaths in gst-plugins-bad to point at the new (cuda-enabled) opencv would have probably worked just fine

https://matrix.to/#/!KqkRjyTEzAGRiZFBYT:nixos.org/$g1YvCdKTL93lLBfdCAs7VrHKtBzWEmgHvztNbbog0MU?via=nixos.org&via=matrix.org&via=tchncs.de

The curse of purity
10:18:30
@jovulic:matrix.orgjv... and I managed to stumble my way through it. Just if anyone else finds themselves in the situation trying to get nvidia-container-runtime working with conatinerd -- running into "UNKNOWN" errors whenever invoking commands within the container. The additional trick, outside of getting nvidia working on the host, and the containerd configuration from the guides, is to leverage the mkNvidiaContainerPkg derivation in nixpkgs, taking after nvidia-podman but importantly remembering to comment out the no-cgroups setting. 12:31:42
@jovulic:matrix.orgjv * ... and I managed to stumble my way through it. Just if anyone else finds themselves in the situation trying to get nvidia-container-runtime working with conatinerd -- running into "UNKNOWN" errors whenever invoking commands within the container. The additional trick, outside of getting nvidia working on the host, and the containerd configuration from the guides, is to leverage the mkNvidiaContainerPkg derivation in nixpkgs, taking after nvidia-podman but importantly remembering to comment out the no-cgroups setting. Oh, and adding your nvidia-containerd derivation to the containerd systemd service path. 12:44:49
@ss:someonex.netSomeoneSerge (matrix works sometimes)Hm, I never dealt with containerd, but basic podman and docker with gpu support seemed to just work for me13:26:14
@ss:someonex.netSomeoneSerge (matrix works sometimes)
In reply to @FRidh:matrix.org
The curse of purity
Are you familiar with Guix's "grafts"? I just overheard about them, they seem to aim at solving a similar issue
13:27:13

Show newer messages


Back to Room ListRoom Version: 9