New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build issues - cuda headers #1
Comments
Closing issue. Here's what I changed in diff --git a/make.sh b/make.sh
index c26d274..2bf1ebf 100755
--- a/make.sh
+++ b/make.sh
@@ -1,30 +1,30 @@
#!/usr/bin/env bash
-CUDA_PATH=/usr/local/cuda/
+CUDA_PATH=/usr/local/cuda/lib64
-cd src
+cd src || exit
# clean everything from before
-rm -f *.o *.so
+rm -f ./*.o ./*.so
rm -f internals_s.c internals_s.h
echo "Compiling functions using nvcc..."
# force compilation in CUDA/C++ mode
-nvcc -c -dc --shared functions_cuda_kernel.cu -x cu -arch=sm_35 -Xcompiler -fPIC -lcudadevrt -lcudart -o functions_cuda_kernel.cu.o -D __BOTH__='__device__ __host__'
-nvcc -c -dc --shared internals.c -x cu -arch=sm_35 -Xcompiler -fPIC -lcudadevrt -lcudart -o internals.cu.o -D __BOTH__='__device__ __host__' -include cfloat
+nvcc -c -dc --shared functions_cuda_kernel.cu -x cu -arch=sm_52 -Xcompiler -fPIC -lcudadevrt -lcudart -o functions_cuda_kernel.cu.o -D __BOTH__='__device__ __host__'
+nvcc -c -dc --shared internals.c -x cu -arch=sm_52 -Xcompiler -fPIC -lcudadevrt -lcudart -o internals.cu.o -D __BOTH__='__device__ __host__' -include cfloat
echo "Compiled, now linking..."
# required intermediate device code link step
-nvcc -arch=sm_35 -dlink functions_cuda_kernel.cu.o internals.cu.o -o functions.link.cu.o -Xcompiler -fPIC -lcudadevrt -lcudart
+nvcc -arch=sm_52 -dlink functions_cuda_kernel.cu.o internals.cu.o -o functions.link.cu.o -Xcompiler -fPIC -lcudadevrt -lcudart
echo "Generating sanitized versions of internals for C compilation..."
echo "#include <float.h>" | cat - internals.c | sed "s/__BOTH__//g" | sed "s/internals.h/internals_s.h/g" > internals_s.c
sed "s/__BOTH__//" internals.h > internals_s.h
-cd ../
+cd ../ || exit
echo "Building python interface to CUDA code"
-python build.py
+python build.py --cuda-path=$CUDA_PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, thanks for setting things up!
I don't seem to be able to build properly, as I keep getting an error with the location of the cuda headers.
I did change
make.sh
to point it to the correct cuda location as well.. (I also removed the hard-coding of gpu architecture to let my compile autodetect; it's what's worked for me before)It doesn't appear to matter whether the path is
/opt/cuda
or/opt/cuda/lib
or even the pytorch specific cuda path from thelocate
call below, I get the same error shown above.The text was updated successfully, but these errors were encountered: