How to detect NVIDIA CUDA Architecture

671 views Asked by At

When compiling CUDA code with the NVCC compiler you typically (AFAIK) need to specify the PTX architecture with -arch=compute_35 or -arch=sm_35 but there are multiple architectures. I would like to make my code as portable as possible so that a configure script could detect what architecture to use and pass the argument to the NVCC compiler.

This similar question answers where I could find it online but I would prefer to have a script so a downstream user could just install my program without needing to know the specific architecture of their GPU.

0

There are 0 answers