-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
50 lines (49 loc) · 1.68 KB
/
flake.nix
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
{
description = "MLP training";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixgl.url = "github:nix-community/nixGL";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs@{
self,
nixpkgs,
nixgl,
flake-utils,
...
}: flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
let
inherit (nixpkgs) lib;
pkgs = import nixpkgs {
inherit system;
overlays = [
nixgl.overlay
];
config = {
allowUnfree = true;
cudaSupport = true;
};
};
in {
devShells.default = (with pkgs; mkShell.override { stdenv = gcc12Stdenv; }) {
name = "cuda";
buildInputs = with pkgs; [
stdenv.cc.cc
clang-tools
cudaPackages.cudatoolkit
cudaPackages.cuda_cudart
cudaPackages.cudnn
cudaPackages.libcublas
cudaPackages.cuda_sanitizer_api
gcc12
];
shellHook = ''
export CUDA_PATH=${pkgs.cudaPackages.cudatoolkit}
source <(sed -Ee '/\$@/d' ${lib.getExe pkgs.nixgl.nixGLIntel})
source <(sed -Ee '/\$@/d' ${lib.getExe pkgs.nixgl.auto.nixGLNvidia}*)
alias compute-sanitizer="${pkgs.cudaPackages.cuda_sanitizer_api.out}/compute-sanitizer/compute-sanitizer"
'';
};
}
);
}