RuntimeError: Error compiling objects for extension 和nvcc fatal : Unsupported gpu architecture ‘c
记录一下最近跑TinaFace代码在原来服务器跑没有问题,新服务器跑遇到的错误
首先,按照官网步骤安装相关包:
本人环境:
显卡驱动版本: NVIDIA-SMI 460.73.01 Driver Version: 460.106.00 CUDA Version: 11.2
CUDA版本:nvcc -V: Cuda compilation tools, release 11.1, V11.1.74
pytorch 1.8.1
torchvision 0.9.1
mmcv-full 1.4.6
mmdet 2.22.0
cudatoolkit 11.1.1
ps:如果没有安装上mmcv或者mmdet,不要怀疑,肯定是你的版本有问题。这个问题博主也遇到了。
检查上面版本,通常来讲,没有任何问题。
cudatoolkit严格按照cuda版本安装的,mmdet也是根据cuda版本和pytorch版本安装的。
不出意外的话出意外了,最后一步执行命令 pip install -v -e .
编辑vedadet报错:
Installing collected packages: vedadetRunning setup.py develop for vedadetRunning command /mnt/data/cbm/software/anaconda3/envs/lw/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/mnt/data1/lw/vedadet-main/setup.py'"'"'; __file__='"'"'/mnt/data1/lw/vedadet-main/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-depsrunning developrunning egg_infowriting vedadet.egg-info/PKG-INFOwriting dependency_links to vedadet.egg-info/dependency_links.txtwriting requirements to vedadet.egg-info/requires.txtwriting top-level names to vedadet.egg-info/top_level.txtreading manifest file 'vedadet.egg-info/SOURCES.txt'adding license file 'LICENSE'writing manifest file 'vedadet.egg-info/SOURCES.txt'running build_extbuilding 'vedadet.ops.nms.nms_ext' extensionEmitting ninja build file /mnt/data1/lw/vedadet-main/build/temp.linux-x86_64-3.8/build.ninja...Compiling objects...Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)[1/1] /usr/local/cuda/bin/nvcc --generate-dependencies-with-compile --dependency-output /mnt/data1/lw/vedadet-main/build/temp.linux-x86_64-3.8/vedadet/ops/nms/src/cuda/nms_kernel.o.d -DWITH_CUDA -I/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/torch/include -I/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/torch/include/TH -I/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/mnt/data/cbm/software/anaconda3/envs/lw/include/python3.8 -c -c /mnt/data1/lw/vedadet-main/vedadet/ops/nms/src/cuda/nms_kernel.cu -o /mnt/data1/lw/vedadet-main/build/temp.linux-x86_64-3.8/vedadet/ops/nms/src/cuda/nms_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=nms_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14FAILED: /mnt/data1/lw/vedadet-main/build/temp.linux-x86_64-3.8/vedadet/ops/nms/src/cuda/nms_kernel.o/usr/local/cuda/bin/nvcc --generate-dependencies-with-compile --dependency-output /mnt/data1/lw/vedadet-main/build/temp.linux-x86_64-3.8/vedadet/ops/nms/src/cuda/nms_kernel.o.d -DWITH_CUDA -I/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/torch/include -I/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/torch/include/TH -I/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/mnt/data/cbm/software/anaconda3/envs/lw/include/python3.8 -c -c /mnt/data1/lw/vedadet-main/vedadet/ops/nms/src/cuda/nms_kernel.cu -o /mnt/data1/lw/vedadet-main/build/temp.linux-x86_64-3.8/vedadet/ops/nms/src/cuda/nms_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=nms_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14nvcc fatal : Unsupported gpu architecture 'compute_86'ninja: build stopped: subcommand failed.Traceback (most recent call last):File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1667, in _run_ninja_buildsubprocess.run(File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/subprocess.py", line 516, in runraise CalledProcessError(retcode, process.args,subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.The above exception was the direct cause of the following exception:Traceback (most recent call last):File "<string>", line 1, in <module>File "/mnt/data1/lw/vedadet-main/setup.py", line 119, in <module>setup(File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setupreturn distutils.core.setup(**attrs)File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/distutils/core.py", line 148, in setupdist.run_commands()File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/distutils/dist.py", line 966, in run_commandsself.run_command(cmd)File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/distutils/dist.py", line 985, in run_commandcmd_obj.run()File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/setuptools/command/develop.py", line 34, in runself.install_for_development()File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/setuptools/command/develop.py", line 114, in install_for_developmentself.run_command('build_ext')File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/distutils/cmd.py", line 313, in run_commandself.distribution.run_command(command)File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/distutils/dist.py", line 985, in run_commandcmd_obj.run()File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 79, in run_build_ext.run(self)File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run_build_ext.build_ext.run(self)File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/distutils/command/build_ext.py", line 340, in runself.build_extensions()File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 708, in build_extensionsbuild_ext.build_extensions(self)File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions_build_ext.build_ext.build_extensions(self)File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensionsself._build_extensions_serial()File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serialself.build_extension(ext)File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 202, in build_extension_build_ext.build_extension(self, ext)File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/distutils/command/build_ext.py", line 528, in build_extensionobjects = self.compiler.compile(sources,File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 529, in unix_wrap_ninja_compile_write_ninja_file_and_compile_objects(File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1354, in _write_ninja_file_and_compile_objects_run_ninja_build(File "/mnt/data/cbm/software/anaconda3/envs/lw/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1683, in _run_ninja_buildraise RuntimeError(message) from eRuntimeError: Error compiling objects for extension
ERROR: Command errored out with exit status 1: /mnt/data/cbm/software/anaconda3/envs/lw/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/mnt/data1/lw/vedadet-main/setup.py'"'"'; __file__='"'"'/mnt/data1/lw/vedadet-main/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
总结一下,就是报这个错误:nvcc fatal : Unsupported gpu architecture 'compute_86'
意思就是我的GPU算力架构太高了,不支持computer_86。博主GPU算力是3090显卡
网上很多博主说pytorch暂不支持computer_86,有很多建议说是将算力改为computer_75等。
这种自降身价的事,博主是不会做,万一改不回来了,岂不是亏大了。而且也有很多3090显卡的博主降算力后,推理代码时出现各种问题。
解决方案:
虽然 nvcc -V 显示的版本是11.1,但是cuda有个编译版本:一般在/usr/loacal/cuda/
文件夹下:
这可以可以发现,本地安装了多个cuda版本。cuda文件是编译时采用的cuda版本文件的软件链接。即虽然是nvcc -V版本是11.1,但是编译版本是cuda10.2,导致出错。
临时解决方案:
将conda环境从cuda11.1版本降低到10.2,执行指令pip install -v -e .
能够编译完成,但是执行代码时候会报错:
UserWarning: GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation. The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37. If you want to use the GeForce RTX 30
pytorch 3090显卡对应的cuda版本过低,可以直接将conda环境中的cuda版本升级到11.1,临时解决
注意:虽然两次都是报错cuda问题,第一次需要重新加载编辑本地代码,因此执行了编辑时的cuda版本,但是代码运行时执行是nvcc -V的版本。又会报版本过低。
但是在使用mmdetection框架时,通常都会需要自己设计网络框架后,需要重新编辑本地代码,同样还是需要执行pip install -v -e .
问题不会被解决。
永久解决方案:
将编译时用到的cuda版本升级到11.1
相关参考博客如下:
nvcc fatal : Unsupported gpu architecture ‘compute_86‘
安装CUDA时,nvcc --version和cat /usr/local/cuda/version.txt版本不一致
RuntimeError: Error compiling objects for extension 和nvcc fatal : Unsupported gpu architecture ‘c相关推荐
- mmdetection3D RuntimeError: Error compiling objects for extension
最近在配置open-mmlab的mmdetection3d项目,其中大部分的步骤都可以很方便的完成,但是在CUDA版本和torch版本上会有一定的问题,详细记录下: 前面的几个步骤都没什么问题,就最后 ...
- RuntimeError: Error compiling objects for extension手把手带你解决(超详细)
我在执行python setup.py build develop的时候,编译出错,显示RuntimeError: Error compiling objects for extension 我在网上 ...
- 问题解决:nvcc fatal : Unsupported gpu architecture ‘compute_75‘
问题解决:nvcc fatal : Unsupported gpu architecture 'compute_75' 本机环境 问题描述 问题分析 问题解决 参考 本机环境 Ubuntu16.04 ...
- nvcc fatal : Unsupported gpu architecture 'compute_11'
使用VS编译OpenCV编译源代码时候,对Cmake生成的工程文件编译,会出现 nvcc fatal : Unsupported gpu architecture 'compute_11' 问题.原 ...
- DCNv2 RuntimeError: Error compiling objects for extension
1 .export CUDA_HOME=/usr/local/cuda 2 . ./make.sh
- nvcc fatal : Unsupported gpu architecture ‘compute_86‘
GPU: RTX3090 Linux: Ubuntu 16.04 pytorch: 1.7.0 python: 3.7.9 cuda version: V11.0.194 GCC version: 5 ...
- NVCC Fatal
环境: 虚拟机:Ubuntu 18.04.5 LTS (GNU/Linux 5.4.0-108-generic x86_64) python:3.8.10 pytorch:1.7.1+cu110 cu ...
- RuntimeError: Error occured during execution of the processing block! See the log for more info
Intel Realsense报错:RuntimeError: Error occured during execution of the processing block! See the log ...
- Fatal error compiling: 无效的目标发行版: 3.1
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-c ...
- Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags
项目换用openjdk11后报错 Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.c ...
最新文章
- linux sh 改 cmd
- two years in cnblogs.com
- java split 逗号_咦,Java拆分个字符串都这么讲究
- SQL数据库恢复后出现对象名无效(SQL Server备份还原时造成孤立用户的解决方案
- python去停用词用nltk_【NLTK】安装和使用NLTK分词和去停词
- PyTorch框架学习五——图像预处理transforms(一)
- 计算机专业能评电子工程师吗,计算机工程师职称 评定条件
- 大一C语言和线性代数,有谁学过线性代数和C语言啊?
- 【MCM-2017】2017年数学建模美赛题目原文及翻译-B (个人思路)
- usb抓包工具 安卓_USB抓包工具(Bus Hound)下载 v6.0.1 官方版
- 8个常用的wx小程序 UI 组件库,社区、电商、工具各类都有!
- Xmind如何添加水印
- oracle优化器analyzed,Oracle Optimizer:迁移到使用基于成本的优化器—–系列1.2-数据库专栏,ORACLE...
- 桌面图标有蓝底怎么去掉,去掉桌面图标
- “秃“如其来的植发经济是一门好生意吗?
- 直接管理和维护计算机系统的程序称为,全国2008年4月自考计算机原理试题
- 又是一年毕业季,你拿什么打动面试官?
- 【故障处理】队列等待之enq: TX - row lock contention
- 乐视网TV版为何能成付费视频用户第一选择?
- 微信开发者工具 页面颜色调整(多与黑白)