/etx/nixos/configuration.nix:
environment.systemPackages = with pkgs; [ cudatoolkit cudaPackages_12_2.cudatoolkit ];shell.nix (thanks: https://discourse.nixos.org/t/installing-pytorch-into-a-virtual-python-environment/34720)
{ pkgs ? importpoetry:{} }: # add unstable pkgs.mkShell { buildInputs = with pkgs; [ gcc cudaPackages_12_2.cudatoolkit ]; shellHook = '' export LD_LIBRARY_PATH=${pkgs.gcc}/lib64:${pkgs.stdenv.cc.cc.lib}/lib:$LD_LIBRARY_PATH # export SHELL=${pkgs.zsh}/bin/zsh export CUDA_PATH=${pkgs.cudaPackages_12_2.cudatoolkit} export LD_LIBRARY_PATH=${pkgs.cudaPackages_12_2.cudatoolkit}/lib64:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=/run/opengl-driver/lib:$LD_LIBRARY_PATH source $(poetry env info --path)/bin/activate # instead of poetry shell poetry run python3 gpu/main.py ''; }
poetry install torch torchaudio torchvision
No comments:
Post a Comment