Last active
June 28, 2024 15:49
-
-
Save Titus-von-Koeller/e541c1175b0a191bac75b72d9964e9d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs, unstable }: | |
let | |
cudatoolkit = pkgs.cudaPackages.cudatoolkit; | |
nixLD = pkgs.runCommand "ld.so" {} '' | |
mkdir -p $out/lib64 | |
ln -s ${pkgs.glibc}/lib64/ld-linux-x86-64.so.2 $out/lib64/ld-linux-x86-64.so.2 | |
''; | |
nixLDLibraryPath = pkgs.lib.makeSearchPath "lib" [ | |
pkgs.addOpenGLRunpath.driverLink | |
pkgs.glib.out | |
pkgs.libglvnd | |
pkgs.stdenv.cc.cc.lib | |
]; | |
in | |
pkgs.buildFHSUserEnv { | |
name = "pixi-env"; | |
targetPkgs = pkgs: with pkgs; [ | |
unstable.pixi | |
cudatoolkit | |
glib | |
libglvnd | |
stdenv.cc.cc.lib | |
# bashInteractive | |
# bash-completion | |
# complete-alias | |
]; | |
runScript = "bash"; | |
profile = '' | |
export NVIDIA_DRIVER_CAPABILITIES=compute,utility | |
export XDG_CONFIG_DIRS=/run/opengl-driver/share/X11/xorg.conf.d''${XDG_CONFIG_DIRS:+:}$XDG_CONFIG_DIRS | |
export XDG_DATA_DIRS=/run/opengl-driver/share''${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS | |
export LD_LIBRARY_PATH=${cudatoolkit}/lib:${cudatoolkit}/lib64:${cudatoolkit}/lib64/stubs:/run/opengl-driver/lib:${pkgs.glib}/lib:${pkgs.libglvnd}/lib:${pkgs.stdenv.cc.cc.lib}/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH | |
export CUDA_PATH=${cudatoolkit} | |
export PATH=${cudatoolkit}/bin:$PATH | |
export LIBRARY_PATH=${cudatoolkit}/lib:${cudatoolkit}/lib64:$LIBRARY_PATH | |
export CPLUS_INCLUDE_PATH="${cudatoolkit}/include''${CPLUS_INCLUDE_PATH:+:$CPLUS_INCLUDE_PATH}" | |
export C_INCLUDE_PATH="${cudatoolkit}/include''${C_INCLUDE_PATH:+:$C_INCLUDE_PATH}" | |
export NIX_LD=${nixLD}/lib64/ld-linux-x86-64.so.2 | |
export NIX_LD_LIBRARY_PATH=${nixLDLibraryPath} | |
# Pixi completion -- not working yet, due to missing `complete` command | |
eval "$(pixi completion --shell bash 2>/dev/null)" | |
echo "*** Pixi environment activated, using $(which pixi). ***" | |
''; | |
} |
Author
Titus-von-Koeller
commented
Jun 28, 2024
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment