impureWithCuda: fix gcc version

This commit is contained in:
Daniël de Kok 2025-02-04 10:24:33 +00:00
parent 4ef2e045c9
commit 06abe3f50e

View File

@ -94,8 +94,18 @@ mkShell {
( cd clients/python ; python -m pip install --no-dependencies -e . )
'';
postShellHook = ''
postShellHook =
''
unset SOURCE_DATE_EPOCH
export PATH=$PATH:~/.cargo/bin
export PATH=${cudaPackages.backendStdenv.cc}/bin:$PATH:~/.cargo/bin
''
# At various points in time, the latest gcc supported by CUDA differs
# from the default version in nixpkgs. A lot of the dependencies in
# the impure environment pull in the default gcc from nixpkgs, so we
# end up with the CUDA-supported gcc and the nixpkgs default gcc in
# the path. To ensure that we can build CUDA kernels, put the CUDA
# first in the path. It's a hack, but it works.
+ lib.optionalString withCuda ''
export PATH=${cudaPackages.backendStdenv.cc}/bin:$PATH
'';
}