Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在linux中读取CUDA.cubin二进制文件?_Linux_Cuda - Fatal编程技术网

如何在linux中读取CUDA.cubin二进制文件?

如何在linux中读取CUDA.cubin二进制文件?,linux,cuda,Linux,Cuda,我正在尝试获取CUDA程序中每个内核的每个线程的寄存器数量。这将帮助我使用CUDA占用率计算器(http://developer.download.nvidia.com/compute/cuda/CUDA_Occupancy_calculator.xls)以确定我的程序的GPU的最高占用率 但是,我已经使用-cubin标志生成了.cubin文件,但是我无法按照NVIDIA的建议在vim/OtherTextEditor中读取它(http://forums.nvidia.com/index.php?

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

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


谢谢

最简单的解决方案是像这样将
-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

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

最简单的解决方案是将
-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
或者,您可以使用API函数在运行时获取必要的值