Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paddleocr gpu部署报错OSError: (External) CUDA error(3), initialization error. [Hint: 'cudaErrorInitializationError'. The API call failed because the CUDA driver and runtime could not be initialized. ] (at /paddle/paddle/fluid/platform/gpu_info.cc:355) #5344

Closed
sangwentao opened this issue Jan 25, 2022 · 2 comments
Assignees

Comments

@sangwentao
Copy link

请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem

  • 系统环境/System Environment:
    阿里云服务器,阿里云内核
  • 版本号/Version:Paddle: PaddleOCR: 问题相关组件/Related components:
    paddleocr2.3,uwsgi,nginx1.8.1,gpu T4 16G
  • 运行指令/Command Code:
    uwsgi启动:uwsgi --ini uwsgi.ini
    [uwsgi] master=true socket = 127.0.0.1:8000 module = run:app chdir = /home/yunshuo/PaddleOCR-release-2.3/ wsgi-file = /home/yunshuo/PaddleOCR-release-2.3/run.py callable = app processes=1 threads=1 stats = 127.0.0.1:9191 pidfile=uwsgi.pid touch-reload=/home/yunshuo/PaddleOCR-release-2.3 daemonize = /home/logs/flask/server.log
    之后启动nginx,
    worker_processes 1;
  • 完整报错/Complete Error Message:
    *** Starting uWSGI 2.0.19.1 (64bit) on [Tue Jan 25 14:07:16 2022] ***
    compiled with version: 9.3.0 on 02 March 2021 12:41:33
    os: Linux-5.10.60-9.al8.x86_64 Upload PaddleOCR code  #1 SMP Mon Sep 6 21:30:37 CST 2021
    nodename: xybot-gpu-001
    machine: x86_64
    clock source: unix
    pcre jit disabled
    detected number of CPU cores: 8
    current working directory: /home/yunshuo/PaddleOCR-release-2.3
    writing pidfile to uwsgi.pid
    detected binary path: /root/anaconda3/envs/ocr_python36/bin/uwsgi
    uWSGI running as root, you can use --uid/--gid/--chroot options
    *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
    chdir() to /home/yunshuo/PaddleOCR-release-2.3/
    your processes number limit is 123187
    your memory page size is 4096 bytes
    detected max file descriptor number: 65535
    lock engine: pthread robust mutexes
    thunder lock: disabled (you can enable it with --thunder-lock)
    uwsgi socket 0 bound to TCP address 127.0.0.1:8000 fd 3
    uWSGI running as root, you can use --uid/--gid/--chroot options
    *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
    Python version: 3.6.13 | packaged by conda-forge | (default, Feb 19 2021, 05:36:01) [GCC 9.3.0]
    Python main interpreter initialized at 0x563dadc964e0
    uWSGI running as root, you can use --uid/--gid/--chroot options
    *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
    python threads support enabled
    your server socket listen backlog is limited to 100 connections
    your mercy for graceful operations on workers is 60 seconds
    mapped 145840 bytes (142 KB) for 1 cores
    *** Operational MODE: single process ***
    WSGI app 0 (mountpoint='') ready in 2 seconds on interpreter 0x563dadc964e0 pid: 508015 (default app)
    mountpoint already configured. skip.
    uWSGI running as root, you can use --uid/--gid/--chroot options
    *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
    *** uWSGI is running in multiple interpreter mode ***
    spawned uWSGI master process (pid: 508015)
    spawned uWSGI worker 1 (pid: 508038, cores: 1)
    *** Stats server enabled on 127.0.0.1:9191 fd: 17 ***
    [pid: 508038|app: 0|req: 1/1] 124.160.31.180 () {44 vars in 825 bytes} [Tue Jan 25 14:07:24 2022] GET /ocr => generated 4817 bytes in 12 msecs (HTTP/1.1 200) 2 headers in 81 bytes (1 switches on core 0)
    [2022-01-25 14:08:10,024] ERROR in app: Exception on /ocr_result [POST]
    Traceback (most recent call last):
    File "/root/anaconda3/envs/ocr_python36/lib/python3.6/site-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
    File "/root/anaconda3/envs/ocr_python36/lib/python3.6/site-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "/root/anaconda3/envs/ocr_python36/lib/python3.6/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
    File "/root/anaconda3/envs/ocr_python36/lib/python3.6/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
    File "./run.py", line 90, in ocr
    box,rec,img = ocr_main(args,img)
    File "./ocr.py", line 39, in ocr_main
    text_sys = TextSystem(args)
    File "./tools/infer/predict_system.py", line 45, in init
    self.text_detector = predict_det.TextDetector(args)
    File "./tools/infer/predict_det.py", line 99, in init
    args, 'det', logger)
    File "./tools/infer/utility.py", line 283, in create_predictor
    predictor = inference.create_predictor(config)
    OSError: (External) CUDA error(3), initialization error.
    [Hint: 'cudaErrorInitializationError'. The API call failed because the CUDA driver and runtime could not be initialized. ] (at /paddle/paddle/fluid/platform/gpu_info.cc:355)

[pid: 508038|app: 0|req: 2/2] 124.160.31.180 () {48 vars in 917 bytes} [Tue Jan 25 14:07:29 2022] POST /ocr_result => generated 290 bytes in 40128 msecs (HTTP/1.1 500) 2 headers in 99 bytes (1 switches on core 0)
Tue Jan 25 14:17:59 2022 - *** /home/yunshuo/PaddleOCR-release-2.3 has been touched... grace them all !!! ***

上面是uwsgi的日志。

我单纯的用python起服务,就是python run.py启动是没有错误的,gpu是可以用的,
但是用uwsgi和nginx启动服务就会报上面的错误,我把配置文件的进程的线程都改为1也是有同样的错误。
现在不知道怎么解决,不知道是哪的问题

@tink2123
Copy link
Collaborator

在 uwsgi和nginx 环境里,验证下paddle是否能正常运行:

安装完成后您可以使用 python 或 python3 进入python解释器,输入import paddle ,再输入 paddle.utils.run_check()
如果出现PaddlePaddle is installed successfully!,说明您已成功安装。

如果paddle启动失败,可以去 Paddle repo 提交一个issue,询问下 uwsgi 和 nginx 的安装问题

@paddle-bot-old paddle-bot-old bot closed this as completed May 3, 2022
@paddle-bot-old
Copy link

paddle-bot-old bot commented May 3, 2022

Since you haven't replied for more than 3 months, we have closed this issue/pr.
If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up.
It is recommended to pull and try the latest code first.
由于您超过三个月未回复,我们将关闭这个issue/pr。
若问题未解决或有后续问题,请随时重新打开(建议先拉取最新代码进行尝试),我们会继续跟进。

an1018 pushed a commit to an1018/PaddleOCR that referenced this issue Aug 17, 2022
* fix deepsort detectors cfgs, add ppyoloe

* modify yolov3 40e

* add ppyoloe mot17half modelzoo

* add resnet embedding reid

* remove fasterfpn picodet, fix nms for higher MOTA

* add mot17 yml

* fix _base_ cfgs

* fix doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants