I am trying to compile pytorch inside a conda environment using my system version headers of cuda/cuda-toolkit located at /usr/local/cuda-12/include
.
I get all sorts of compilation issues since there are headers in my environment include, /home/coyote/.conda/envs/deepchem/include
that mess up compiling with system nvcc and system gcc when I have this order with environment includes being AUTOMATICALLY listed first when running python setup.py install
/usr/local/cuda-12/bin/nvcc ... -isystem /home/coyote/.conda/envs/deepchem/include <more -isysyem paths> -isystem /usr/local/cuda-12/include ... -c pytorch/aten/src/ATen/native/cuda/CumminmaxKernel.cu -o caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/ATen/native/cuda/CumminmaxKernel.cu.o
errors such as below without moving /home/coyote/.conda/envs/deepchem/include/nv
to /home/coyote/.conda/envs/deepchem/include/_nv
/usr/local/cuda-12/include/cuda_bf16.hpp(383): error: identifier "__NV_IS_DEVICE" is undefined
or later after moving /home/coyote/.conda/envs/deepchem/include/nv
to /home/coyote/.conda/envs/deepchem/include/_nv
then getting issues with the cub
folder in the environment include
/home/coyote/.conda/envs/deepchem/include/cub/iterator/tex_ref_input_iterator.cuh(99): error: texture is not a template
/home/coyote/.conda/envs/deepchem/include/cub/iterator/tex_ref_input_iterator.cuh(111): error: identifier "cudaBindTexture" is undefined
But I don’t get these compile issues if I manually put system cuda -isystem /usr/local/cuda-12/include
somewhere before the environment include -isystem /home/coyote/.conda/envs/deepchem/include
So my question is how to make this order automatically when running setup.py install. How can I make /usr/local/cuda-12/include
the first of all -isystem
includes?