latent_3d_points icon indicating copy to clipboard operation
latent_3d_points copied to clipboard

tf_nndistance_so.so: undefined symbol: __cudaRegisterFunction

Open fpthink opened this issue 5 years ago • 1 comments

for this issue, please use tf1.3.0_gpu, cudnn6.0, cuda8.0, python2.7.

fpthink avatar Mar 15 '19 09:03 fpthink

I use tf 1.1 cuda 10.0 python 3.6

latent_3d_points/external/structural_losses

tf_nndistance_compile.sh

CUDA_ROOT=/usr/local/cuda-10.0
TF_ROOT=/home/user/.local/lib/python3.6/site-packages/tensorflow

TF_INC=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_include())') # /home/username/anaconda3/envs/py36_gpu/lib/python3.6/site-packages/tensorflow/include

TF_LIB=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())') 	 # /home/username/anaconda3/envs/py36_gpu/lib/python3.6/site-packages/tensorflow

$CUDA_ROOT/bin/nvcc -std=c++11 -c -o tf_nndistance_g.cu.o tf_nndistance_g.cu -I $TF_INC -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -O2 && g++ -std=c++11 tf_nndistance.cpp tf_nndistance_g.cu.o -o tf_nndistance_so.so -shared -fPIC -I $TF_INC -L $CUDA_ROOT/lib64 -O2

tf_approxmatch_compile.sh

CUDA_ROOT=/usr/local/cuda-10.0
TF_ROOT=/home/user/.local/lib/python3.6/site-packages/tensorflow

TF_INC=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_include())') 
# /home/username/anaconda3/envs/py36_gpu/lib/python3.6/site-packages/tensorflow/include

TF_LIB=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())') 	 
# /home/username/anaconda3/envs/py36_gpu/lib/python3.6/site-packages/tensorflow


set -e
if [ 'tf_approxmatch_g.cu.o' -ot 'tf_approxmatch_g.cu' ] ; then
	echo 'nvcc'
	$CUDA_ROOT/bin/nvcc tf_approxmatch_g.cu -o tf_approxmatch_g.cu.o -c -O2 -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC
fi
if [ 'tf_approxmatch_so.so'  -ot 'tf_approxmatch.cpp' ] || [ 'tf_approxmatch_so.so'  -ot 'tf_approxmatch_g.cu.o' ] ; then
	echo 'g++'
	g++ -std=c++11 tf_approxmatch.cpp tf_approxmatch_g.cu.o -o tf_approxmatch_so.so -shared -fPIC -I $TF_INC -I $CUDA_ROOT/include  -L $CUDA_ROOT/lib64/ -O2
fi

makefile

nvcc = /usr/local/cuda-10.0/bin/nvcc
cudalib =  /usr/local/cuda-10.0/lib64
tensorflow = $(python -c 'import tensorflow as tf; print(tf.sysconfig.get_include())') 


.....

sohee-zoe avatar May 01 '19 09:05 sohee-zoe