Search code examples
gpunvcc

Command to get sm version of gpu in current machine


Is there a command to get the sm version of the gpu in given machine. Here is my use case: I build and run same cuda kernel on multiple machines. So I was wondering if there is a command which can detect sm version of gpu on the given system and pass that as arguement to nvcc:

$ nvcc -arch=`gpuarch -device 0` mykernel.cu


Solution

  • I found https://gist.github.com/f0k/63a664160d016a491b2cbea15913d549. I find this is best solution. You just need python.