【问题标题】:How do I read a CUDA .cubin binary file in linux?如何在 linux 中读取 CUDA .cubin 二进制文件?
【发布时间】:2011-05-04 03:44:35
【问题描述】:

我正在尝试获取 CUDA 程序中每个内核的每个线程的寄存器数量。这将帮助我使用 CUDA 占用率计算器 (http://developer.download.nvidia.com/compute/cuda/CUDA_Occupancy_calculator.xls) 来确定我的程序的 GPU 最高占用率。

但是,我已经使用 -cubin 标志生成了 .cubin 文件,但我无法在 vim/othertexteditors 中读取它,正如 NVIDIA (http://forums.nvidia.com/index.php?showtopic= 31279)。有人知道怎么读吗?

谢谢

【问题讨论】:

    标签: linux cuda


    【解决方案1】:

    最简单的解决方案是像这样将-Xptxas -v 传递给nvcc

    $ nvcc -Xptxas -v foo.cu
    ptxas info    : Compiling entry function '_Z9my_kernelPfS_f' for 'sm_10'
    ptxas info    : Used 2 registers, 20+16 bytes smem
    

    或者,您可以使用cudaFuncGetAttributes API 函数在运行时获取必要的值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-10
      • 2013-01-08
      • 1970-01-01
      • 1970-01-01
      • 2011-01-26
      • 1970-01-01
      • 1970-01-01
      • 2013-02-17
      相关资源
      最近更新 更多