using cmake to build a cuda project which using opencv, a static lib(.a) generated by matlab gpu coder to jetson nano. My qustion is why it show undefined referenced to ..

3 ビュー (過去 30 日間)
I have give my CMAKE files and my build progress in error.txt
I want to deal the problem
tmpxft_00002e1f_00000000-5_img_to_3d.cudafe1.cpp:(.text+0x6b688): undefined reference to `cusolverDnDgesvd_bufferSize'
tmpxft_00002e1f_00000000-5_img_to_3d.cudafe1.cpp:(.text+0x6b720): undefined reference to `cusolverDnDgesvd'
tmpxft_00002e1f_00000000-5_img_to_3d.cudafe1.cpp:(.text+0x6bbd4): undefined reference to `cublasDdot_v2'
tmpxft_00002e1f_00000000-5_img_to_3d.cudafe1.cpp:(.text+0x6be1c): undefined reference to `cublasDdot_v2'
...

回答 (1 件)

Ram Kokku
Ram Kokku 2024 年 2 月 3 日
Hi Hailing,
I think this is due to missing cublas and cusolver libraries from the install. can you check you have libcublas.so and libcusolver.so files in /usr/local/cuda/lib64 directory. CMakefile seem to have the right settings, but compiler/linker is not able to resolve the symbols.
  4 件のコメント
hailing
hailing 2024 年 2 月 6 日
I have add target_link_libraries(${PROJECT_NAME}
PUBLIC
cusolver
cublas
cublasLt
cusparse
) into cmakelists.txt file ,but still have same problem. whilc is commoned by nivda in NVIDIA/CUDALibrarySamples: CUDA Library Samples (github.com). And I chose disenable the two libs in gpu coder project like the img. But there still have a problem.
like:
/home/jetson/JETSON_CODE/MATLAB_ws/R2023b/E/file/CODE_WORK_SPACE/OPENCV/matlab_code/JETSON/jetson_main_img_3d_1_1/codegen/lib/img_to_3d/img_to_3d.a(img_to_3d_terminate.o): In function `__sti____cudaRegisterAll()':
tmpxft_000032ab_00000000-5_img_to_3d_terminate.cudafe1.cpp:(.text.startup+0x20): undefined reference to `__cudaRegisterLinkedBinary_54_tmpxft_000032ab_00000000_6_img_to_3d_terminate_cpp1_ii_22357f4f'...
I give it in error.txt. I also submit my new cmakelists.txt. I use jetson nano as my Operation platform. It supports cuda. The version of cmake is 3.28.1.
and thank you for your attention.
Chao Luo
Chao Luo 2024 年 2 月 6 日
Seems you need to add another library, cudart.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGet Started with GPU Coder についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by