CUDA 编程 之 编译问题小记

来源:互联网 发布:淘宝网睡衣大全冬季 编辑:程序博客网 时间:2024/05/17 04:03

1. 在编译cuda程序时出现 这个问题

obj/release/mySobeldllComb.cu_o relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

根据提示,说加上 -fPIC 重新编译,如果是 GCC的话,可以直接加 -fPIC,但是要是NVCC 的话,需要如下

nvcc *.cu -Xcompiler -fPIC

2. Error: application being profiled returned a non-zero return code ..

在执行某个程序时,出现这个错误,调了半天没调出来,搜一搜,思路如下。

On most operating systems a non-zero process exit code indicates an error in the application. The Visual Profiler is warning that it detected a non-zero process exit code from the target application.

  1. Does the target application return a non-zero process exit code when run outside of the Visual Profiler? If yes, then fix the target application.

  2. Does the target application return a non-zero process exit code only when launched from the Visual Profiler? If yes, then debug what error is occurring in the application. These types of errors are often cause by a difference in the process launch environment including but not limited to:

    • Incorrect working directory
    • Incorrect command line arguments
    • Incorrect environment variables

These three settings can be specified in the Visual Profiler session settings.

0 0
原创粉丝点击