[英]How do I read a CUDA .cubin binary file in linux?
I'm trying to get the number of registers per thread for each of my kernels in my CUDA program. 我正在尝试为我的CUDA程序中的每个内核获取每个线程的寄存器数量。 This will help me use the CUDA Occupancy Calculator (http://developer.download.nvidia.com/compute/cuda/CUDA_Occupancy_calculator.xls) as to determine the highest occupancy of the GPU for my program.
这将帮助我使用CUDA占用计算器(http://developer.download.nvidia.com/compute/cuda/CUDA_Occupancy_calculator.xls)来确定我的程序的GPU占用率最高。
However, I have generated the .cubin file using the -cubin flag but I am unable to read it in vim/othertexteditors, as suggested by NVIDIA (http://forums.nvidia.com/index.php?showtopic=31279). 但是,我使用-cubin标志生成了.cubin文件,但是我无法按照NVIDIA(http://forums.nvidia.com/index.php?showtopic=31279)的建议在vim / othertexteditors中读取它。 Does anyone know how to get to read it?
有谁知道如何阅读它?
Thanks 谢谢
The easiest solution is to pass -Xptxas -v
to nvcc
like so 最简单的解决方案是将
-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
Alternatively, you can use the cudaFuncGetAttributes
API function to obtain the necessary values at runtime. 或者,您可以使用
cudaFuncGetAttributes
API函数在运行时获取必要的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.