简体   繁体   English

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

[英]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.

相关问题 如何在Linux机器上获取我的CUDA规范? - How do I get my CUDA specs on a Linux machine? 如何在Linux中使用严格的python以管理员权限读取二进制文件 - how to read binary file with administrator privileges using strictly python in linux 如何在 Linux 中运行二进制文件 - How to run binary file in Linux 如何在Linux上的C库中使用编译的二进制文件? - How do I use a compiled binary for a C library on Linux? 如何在 Linux/Bash 中提取二进制文件的文本部分? - How can I extract the text portion of a binary file in Linux/Bash? 如何在linux中创建一个文件描述符,该文件描述符可以从多个进程读取而不消耗数据? - How do I create a file descriptor in linux that can be read from multiple processes without consuming the data? 如何从c(linux)中的非文本文件中读取? - How do I read from a non-text file in c (linux)? 二进制读/写的Linux elf二进制调理文件 - Linux elf binary recuperate file that binary read/writes 如何在Linux中使用POSIX方法从文件中读取Unicode-16字符串? - How do I read Unicode-16 strings from a file using POSIX methods in Linux? 如何在 Linux 上使文件永久只读,以便 root 也无法编辑它? - How do I make a file permanently read-only on Linux so even root can not edit it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM