Skip to content

Commit d5c0359

Browse files
committed
Add nix configs and uv lock file
1 parent 063291d commit d5c0359

File tree

5 files changed

+4112
-0
lines changed

5 files changed

+4112
-0
lines changed

flake.lock

+59
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
inputs.flake-utils.url = "github:numtide/flake-utils";
3+
outputs = { self, nixpkgs, flake-utils }:
4+
flake-utils.lib.eachDefaultSystem (system:
5+
let pkgs = nixpkgs.legacyPackages.${system};
6+
in { devShells.default = import ./shell.nix { inherit pkgs; }; });
7+
}

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ dependencies = [
4141
"airportsdata",
4242
"torch",
4343
"outlines_core==0.1.26",
44+
"pre-commit>=4.0.1",
4445
]
4546
dynamic = ["version"]
4647

shell.nix

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{ pkgs ? import <nixpkgs> { config = { allowUnfree = true; }; } }:
2+
3+
(pkgs.buildFHSEnv {
4+
name = "dottxt-ai";
5+
targetPkgs = pkgs:
6+
with pkgs; [
7+
autoconf
8+
binutils
9+
cmake
10+
cudatoolkit
11+
curl
12+
freeglut
13+
gcc13
14+
git
15+
gitRepo
16+
gnumake
17+
gnupg
18+
gperf
19+
libGL
20+
libGLU
21+
linuxPackages.nvidia_x11
22+
m4
23+
ncurses5
24+
procps
25+
python3Packages.numpy
26+
python3Packages.pytorch
27+
python3Packages.pytorch
28+
python3Packages.torch
29+
python3Packages.xformers
30+
stdenv.cc
31+
unzip
32+
util-linux
33+
uv
34+
xorg.libX11
35+
xorg.libXext
36+
xorg.libXi
37+
xorg.libXmu
38+
xorg.libXrandr
39+
xorg.libXv
40+
zlib
41+
];
42+
43+
multiPkgs = pkgs: with pkgs; [ zlib ];
44+
45+
runScript = "bash";
46+
47+
profile = ''
48+
# CUDA paths
49+
export CUDA_HOME=${pkgs.cudatoolkit}
50+
export CUDA_PATH=${pkgs.cudatoolkit}
51+
52+
# Ensure proper binary paths are included
53+
export PATH=${pkgs.gcc13}/bin:${pkgs.cudatoolkit}/bin:$PATH
54+
55+
# Set library paths, including additional directories for CUPTI
56+
export LD_LIBRARY_PATH=${pkgs.cudatoolkit}/lib64:${pkgs.cudatoolkit}/extras/CUPTI/lib64:${pkgs.linuxPackages.nvidia_x11}/lib:$LD_LIBRARY_PATH
57+
58+
# Add static library paths to EXTRA_LDFLAGS for the linker
59+
export EXTRA_LDFLAGS="-L${pkgs.cudatoolkit}/lib64 -L${pkgs.cudatoolkit}/extras/CUPTI/lib64 -L${pkgs.linuxPackages.nvidia_x11}/lib -L${pkgs.cudatoolkit}/libdevice $EXTRA_LDFLAGS"
60+
export EXTRA_CCFLAGS="-I${pkgs.cudatoolkit}/include $EXTRA_CCFLAGS"
61+
62+
# Set CMake paths
63+
export CMAKE_PREFIX_PATH=${pkgs.cudatoolkit}:${pkgs.linuxPackages.nvidia_x11}:$CMAKE_PREFIX_PATH
64+
65+
# C++ and CC flags
66+
export CXXFLAGS="--std=c++17 $EXTRA_CCFLAGS"
67+
export CC=${pkgs.gcc13}/bin/gcc
68+
export CXX=${pkgs.gcc13}/bin/g++
69+
70+
# NVCC flags to use the right compiler
71+
export NVCC_FLAGS="-ccbin ${pkgs.gcc13}/bin/gcc"
72+
'';
73+
74+
structuredAttrs__ = {
75+
stdenv = pkgs.stdenv.overrideCC pkgs.stdenv.cc pkgs.gcc13;
76+
};
77+
}).env

0 commit comments

Comments
 (0)