File size: 1,637 Bytes
313814b
 
8b9b750
313814b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aa5390b
e7c0206
 
313814b
 
e7c0206
e1a6910
9f56267
cf23b08
e7c0206
79f1f8d
e7c0206
313814b
3ac4de7
 
 
 
 
 
 
 
0aababd
 
3ac4de7
 
 
 
 
 
313814b
d200ef1
ce5dbe5
313814b
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };
  outputs =
    { nixpkgs, flake-utils, ... }:
    flake-utils.lib.eachDefaultSystem (
      system:
      let
        pkgs = import nixpkgs {
          inherit system;
          config.allowUnfree = true;
        };
      in
      {
        devShells = {
          default = pkgs.mkShell {
            nativeBuildInputs = with pkgs; [
              act
              cudaPackages_12.cudnn
              cudaPackages_12.libcublas
              ffmpeg-full
              go-task
              grafana-loki
              parallel
              pv
              python312
              tempo
              uv
              websocat
            ];

            # https://github.com/NixOS/nixpkgs/issues/278976#issuecomment-1879685177
            # NOTE: Without adding `/run/...` the following error occurs
            # RuntimeError: CUDA failed with error CUDA driver version is insufficient for CUDA runtime version
            #
            # NOTE: sometimes it still doesn't work but rebooting the system fixes it
            LD_LIBRARY_PATH = "/run/opengl-driver/lib:${
              pkgs.lib.makeLibraryPath [
                pkgs.cudaPackages_12.cudnn
                pkgs.cudaPackages_12.libcublas
                pkgs.zlib
                pkgs.stdenv.cc.cc
                pkgs.openssl
              ]
            }";

            shellHook = ''
              source .venv/bin/activate
              source .env
            '';
          };
        };
        formatter = pkgs.nixfmt;
      }
    );
}