CUDA driver and runtime could not be initialized with python celery environment
See original GitHub issue直接执行
python3 tools/infer/predict_system.py --image_dir="./doc/imgs/11.jpeg" --det_model_dir="./inference/ch_ppocr_server_v1.1_det_infer/" --rec_model_dir="./inference/ch_ppocr_server_v1.1_rec_infer/" --cls_model_dir="./inference/ch_ppocr_mobile_v1.1_cls_infer/" --use_angle_cls=True --use_space_char=True
命令是正常的, 但是放到celery work中执行报如下错误
[2020-10-30 18:48:03,199: ERROR/ForkPoolWorker-2] Traceback (most recent call last):
File "/home/paddle/paddle-ocr/PaddleOCR-develop/celery_app/ocr_task.py", line 60, in ocr
dt_boxes, rec_res = ocr.text_system(img)
File "/home/paddle/venv/lib/python3.7/site-packages/celery/local.py", line 143, in __getattr__
return getattr(self._get_current_object(), name)
File "/home/paddle/paddle-ocr/PaddleOCR-develop/celery_app/ocr_task.py", line 42, in text_system
self._text_system = TextSystem(args)
File "/home/paddle/paddle-ocr/PaddleOCR-develop/tools/infer/predict_system.py", line 41, in __init__
self.text_detector = predict_det.TextDetector(args)
File "/home/paddle/paddle-ocr/PaddleOCR-develop/tools/infer/predict_det.py", line 80, in __init__
utility.create_predictor(args, mode="det")
File "/home/paddle/paddle-ocr/PaddleOCR-develop/tools/infer/utility.py", line 144, in create_predictor
predictor = create_paddle_predictor(config)
paddle.fluid.core_avx.EnforceNotMet:
--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
0 std::unique_ptr<paddle::PaddlePredictor, std::default_delete<paddle::PaddlePredictor> > paddle::CreatePaddlePredictor<paddle::AnalysisConfig>(paddle::AnalysisConfig const&)
1 std::unique_ptr<paddle::PaddlePredictor, std::default_delete<paddle::PaddlePredictor> > paddle::CreatePaddlePredictor<paddle::AnalysisConfig, (paddle::PaddleEngineKind)2>(paddle::AnalysisConfig const&)
2 paddle::AnalysisConfig::fraction_of_gpu_memory_for_pool() const
3 paddle::platform::EnforceNotMet::EnforceNotMet(std::__exception_ptr::exception_ptr, char const*, int)
4 std::string paddle::platform::GetTraceBackString<char const*>(char const*&&, char const*, int)
5 paddle::platform::GetCurrentTraceBackString[abi:cxx11]()
----------------------
Error Message Summary:
----------------------
ExternalError: Cuda error(3), initialization error.
[Advise: The API call failed because the CUDA driver and runtime could not be initialized. ] (at /paddle/paddle/fluid/platform/gpu_info.cc:219)
环境如下: nvcc: NVIDIA ® Cuda compiler driver Copyright © 2005-2019 NVIDIA Corporation Built on Sun_Jul_28_19:07:16_PDT_2019 Cuda compilation tools, release 10.1, V10.1.243
libcudnn.so.7.6.5
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Why am I getting 'cuMemAlloc failed: not initialized' even ...
I believe the problem you experience is related to CUDA contexts. As of CUDA 4.0 a CUDA context is required per process and...
Read more >Application — Celery 5.2.7 documentation
The application is thread-safe so that multiple Celery applications with different configurations, components, and tasks can co-exist in the same process ...
Read more >How to Setup Your Python Environment for Machine Learning ...
In this tutorial, we will cover the following steps: Download Anaconda; Install Anaconda; Start and Update Anaconda; Update scikit-learn Library ...
Read more >Accelerating Applications with CUDA C/C++ - UL HPC Tutorials
This tutorial will cover the following aspects of CUDA programming: Write, compile and run C/C++ programs that both call CPU functions and launch...
Read more >Bug listing with status RESOLVED with resolution OBSOLETE ...
... Bug:111388 - "pyfest ebuild-- python module for festival" status:RESOLVED ... Bug:181327 - "/etc/init.d/nfs script does not work in Gentoo/FreeBSD" ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
你好,请问这个问题解决了吗?
I am experiencing exactly the same with celery. Works perfectly without celery, but whenever I run my script with celery, I get:
Any updates on this possibly?