Project working on Tegra K1/CUDA 6.5, but not on CUDA 8.0 laptop


I’m usually working on a Jetson TK1 with CUDA 6.5, but wanted to run the project on my Ubuntu 16.04 laptop; I installed CUDA 8.0 and compiled/run the examples, but my code does not compile.

I’m using a GTX 980M with NVIDIA drivers version 364.19 (installed with the package), CUDA 8.0 (installed with the run file), and g++ version 5.4.0

I’m compiling my C++ code using:


my CUDA code using:

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -O3 --ptxas-options=-v -g -std=c++11 --maxrregcount 255 -lineinfo)

cuda_add_library(cuda_prgm STATIC

and linking with:

add_library(prgm SHARED ${prgm_src_list} ${third_party_list})
target_link_libraries(prgm ${common_libraries} )
target_link_libraries(prgm ${CMAKE_BINARY_DIR}/lib/libcuda_prgm.a)

The verbose Makefile output:

[ 91%] Linking CXX executable ../../bin/cam_viewer
cd /home/jd/dev/prgm/_build/apps/cam && /usr/bin/cmake -E cmake_link_script CMakeFiles/cam_viewer.dir/link.txt --verbose=1
/usr/bin/c++    -Wall -fPIC -std=c++0x -DPARALLEL_NONE -DCOMPILE_PYTHON_BINDINGS  -O3 -DNDEBUG -O3 -DNDEBUG   CMakeFiles/cam_viewer.dir/cam_viewer.cpp.o  -o ../../bin/cam_viewer  -L/usr/lib/x86_64-linux-gnu/ -rdynamic  ../../lib/ /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/ -lpython2.7 -lboost_system -lboost_chrono -lboost_python -lboost_thread -lboost_filesystem -lboost_date_time -lboost_atomic -lpthread /usr/local/cuda/lib64/libcudart_static.a -lpthread -ldl -lrt -lcam -ldl /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/ -lrt -lcam ../../lib/libcuda_prgm.a -Wl,-rpath,/usr/lib/x86_64-linux-gnu/ 
/usr/bin/ld: ../../bin/cam_viewer: hidden symbol `cudaSetupArgument' in /usr/local/cuda/lib64/libcudart_static.a(libcudart_static.a.o) is referenced by DSO
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
apps/cam/CMakeFiles/cam_viewer.dir/build.make:116: recipe for target 'bin/cam_viewer' failed
make[2]: *** [bin/cam_viewer] Error 1
make[2]: Leaving directory '/home/jd/dev/prgm/_build'
CMakeFiles/Makefile2:776: recipe for target 'apps/cam/CMakeFiles/cam_viewer.dir/all' failed
make[1]: *** [apps/cam/CMakeFiles/cam_viewer.dir/all] Error 2
make[1]: Leaving directory '/home/jd/dev/prgm/_build'
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

(same error for multiple other files)

I tried to inspect the lib, “nm /usr/local/cuda/lib64/libcudart_static.a | grep cudaSetupArg”, but “cudaSetupArgument” doesn’t really seems hidden.

000000000003e720 T cudaSetupArgument
0000000000001590 r _ZZ17cudaSetupArgumentE12__FUNCTION__

Thanks in advance for your time,

any solutions?

any solutions?

I changed my library with the CUDA code from static to shared; not exactly what at wanted, but at least, it compiles and works.

Still unsure why it was working on another device but not my laptop.