Ask Your Question
0

catkin_make error when compiling cuda code on TK1

asked 2016-10-21 17:12:24 -0600

pgigioli gravatar image

I am trying to compile a package that has C++, C, and Cuda code. I've been able to successfully compile the package on a TX1 with cuda 7.0 but I get a strange compilation error when compiling on my TK1 with cuda 6.5. Here is the error:

ubuntu@tegra-ubuntu:~/catkin_ws$ catkin_make
Base path: /home/ubuntu/catkin_ws
Source space: /home/ubuntu/catkin_ws/src
Build space: /home/ubuntu/catkin_ws/build
Devel space: /home/ubuntu/catkin_ws/devel
Install space: /home/ubuntu/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/ubuntu/catkin_ws/build"
####
####
#### Running command: "make -j1 -l1" in "/home/ubuntu/catkin_ws/build"
####
[  0%] Building NVCC (Device) object darknet_ros/CMakeFiles/ROS_interface.dir/src/./ROS_interface_generated_yolo_kernels.cu.o
-- Removing /home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/./ROS_interface_generated_yolo_kernels.cu.o
/usr/bin/cmake -E remove /home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/./ROS_interface_generated_yolo_kernels.cu.o
-- Generating dependency file: /home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/ROS_interface_generated_yolo_kernels.cu.o.NVCC-depend
/usr/local/cuda-6.5/bin/nvcc -M -D__CUDACC__ /home/ubuntu/catkin_ws/src/darknet_ros/src/yolo_kernels.cu -o /home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/ROS_interface_generated_yolo_kernels.cu.o.NVCC-depend -ccbin /usr/bin/cc -m32 -DROS_BUILD_SHARED_LIBS=1 -DROS_PACKAGE_NAME=\"darknet_ros\" -DROSCONSOLE_BACKEND_LOG4CXX -DGPU -DOPENCV -Xcompiler ,\"-g\" -arch=sm_32 -O3 -gencode arch=compute_20,code=sm_20 -DNVCC -I/usr/local/cuda-6.5/include -I/home/ubuntu/catkin_ws/devel/include -I/usr/include/opencv -I/usr/include -I/usr/local/cuda/include -I/home/ubuntu/catkin_ws/src/darknet_ros/src -I/opt/ros/indigo/include -I/usr/local/cuda-6.5/include
-- Generating temporary cmake readable file: /home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/ROS_interface_generated_yolo_kernels.cu.o.depend.tmp
/usr/bin/cmake -D input_file:FILEPATH=/home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/ROS_interface_generated_yolo_kernels.cu.o.NVCC-depend -D output_file:FILEPATH=/home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/ROS_interface_generated_yolo_kernels.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake
-- Copy if different /home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/ROS_interface_generated_yolo_kernels.cu.o.depend.tmp to /home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/ROS_interface_generated_yolo_kernels.cu.o.depend
/usr/bin/cmake -E copy_if_different /home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/ROS_interface_generated_yolo_kernels.cu.o.depend.tmp /home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/ROS_interface_generated_yolo_kernels.cu.o.depend
-- Removing /home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/ROS_interface_generated_yolo_kernels.cu.o.depend.tmp and /home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/ROS_interface_generated_yolo_kernels.cu.o.NVCC-depend
/usr/bin/cmake -E remove /home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/ROS_interface_generated_yolo_kernels.cu.o.depend.tmp /home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/ROS_interface_generated_yolo_kernels.cu.o.NVCC-depend
-- Generating /home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/./ROS_interface_generated_yolo_kernels.cu.o
/usr/local/cuda-6.5/bin/nvcc /home/ubuntu/catkin_ws/src/darknet_ros/src/yolo_kernels.cu -c -o /home/ubuntu/catkin_ws/build/darknet_ros/CMakeFiles/ROS_interface.dir/src/./ROS_interface_generated_yolo_kernels.cu.o -ccbin /usr/bin/cc -m32 -DROS_BUILD_SHARED_LIBS=1 -DROS_PACKAGE_NAME=\"darknet_ros\" -DROSCONSOLE_BACKEND_LOG4CXX -DGPU -DOPENCV -Xcompiler ,\"-g\" -arch ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-10-21 23:33:10 -0600

pgigioli gravatar image

Solved. Don't let ROS libraries get included into the cuda code!!! Through the linkages of my source code, ROS libraries were being included in cuda code and the cuda compiler was having a hard time interpreting those libraries. By keeping the #include statements for all ROS libraries limited to my C++ code, I was able to compile without issues.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-10-21 17:12:24 -0600

Seen: 349 times

Last updated: Oct 21 '16