Linker issue GPU Coder generated static lib to g++ project.

8 ビュー (過去 30 日間)
Markus Walser
Markus Walser 2019 年 10 月 4 日
コメント済み: Markus Walser 2019 年 11 月 21 日
Hi
I generated a static libxyz.a with the GPU Coder on a Jetson Xavier target. Now I want to link this library into an existing g++ project.
Unfortunately I get unresolved symbols which directs to MathWorks methods like __cudaRegisterLinkedBinary_54_tmpxft_000031a2_00000000_6_MWTargetNetworkImpl_cpp1_ii_beb7
An internet search pointed me to a build example for such use case: https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#examples
There's an intermediate linker step (--device-link) used before generating the static library, in this case libgpu.a:
nvcc --gpu-architecture=sm_50 --device-c a.cu b.cu
nvcc --gpu-architecture=sm_50 --device-link a.o b.o --output-file link.o
nvcc --lib --output-file libgpu.a a.o b.o link.o
g++ host.o --library=gpu --library-path=<path> \
--library=cudadevrt --library=cudart
Unfortunately I cannot find this --device-link step in the GPU Coders build log before the static library is linked from the object files.
Is there an coder option to enable such device-linker step? Or how could such unresolved symbold be resolved otherwise?

回答 (1 件)

Claudio Stucki
Claudio Stucki 2019 年 11 月 20 日
編集済み: Claudio Stucki 2019 年 11 月 20 日
Hi
I have the same problems. Have you found a solution to link your library successfully?
  1 件のコメント
Markus Walser
Markus Walser 2019 年 11 月 21 日
Hi
I created a simple shell script which I invoke manually after the Matlab build process.
MathWorks is informed about it. I hope we get a solution in a future release.
Regards, Markus

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

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by