Add -gencode to match all the GPU architectures you have.
Check 'https://en.wikipedia.org/wiki/CUDA#GPUs_supported' for list of architecture.
Check 'http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html' for GPU compilation based on architecture.
nvcc -c -o vtn_cuda_kernel_generic.cu.o vtn_cuda_kernel_generic.cu -x cu -Xcompiler -fPIC -std=c++11 -I /usr/local/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I /usr/local/anaconda3/lib/python3.7/site-packages/torch/lib/include -I /usr/local/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I /home/humaolin/papercode/VON/render_module/vtn/vtn/src -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_61,code=sm_61
vtn_cuda_kernel_generic.cu:1:10: fatal error: THC.h: No such file or directory
Add -gencode to match all the GPU architectures you have. Check 'https://en.wikipedia.org/wiki/CUDA#GPUs_supported' for list of architecture. Check 'http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html' for GPU compilation based on architecture. nvcc -c -o vtn_cuda_kernel_generic.cu.o vtn_cuda_kernel_generic.cu -x cu -Xcompiler -fPIC -std=c++11 -I /usr/local/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I /usr/local/anaconda3/lib/python3.7/site-packages/torch/lib/include -I /usr/local/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I /home/humaolin/papercode/VON/render_module/vtn/vtn/src -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_61,code=sm_61 vtn_cuda_kernel_generic.cu:1:10: fatal error: THC.h: No such file or directory
include
compilation terminated.