ERROR: cuda_runtime_api.h: No such file or directory

环境

  • Ubuntu 16.04
  • Anaconda
  • cuda10.1
  • cudnn7.6.4
  • SOLOv2

bug

在配置solov2时报错:
mmdet/ops/utils/src/compiling_info.cpp:3:10: fatal error: cuda_runtime_api.h: No such file or directory
#include <cuda_runtime_api.h>
^~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command ‘gcc’ failed with exit status 1
Rolling back uninstall of mmdet
Moving to /home/yu/anaconda3/envs/solo/lib/python3.7/site-packages/mmdet.egg-link
from /tmp/pip-uninstall-a8oa_3mo/mmdet.egg-link
Replacing /home/yu/anaconda3/envs/solo/lib/python3.7/site-packages/mmdet.egg-link from /tmp/pip-uninstall-a8oa_3mo/mmdet.egg-link
Rolling /home/yu/anaconda3/envs/solo/lib/python3.7/site-packages/easy-install.pth back to previous state
ERROR: Command errored out with exit status 1: /home/yu/anaconda3/envs/solo/bin/python -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/home/yu/work/202102/SOLO/setup.py’"’"’; file=’"’"’/home/yu/work/202102/SOLO/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ develop --no-deps Check the logs for full command output.

解决方法

在anconda的虚拟环境下,添加cuda路径:

export CUDA_HOME = /usr/local/cuda-10.1

猜你喜欢

转载自blog.csdn.net/y459541195/article/details/114037764