【问题标题】:CUDA --ptxas-options="-v" not showing any outputCUDA --ptxas-options="-v" 不显示任何输出
【发布时间】:2013-02-06 13:15:54
【问题描述】:

我在 64 位 Windows 上安装了 Visual Studio 2008。尝试通过在 CUDA->Command Line->Additional Options 中添加 --ptxas-options="-v" 来构建 CUDA 程序。我仍然看不到 this 答案中的 ptxas 信息。

这是 CUDA->命令行部分的“所有选项”部分中的数据:

"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.2\bin\nvcc.exe"  -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.2\include" -I"C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.2\C\common\inc" -O0 -arch compute_10 -code compute_10 --host-compilation C++ -c -m 64 -o "x64\Release\CUDA_Dissertation.obj" -odir "x64\Release" -ext none -int real  --ptxas-options="-v" "c:\Documents and Settings\shubham\My Documents\Visual Studio 2008\Projects\MTP\CUDA_Dissertation\CUDA_Dissertation.vcproj"

是否有其他标志正在抑制 ptxas 标志?还是我的构建配置(发布 x64)与它有关?或其他一些启用/禁用的选项。我尝试使用几乎相同的命令从命令提示符编译它:

"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.2\bin\nvcc.exe"  -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.2\include" -I"C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.2\C\common\inc" -O0 -arch compute_10 -code compute_10 --host-compilation C++ -c -m 64 -o "x64\Release\CUDA_Dissertation.obj" -odir "x64\Release" -ext none -int real  --ptxas-options="-v" main.cu

编译时输出与 Visual Studios 相同的输出(警告和其他东西),但没有 ptxas 信息。

【问题讨论】:

  • 你试过不带引号的--ptxas-options=-v 吗?
  • 如果在手动编译中去掉-c 开关会发生什么?
  • @RobertCrovella:删除 -c 会导致其他 .cpp 文件中定义的函数出现链接错误。

标签: visual-studio-2008 cuda nvcc


【解决方案1】:

我刚刚看到这样的错误,使用 toolkit 4.0 它可以提供正确的输出,使用 5.0 它没有。我将该命令行选项从全局项目设置移至 .cu 文件的属性,它开始工作。视觉工作室 2005。

【讨论】:

    【解决方案2】:

    您没有看到来自 --ptxas-options=-v 的任何详细输出的原因是 ptxas 没有编译任何东西。

    在您的 nvcc 调用中:

    "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.2\bin\nvcc.exe"
    
    ...
    
    -arch compute_10 -code compute_10
    
    ...
    

    您将-code 选项指定为-code compute_10,它只包括PTX 架构而不是真正的 sm_* 架构。这意味着ptxas 没有将 PTX 代码编译成二进制代码; PTX 代码按原样包含在输出中,稍后将进行 JIT 编译。

    要查看 ptxas 信息,请尝试将您的 -code 选项更改为 -code compute_10,sm_10

    因此,在您的情况下,您的 nvcc 调用将是:

    "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.2\bin\nvcc.exe" -ccbin      "c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.2\include" -I"C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.2\C\common\inc" -O0 -arch compute_10 -code compute_10,sm_10 --host-compilation C++ -c -m 64 -o "x64\Release\CUDA_Dissertation.obj" -odir "x64\Release" -ext none -int real --ptxas-options="-v" "c:\Documents and Settings\shubham\My Documents\Visual Studio 2008\Projects\MTP\CUDA_Dissertation\CUDA_Dissertation.vcproj"
    

    这有帮助吗?

    【讨论】:

      猜你喜欢
      • 2014-09-02
      • 2019-10-24
      • 1970-01-01
      • 2019-05-16
      • 2019-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多