charlesq34 / pointnet2

PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space
Other
3.07k stars 895 forks source link

Is it possible to run PointNet without Cuda? #81

Open GuintherKovalski opened 5 years ago

GuintherKovalski commented 5 years ago

I'm trying to run PointNet in an anaconda navigator environment with TF1.2 in my notebook with an Intel ® HD Graphics 620 GPU , which is not compatible with CUDA.

When i try to compile the tf_ops files tf_grouping_compile.sh and tf_sampling_compile.sh i got the error:

tf_grouping_compile.sh: 2: tf_grouping_compile.sh: /usr/local/cuda-8.0/bin/nvcc: not found

Because the directory doesn't exist.

My question is, should i:

Try to install Cuda anyway? Change the directories at sh files to another, if yes, were should it be? Erase references in the sh files to Cuda? Make any other change?

that's what is inside tf_grouping_compile.sh:

#/bin/bash
/usr/local/cuda-8.0/bin/nvcc tf_grouping_g.cu -o tf_grouping_g.cu.o -c -O2 -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC

# TF1.2
g++ -std=c++11 tf_grouping.cpp tf_grouping_g.cu.o -o tf_grouping_so.so -shared -fPIC -I /usr/local/lib/python2.7/dist-packages/tensorflow/include -I /usr/local/cuda-8.0/include -lcudart -L /usr/local/cuda-8.0/lib64/ -O2 -D_GLIBCXX_USE_CXX11_ABI=0

# TF1.4
#g++ -std=c++11 tf_grouping.cpp tf_grouping_g.cu.o -o tf_grouping_so.so -shared -fPIC -I /usr/local/lib/python2.7/dist-packages/tensorflow/include -I /usr/local/cuda-8.0/include -I /usr/local/lib/python2.7/dist-packages/tensorflow/include/external/nsync/public -lcudart -L /usr/local/cuda-8.0/lib64/ -L/usr/local/lib/python2.7/dist-packages/tensorflow -ltensorflow_framework -O2 -D_GLIBCXX_USE_CXX11_ABI=0

And inside tf_sampling_compile.sh:

#/bin/bash
/usr/local/cuda-8.0/bin/nvcc tf_sampling_g.cu -o tf_sampling_g.cu.o -c -O2 -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC

# TF1.2
g++ -std=c++11 tf_sampling.cpp tf_sampling_g.cu.o -o tf_sampling_so.so -shared -fPIC -I /usr/local/lib/python2.7/dist-packages/tensorflow/include -I /usr/local/cuda-8.0/include -lcudart -L /usr/local/cuda-8.0/lib64/ -O2 -D_GLIBCXX_USE_CXX11_ABI=0

# TF1.4
#g++ -std=c++11 tf_sampling.cpp tf_sampling_g.cu.o -o tf_sampling_so.so -shared -fPIC -I /usr/local/lib/python2.7/dist-packages/tensorflow/include -I /usr/local/cuda-8.0/include -I /usr/local/lib/python2.7/dist-packages/tensorflow/include/external/nsync/public -lcudart -L /usr/local/cuda-8.0/lib64/ -L/usr/local/lib/python2.7/dist-packages/tensorflow -ltensorflow_framework -O2 -D_GLIBCXX_USE_CXX11_ABI=0
julianstolp commented 5 years ago

You can compile the file without a nvidia card. But you wont be able to run that code on your notebook.

OmarAhmadin commented 5 years ago

You should install cuda then change the directories inside any tf_####.sh to your cuda directory. Notice that you need to install a compatible cuda according to your tensorflow version, click here to see the list.

You also need to change your tensorflow directory since you are using anaconda env. Below #TF1.2

change:

/usr/local/lib/python2.7/dist-packages/tensorflow/include

to

/##/miniconda3/envs/tensorflow/lib/python2.7/site-packages/tensorflow/include (In my case it is miniconda in yours it is anaconda)

At the same place below TF1.2 you must change cuda directory too.

Let me know if you need further help.