当我尝试构建 a Windows port of Faster-RCNN 时出现 nvcc fatal : '--ptxas-options=-v': Expected a number
错误。您可以直接从 here 访问安装文件(这是一个 Python 脚本) .
软件环境:
- CUDA v10.1
- VS 2019
- Python 3.7
- Windows 10
最佳答案
此配置行在 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']
相关文档链接为here
关于cuda - nvcc 致命 : '--ptxas-options=-v' : expected a number,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56513796/