codeproject / CodeProject.AI-Server

CodeProject.AI Server is a self contained service that software developers can include in, and distribute with, their applications in order to augment their apps with the power of AI.
Other
635 stars 143 forks source link

License Plate Reader 3.0.2 GPU Libraries: not installed #96

Closed onlineapps-cloud closed 5 months ago

onlineapps-cloud commented 6 months ago

Describe the bug hi, i installed License Plate Reader from codeproject ai, but when i want to run on GPU, i get in logs that GPU module not installed, how to install needed module manually?

Expected behavior i expect to to run License Plate Reader on GPU.

Additional context system info:

Server version:   2.5.4
System:           Linux
Operating System: Linux (Ubuntu 22.04)
CPUs:             Intel(R) Core(TM) i3-9100F CPU @ 3.60GHz (Intel)
                  1 CPU x 4 cores. 4 logical processors (x64)
GPU (Primary):    NVIDIA GeForce GTX 1070 (8 GiB) (NVIDIA) 
                  Driver: 535.161.07, CUDA: 12.2 (up to: 12.2), Compute: 6.1, cuDNN: 
System RAM:       8 GiB
Platform:         Linux
BuildConfig:      Release
Execution Env:    Native (SSH)
Runtime Env:      Production
.NET framework:   .NET 7.0.17
Default Python:   3.10
Go Version:
Video adapter info:
  Device 1234:
    Driver Version     
    Video Processor    
   GP104 [GeForce GTX 1070] (rev a1):
    Driver Version     
    Video Processor
System GPU info:
  GPU 3D Usage       0%
  GPU RAM Usage      83 MiB
Global Environment variables:
  CPAI_APPROOTPATH = <root>
  CPAI_PORT        = 32168

log from switching on GPU :

17:36:20:Update ALPR. Setting EnableGPU=true
17:36:20:Restarting License Plate Reader to apply settings change
17:36:20:Sending shutdown request to python3/ALPR
17:36:20:Client request 'Quit' in queue 'alpr_queue' (...e44747)
17:36:20:Request 'Quit' dequeued from 'alpr_queue' (...e44747)
17:36:20:License Plate Reader: Retrieved alpr_queue command 'Quit'
17:36:31:ALPR_adapter.py: License Plate Reader started.
17:36:31:Module ALPR has shutdown
17:36:31:ALPR_adapter.py: has exited
17:36:53:ALPR went quietly
17:36:53:
17:36:53:Running module using: /usr/bin/codeproject.ai-server-2.5.4/modules/ALPR/bin/linux/python38/venv/bin/python3
17:36:53:Starting /usr...es/ALPR/bin/linux/python38/venv/bin/python3 "/usr...server-2.5.4/modules/ALPR/ALPR_adapter.py"
17:36:53:
17:36:53:Attempting to start ALPR with /usr/bin/codeproject.ai-server-2.5.4/modules/ALPR/bin/linux/python38/venv/bin/python3 "/usr/bin/codeproject.ai-server-2.5.4/modules/ALPR/ALPR_adapter.py"
17:36:53:Module 'License Plate Reader' 3.0.2 (ID: ALPR)
17:36:53:Valid:         True
17:36:53:Module Path:   <root>/modules/ALPR
17:36:53:AutoStart:     True
17:36:53:Queue:         alpr_queue
17:36:53:Runtime:       python3.8
17:36:53:Runtime Loc:   Local
17:36:53:FilePath:      ALPR_adapter.py
17:36:53:Pre installed: False
17:36:53:Start pause:   3 sec
17:36:53:Parallelism:   0
17:36:53:LogVerbosity:
17:36:53:Platforms:     all
17:36:53:GPU Libraries: not installed
17:36:53:GPU Enabled:   enabled
17:36:53:Accelerator:
17:36:53:Half Precis.:  enable
17:36:53:Environment Variables
17:36:53:AUTO_PLATE_ROTATE            = True
17:36:53:MIN_COMPUTE_CAPABILITY       = 6
17:36:53:MIN_CUDNN_VERSION            = 7
17:36:53:OCR_OPTIMAL_CHARACTER_HEIGHT = 60
17:36:53:OCR_OPTIMAL_CHARACTER_WIDTH  = 30
17:36:53:OCR_OPTIMIZATION             = true
17:36:53:PLATE_CONFIDENCE             = 0.7
17:36:53:PLATE_RESCALE_FACTOR         = 2
17:36:53:PLATE_ROTATE_DEG             = 0
17:36:53:
17:36:53:Started License Plate Reader module
17:36:56:ALPR_adapter.py: Running init for License Plate Reader

Installation Log:

2024-03-25 13:37:51: Setting verbosity to quiet
    2024-03-25 13:37:52:              Installing CodeProject.AI Analysis Module                
    2024-03-25 13:37:52: ======================================================================
    2024-03-25 13:37:52:                    CodeProject.AI Installer                           
    2024-03-25 13:37:52: ======================================================================
    2024-03-25 13:37:52: 67.00 GiB of 100.01 GiB available on linux
    2024-03-25 13:37:52: Installing xz-utils...
    2024-03-25 13:37:52: WARNING: 
    2024-03-25 13:37:52: apt does not have a stable CLI interface. WARNING: Use with caution in scripts.
    2024-03-25 13:37:52: apt 
    2024-03-25 13:37:52: does not have a stable CLI interface. Use with caution in scripts.
    2024-03-25 13:37:52: Hit:1 http://ro.archive.ubuntu.com/ubuntu jammy InRelease
    2024-03-25 13:37:52: Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
    2024-03-25 13:37:52: General CodeProject.AI setup                                          
    2024-03-25 13:37:52: Setting permissions on downloads folder...Done
    2024-03-25 13:37:52: Setting permissions on runtimes folder...Done
    2024-03-25 13:37:52: Setting permissions on persisted data folder...Done
    2024-03-25 13:37:52: GPU support                                                           
    2024-03-25 13:37:52: CUDA (NVIDIA) Present: Yes (CUDA 11.5, No cuDNN found)
    2024-03-25 13:37:52: ROCm (AMD) Present:    Hit:3 http://ro.archive.ubuntu.com/ubuntu jammy-updates InRelease
    2024-03-25 13:37:52: No
    2024-03-25 13:37:52: MPS (Apple) Present:   No
    2024-03-25 13:37:52: Reading module settingsHit:4 http://ro.archive.ubuntu.com/ubuntu jammy-backports InRelease
    2024-03-25 13:37:52: Hit:5 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease
    2024-03-25 13:37:53: ....Reading package lists......Done
    2024-03-25 13:37:53: Processing module ALPR 3.0.2                                          
    2024-03-25 13:37:53: Installing Python 3.8
    2024-03-25 13:37:53: Python 3.8 is already installed
    2024-03-25 13:37:54: Ensuring PIP in base python install...
    2024-03-25 13:37:54: Building dependency tree...
    2024-03-25 13:37:54: Reading state information...
    2024-03-25 13:37:54: All packages are up to date.
    2024-03-25 13:38:03:   done
    2024-03-25 13:38:08: Upgrading PIP in base python install... done
    2024-03-25 13:38:08: Installing Virtual Environment tools for Linux...
    2024-03-25 13:38:09: Searching for python3-pip python3-setuptools python3.8...All good.
    2024-03-25 13:38:12: Creating Virtual Environment (Local)... Done
    2024-03-25 13:38:12: Checking for Python 3.8...(Found Python 3.8.18) All good
    2024-03-25 13:38:15: Upgrading PIP in virtual environment... done
    2024-03-25 13:38:17: Installing updated setuptools in venv... Done
    2024-03-25 13:38:17: deb http://security.ubuntu.com/ubuntu focal-security main
    2024-03-25 13:38:38: Searching for libssl1.1...installing...   Done
    2024-03-25 13:38:39: Ensuring symlinks are created...Done
    2024-03-25 13:38:42: Downloading OCR models...Expanding... Done.
    2024-03-25 13:38:42: Moving contents of ocr-en-pp_ocrv4-paddle.zip to paddleocr...done.
    2024-03-25 13:38:42: Installing Python packages for License Plate Reader
    2024-03-25 13:38:42: Installing GPU-enabled libraries: No
    2024-03-25 13:38:42: Searching for python3-pip...All good.
    2024-03-25 13:38:43: Ensuring PIP compatibility... Done
    2024-03-25 13:38:43: Python packages will be specified by requirements.linux.txt
    2024-03-25 13:39:38:   - Installing PaddelPaddle, the Deep Learning platform... (✅ checked) Done
    2024-03-25 13:42:19:   - Installing PaddleOCR, the OCR toolkit based on PaddlePaddle... (✅ checked) Done
    2024-03-25 13:42:27:   - Installing imutils, the image utilities library... (✅ checked) Done
    2024-03-25 13:42:28:   - Installing Pillow, a Python Image Library...Already installed
    2024-03-25 13:42:28:   - Installing OpenCV, the Computer Vision library for Python...Already installed
    2024-03-25 13:42:29:   - Installing NumPy, a package for scientific computing...Already installed
    2024-03-25 13:42:29: Installing Python packages for the CodeProject.AI Server SDK
    2024-03-25 13:42:30: Searching for python3-pip...All good.
    2024-03-25 13:42:32: Ensuring PIP compatibility... Done
    2024-03-25 13:42:32: Python packages will be specified by requirements.txt
    2024-03-25 13:42:33:   - Installing Pillow, a Python Image Library...Already installed
    2024-03-25 13:42:34:   - Installing Charset normalizer...Already installed
    2024-03-25 13:42:46:   - Installing aiohttp, the Async IO HTTP library... (✅ checked) Done
    2024-03-25 13:42:51:   - Installing aiofiles, the Async IO Files library... (✅ checked) Done
    2024-03-25 13:42:56:   - Installing py-cpuinfo to allow us to query CPU info... (✅ checked) Done
    2024-03-25 13:42:57:   - Installing Requests, the HTTP library...Already installed
    2024-03-25 13:42:57: Executing post-install script for License Plate Reader
    2024-03-25 13:42:57: Applying PaddleOCR patch
    2024-03-25 13:43:01: Self test: Self-test passed
    2024-03-25 13:43:01: Module setup time 00:05:09
    2024-03-25 13:43:01:                 Setup complete                                        
    2024-03-25 13:43:01: Total setup time 00:05:09

0
Object Detection (YOLOv5 6.2) 1.9.1
Started
GPU (CUDA)
0
Sound Classifier (TensorFlow) 1.2.0
Started
CPU
0
Super Resolution 1.9.1
Started
CPU
0
onlineapps-cloud commented 6 months ago

after rebooting machine, i get this error:

Trace ALPR_adapter.py: Running init for License Plate Reader
Error sound_classification_adapter.py: 2024-03-25 15:58:25.404707: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Error sound_classification_adapter.py: WARNING:tensorflow:From /usr/bin/codeproject.ai-server-2.5.4/modules/SoundClassifierTF/bin/linux/python39/venv/lib/python3.9/site-packages/tensorflow/python/compat/v2_compat.py:108: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Error sound_classification_adapter.py: Instructions for updating:
Error sound_classification_adapter.py: non-resource variables are not supported in the long term
Error sound_classification_adapter.py: 2024-03-25 15:58:36.759006: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:901] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
Error sound_classification_adapter.py: 2024-03-25 15:58:37.781598: W tensorflow/core/common_runtime/gpu/gpu_device.cc:2256] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Error sound_classification_adapter.py: Skipping registering GPU devices..
onlineapps-cloud commented 6 months ago

strange is that nvidia-smi say that i have installed cuda 12, but python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))" say that i don't have cuda installed

root@ubuntu:/home/ubuntu# python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
2024-03-25 16:43:13.892817: I external/local_tsl/tsl/cuda/cudart_stub.cc:32] Could not find cuda drivers on your machine, GPU will not be used.
2024-03-25 16:43:15.158724: I external/local_tsl/tsl/cuda/cudart_stub.cc:32] Could not find cuda drivers on your machine, GPU will not be used.
2024-03-25 16:43:18.191431: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-03-25 16:43:23.652032: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-03-25 16:43:27.289394: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:998] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2024-03-25 16:43:27.294061: W tensorflow/core/common_runtime/gpu/gpu_device.cc:2251] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
[]
root@ubuntu:/home/ubuntu# nvidia-smi
Mon Mar 25 16:43:45 2024       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.161.07             Driver Version: 535.161.07   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce GTX 1070        Off | 00000000:06:10.0 Off |                  N/A |
|  0%   29C    P8              11W / 250W |      4MiB /  8192MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+
onlineapps-cloud commented 6 months ago
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
2024-03-25 17:33:34.414644: I external/local_tsl/tsl/cuda/cudart_stub.cc:32] Could not find cuda drivers on your machine, GPU will not be used.
2024-03-25 17:33:34.470019: I external/local_tsl/tsl/cuda/cudart_stub.cc:32] Could not find cuda drivers on your machine, GPU will not be used.
2024-03-25 17:33:34.684616: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-03-25 17:33:35.693581: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-03-25 17:33:37.085932: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:998] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2024-03-25 17:33:38.488526: W tensorflow/core/common_runtime/gpu/gpu_device.cc:2251] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
[]
ubuntu@ubuntu:~$ pip install tensorrt
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: tensorrt in ./.local/lib/python3.9/site-packages (8.6.1.post1)
onlineapps-cloud commented 5 months ago

in finally i fix all problems with codeproject image

kevinruffus commented 4 months ago

Sorry to necro this, but how? I'm running a 1080 in my server (had a spare) and I get those errors on every module except the basic YOLOv5 6.2, which actually does run using the GPU.

onlineapps-cloud commented 4 months ago

Sorry to necro this, but how? I'm running a 1080 in my server (had a spare) and I get those errors on every module except the basic YOLOv5 6.2, which actually does run using the GPU.

check my repply https://github.com/codeproject/CodeProject.AI-Server/issues/89#issuecomment-2064816912

kevinruffus commented 4 months ago

The link seems to be broken, unfortunately.

onlineapps-cloud commented 4 months ago

my comment link is broken or mega.nz link? because i checked right now, and all links work as expected.

kevinruffus commented 4 months ago

You're right. The site was being blocked by my router. I'll have to dig into that later.