gcc支持将openmp代码卸载到nvidia卡,因为gcc版本为7.1,但我无法使用它。我在ubuntu 17.10上安装了nvptx-tools
和gcc-offload-nvptx
个软件包。当我尝试编译openmp目标代码时,我收到此错误
ptxas /tmp/ccqGsx2p.o, line 383; error : State space mismatch between instruction and address in instruction 'ld'
ptxas /tmp/ccqGsx2p.o, line 456; error : State space mismatch between instruction and address in instruction 'ld'
ptxas /tmp/ccqGsx2p.o, line 383; error : Unknown symbol '__stack_chk_guard'
ptxas /tmp/ccqGsx2p.o, line 383; fatal : Label expected for forward reference of '__stack_chk_guard'
ptxas fatal : Ptx assembly aborted due to errors
nvptx-as: ptxas returned 255 exit status
mkoffload: fatal error: x86_64-linux-gnu-accel-nvptx-none-gcc-7 returned 1 exit status
compilation terminated.
lto-wrapper: fatal error: /usr/lib/gcc/x86_64-linux-gnu/7//accel/nvptx-none/mkoffload returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
我无法找到任何解决方案,并且在gcc中使用nvptx支持openmp几乎没有文档