操作系统版本:Red Hat 4.8.5-39
DTK 版本:DTK-23.04
驱动版本:rock-4.5.2-0-5.11.36-1.x86_64
DCU类型:Z100
异常描述:Makefile 编译包含 .cu 文件的程序时,链接时出现问题。输出:
Linking GPU codes
Warning: nvcc current only support gfx906 and gfx926 arch. All architecture parameters will be replaced by gfx906 arch.
/opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/../../../../bin/ld: /tmp/__gpu__CUAPI_Asyn_FluidSolver-bde963.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/../../../../bin/ld: /tmp/__gpu__CUAPI_DiagnoseDevice-71fbb4.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/../../../../bin/ld: /tmp/__gpu__CUAPI_MemAllocate_Fluid-54bd42.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
......
/opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/../../../../bin/ld: /tmp/__gpu__CUSRC_Src_Deleptonization-914447.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/../../../../bin/ld: /tmp/__gpu__CUSRC_Src_User_Template-4fc3d0.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/../../../../bin/ld: final link failed: Nonrepresentable section on output
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile在附件中。

暂无数据
1.您可以尝试一下修改Makefile文件哈,在已有的CXXFLAG后面加上-fPIC试试呢
2.您可以尝试更换一下dtk版本试一下
如果还不能解决,能否提供一下编译的程序案例,我们这边试一下