nvcc fatal : '--ptxas-options=-v': expected a number

nvcc fatal : '--ptxas-options=-v': expected a number

对于CUDA 10.1,此配置行不再正确:

nvcc_compile_args = ['-O', '--ptxas-options=-v', '-arch=sm_35', '-c', '--compiler-options=-fPIC']

这将生成一个nvcc编译命令,如下所示:

nvcc -O ...

在CUDA 10.0及更低版本中,此命令是合法的。 对于CUDA 10.1则不是。 此开关通过了主机代码的优化级别,因此,除非有任何原因,否则我建议在此处传递-O3 :

nvcc_compile_args = ['-O3', '--ptxas-options=-v', '-arch=sm_35', '-c', '--compiler-options=-fPIC']

注:配置行nvcc_compile_args一般在setup.py中指定。