Skip to content

Commit

Permalink
Add nix configs and uv lock file
Browse files Browse the repository at this point in the history
  • Loading branch information
yvan-sraka committed Jan 30, 2025
1 parent 063291d commit d5c0359
Show file tree
Hide file tree
Showing 5 changed files with 4,112 additions and 0 deletions.
59 changes: 59 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in { devShells.default = import ./shell.nix { inherit pkgs; }; });
}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ dependencies = [
"airportsdata",
"torch",
"outlines_core==0.1.26",
"pre-commit>=4.0.1",
]
dynamic = ["version"]

Expand Down
77 changes: 77 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{ pkgs ? import <nixpkgs> { config = { allowUnfree = true; }; } }:

(pkgs.buildFHSEnv {
name = "dottxt-ai";
targetPkgs = pkgs:
with pkgs; [
autoconf
binutils
cmake
cudatoolkit
curl
freeglut
gcc13
git
gitRepo
gnumake
gnupg
gperf
libGL
libGLU
linuxPackages.nvidia_x11
m4
ncurses5
procps
python3Packages.numpy
python3Packages.pytorch
python3Packages.pytorch
python3Packages.torch
python3Packages.xformers
stdenv.cc
unzip
util-linux
uv
xorg.libX11
xorg.libXext
xorg.libXi
xorg.libXmu
xorg.libXrandr
xorg.libXv
zlib
];

multiPkgs = pkgs: with pkgs; [ zlib ];

runScript = "bash";

profile = ''
# CUDA paths
export CUDA_HOME=${pkgs.cudatoolkit}
export CUDA_PATH=${pkgs.cudatoolkit}
# Ensure proper binary paths are included
export PATH=${pkgs.gcc13}/bin:${pkgs.cudatoolkit}/bin:$PATH
# Set library paths, including additional directories for CUPTI
export LD_LIBRARY_PATH=${pkgs.cudatoolkit}/lib64:${pkgs.cudatoolkit}/extras/CUPTI/lib64:${pkgs.linuxPackages.nvidia_x11}/lib:$LD_LIBRARY_PATH
# Add static library paths to EXTRA_LDFLAGS for the linker
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"
export EXTRA_CCFLAGS="-I${pkgs.cudatoolkit}/include $EXTRA_CCFLAGS"
# Set CMake paths
export CMAKE_PREFIX_PATH=${pkgs.cudatoolkit}:${pkgs.linuxPackages.nvidia_x11}:$CMAKE_PREFIX_PATH
# C++ and CC flags
export CXXFLAGS="--std=c++17 $EXTRA_CCFLAGS"
export CC=${pkgs.gcc13}/bin/gcc
export CXX=${pkgs.gcc13}/bin/g++
# NVCC flags to use the right compiler
export NVCC_FLAGS="-ccbin ${pkgs.gcc13}/bin/gcc"
'';

structuredAttrs__ = {
stdenv = pkgs.stdenv.overrideCC pkgs.stdenv.cc pkgs.gcc13;
};
}).env
Loading

0 comments on commit d5c0359

Please sign in to comment.