hikopensource / DAVAR-Lab-OCR

OCR toolbox from Davar-Lab
Apache License 2.0
732 stars 156 forks source link

安装时遇到问题 fatal error: cuda_runtime_api.h: No such file or directory #45

Open itaizy opened 2 years ago

itaizy commented 2 years ago

running develop running egg_info writing davarocr.egg-info/PKG-INFO writing dependency_links to davarocr.egg-info/dependency_links.txt writing top-level names to davarocr.egg-info/top_level.txt reading manifest file 'davarocr.egg-info/SOURCES.txt' writing manifest file 'davarocr.egg-info/SOURCES.txt' running build_ext Creating /home/voyager/anaconda3/envs/torch_gpu/lib/python3.6/site-packages/davarocr.egg-link (link to .) davarocr 0.3.1 is already the active version in easy-install.pth

Installed /home/voyager/ocr/DAVAR-Lab-OCR-main Processing dependencies for davarocr==0.3.1 Finished processing dependencies for davarocr==0.3.1 10 mkdir: cannot create directory ‘build’: File exists -- cuda found TRUE -- Building shared library with GPU support -- Configuring done -- Generating done -- Build files have been written to: /home/voyager/ocr/DAVAR-Lab-OCR-main/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/build [ 11%] Linking CXX shared library libwarpctc.so [ 33%] Built target warpctc [ 44%] Linking CXX executable test_cpu [ 66%] Built target test_cpu [ 77%] Linking CXX executable test_gpu [100%] Built target test_gpu running install running bdist_egg running egg_info writing warpctc_pytorch.egg-info/PKG-INFO writing dependency_links to warpctc_pytorch.egg-info/dependency_links.txt writing top-level names to warpctc_pytorch.egg-info/top_level.txt /home/voyager/anaconda3/envs/torch_gpu/lib/python3.6/site-packages/torch/utils/cpp_extension.py:381: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) reading manifest file 'warpctc_pytorch.egg-info/SOURCES.txt' writing manifest file 'warpctc_pytorch.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py running build_ext building 'warpctc_pytorch._warp_ctc' extension gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/voyager/ocr/DAVAR-Lab-OCR-main/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings/include -I/home/voyager/anaconda3/envs/torch_gpu/lib/python3.6/site-packages/torch/include -I/home/voyager/anaconda3/envs/torch_gpu/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/voyager/anaconda3/envs/torch_gpu/lib/python3.6/site-packages/torch/include/TH -I/home/voyager/anaconda3/envs/torch_gpu/lib/python3.6/site-packages/torch/include/THC -I:/usr/local/cuda-10.2/include -I/home/voyager/anaconda3/envs/torch_gpu/include/python3.6m -c src/binding.cpp -o build/temp.linux-x86_64-3.6/src/binding.o -std=c++14 -fPIC -DWARPCTC_ENABLE_GPU -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=_warp_ctc -D_GLIBCXX_USE_CXX11_ABI=0 cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ In file included from src/binding.cpp:9:0: /home/voyager/anaconda3/envs/torch_gpu/lib/python3.6/site-packages/torch/include/ATen/cuda/CUDAContext.h:5:30: fatal error: cuda_runtime_api.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1

你好,我在安装的时候,遇到“fatal error: cuda_runtime_api.h: No such file or directory” 问题,可以帮忙查看一下吗? 我的环境是:

GPU: RTX2080 CUDA: 10.2 Python: Anaconda env Python3.6 mmcv-full: 1.3.4 Torch: '1.10.1+cu102' Opencv-Python: 4.5.5

itaizy commented 2 years ago

这个文件是确定存在的

qiaoliang6 commented 2 years ago

warp_ctc由于是一个第三方库,它的安装跟cuda版本有很大的关系,安装问题可以看看DAVAR-Lab-OCR/docs/FAQ.md中的相关说明能不能解决。

这个问题如果暂时无法解决,如果你不使用text_recognition中的CTC模型,可以简单的将相关的引用从init.py中去掉,不会影响其他模块的运营。