if [[ ! -z "${NVCC_PREPEND_FLAGS+x}" ]]
then
export NVCC_PREPEND_FLAGS_BACKUP="${NVCC_PREPEND_FLAGS}"
fi
NVCC_PREPEND_FLAGS="${NVCC_PREPEND_FLAGS} -ccbin=${CXX}"
It should be
if [[ ! -z "${NVCC_PREPEND_FLAGS+x}" ]]
then
export NVCC_PREPEND_FLAGS_BACKUP="${NVCC_PREPEND_FLAGS}"
fi
NVCC_PREPEND_FLAGS="-ccbin=${CXX}"
Otherwise when you move between environments with the cuda-nvcc package (including re-activating the same environment), these flags are accumulated:
(base) iblis:~> conda list nvcc
# packages in environment at /home/mpapadakis/mambaforge:
#
# Name Version Build Channel
(base) iblis:~> echo $NVCC_PREPEND_FLAGS
(base) iblis:~> echo $NVCC_PREPEND_FLAGS_BACKUP
(base) iblis:~> conda activate ~/b/env
(b/env) iblis:~> conda list nvcc
# packages in environment at /home/mpapadakis/b/env:
#
# Name Version Build Channel
cuda-nvcc 12.4.131 hcdd1206_0 conda-forge
cuda-nvcc-dev_linux-64 12.4.131 ha770c72_0 conda-forge
cuda-nvcc-impl 12.4.131 hd3aeb46_0 conda-forge
cuda-nvcc-tools 12.4.131 hd3aeb46_0 conda-forge
cuda-nvcc_linux-64 12.4.131 h8a487aa_0 conda-forge
(b/env) iblis:~> echo $NVCC_PREPEND_FLAGS
-ccbin=/home/mpapadakis/b/env/bin/x86_64-conda-linux-gnu-c++
(b/env) iblis:~> echo $NVCC_PREPEND_FLAGS_BACKUP
(b/env) iblis:~> conda activate ~/b/env
(b/env) iblis:~> echo $NVCC_PREPEND_FLAGS
-ccbin=/home/mpapadakis/b/env/bin/x86_64-conda-linux-gnu-c++ -ccbin=/home/mpapadakis/b/env/bin/x86_64-conda-linux-gnu-c++
(b/env) iblis:~> echo $NVCC_PREPEND_FLAGS_BACKUP
-ccbin=/home/mpapadakis/b/env/bin/x86_64-conda-linux-gnu-c++
Solution to issue cannot be found in the documentation.
Issue
Credit to @aschaffer for discovering this
See https://github.com/conda-forge/cuda-nvcc-feedstock/blob/main/recipe/activate.sh#L37-L41
It should be
Otherwise when you move between environments with the cuda-nvcc package (including re-activating the same environment), these flags are accumulated:
Installed packages
Environment info