!eWOErHSaiddIbsUNsJ:nixos.org

NixOS CUDA

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

You have reached the beginning of time (for this room).


SenderMessageTime
16 Dec 2024
@connorbaker:matrix.orgconnor (burnt/out) (UTC-8)I'd recommend testing the waters and getting a sense of prior art done in terms of extending those; perhaps the folks in the Nixpkgs Stdenv room would be good to reach out to? https://matrix.to/#/#stdenv:nixos.org After that (and you've gotten a list of people interested in or knowledgeable about such work), I think drafting an RFC would be the next step, to fully lay out the plan for design and implementation. If it's a relatively small change, maybe an RFC is unnecessary and a PR would be fine!06:55:30
@ss:someonex.netSomeoneSerge (back on matrix)

That's the reason I've lately been ignoring flakes in personal projects: just stick to impure eval and autocalling. For me it's usually going in the direction of

{ nixpkgs ? <nixpkgs>
, pkgs ? import nixpkgs { inherit config; }
, lib ? pkgs.lib
, cudaSupport ? false
, config ? { inherit cudaSupport; }
}:

lib.makeScope pkgs.newScope (self: {
 # ...
})
14:45:04
@ss:someonex.netSomeoneSerge (back on matrix) *

That's the reason I've lately been ignoring flakes in personal projects: just stick to impure eval and autocalling. For me it's usually going in the direction of

{ nixpkgs ? <nixpkgs>
, pkgs ? import nixpkgs { inherit config; }
, lib ? pkgs.lib
, cudaSupport ? false
, config ? { inherit cudaSupport; }
}:

lib.makeScope pkgs.newScope (self: {
 # ...
})
14:45:18
@matthewcroughan:defenestrate.itmatthewcroughanI actually ended up with a good pattern using flake.parts14:45:28
@matthewcroughan:defenestrate.itmatthewcroughan
      perSystem = { system, ... }: {
        _module.args.rocmPkgs = import inputs.nixpkgs {
          overlays = [
            inputs.self.overlays.default
            (self: super: {
              python3 = super.python3.override {
                packageOverrides = self: super: { torch = super.torch-bin; };
              };
            })
          ];
          config.allowUnfree = true;
          config.rocmSupport = true;
          inherit system;
        };
        _module.args.nvidiaPkgs = import inputs.nixpkgs {
          overlays = [
            inputs.self.overlays.default
          ];
          config.allowUnfree = true;
          config.cudaSupport = true;
          inherit system;
        };
        _module.args.pkgs = import inputs.nixpkgs {
          overlays = [
            inputs.self.overlays.default
          ];
          config.allowUnfree = true;
          inherit system;
        };
      };

14:46:22
@matthewcroughan:defenestrate.itmatthewcroughan *
      perSystem = { system, ... }: {
        _module.args.rocmPkgs = import inputs.nixpkgs {
          overlays = [
            inputs.self.overlays.default
            (self: super: {
              python3 = super.python3.override {
                packageOverrides = self: super: { torch = super.torch-bin; };
              };
            })
          ];
          config.allowUnfree = true;
          config.rocmSupport = true;
          inherit system;
        };
        _module.args.nvidiaPkgs = import inputs.nixpkgs {
          overlays = [
            inputs.self.overlays.default
          ];
          config.allowUnfree = true;
          config.cudaSupport = true;
          inherit system;
        };
        _module.args.pkgs = import inputs.nixpkgs {
          overlays = [
            inputs.self.overlays.default
          ];
          config.allowUnfree = true;
          inherit system;
        };
      };

14:46:27
@matthewcroughan:defenestrate.itmatthewcroughanCould be deduplicated using a function, but this is what it looks like unfolded14:46:38
@matthewcroughan:defenestrate.itmatthewcroughan Then other flake-modules have these rocmPkgs and nvidiaPkgs arguments passed to them 14:47:01
@matthewcroughan:defenestrate.itmatthewcroughan
  perSystem = { config, pkgs, nvidiaPkgs, rocmPkgs, system, ... }: {
    packages = {
      comfyui-nvidia = nvidiaPkgs.comfyuiPackages.comfyui;
      comfyui-amd = rocmPkgs.comfyuiPackages.comfyui;
    };
  };

14:47:04

Show newer messages


Back to Room ListRoom Version: 9