pipeline in linea single thread
This commit is contained in:
107
aggiornamento-2026-05-18-15-42.md
Normal file
107
aggiornamento-2026-05-18-15-42.md
Normal file
@@ -0,0 +1,107 @@
|
||||
# Aggiornamento 2026-05-18 15:42
|
||||
|
||||
## Obiettivo
|
||||
|
||||
Ripristinare OpenCV con supporto CUDA, come nel setup precedente basato sulle wheel `cudawarped/opencv-python-cuda-wheels`.
|
||||
|
||||
## Situazione iniziale
|
||||
|
||||
Dopo la reinstallazione per riavere le finestre OpenCV, lo stato era:
|
||||
|
||||
```text
|
||||
OpenCV GUI: WIN32UI
|
||||
OpenCV CUDA devices: 0
|
||||
```
|
||||
|
||||
Quindi la GUI era tornata, ma CUDA no.
|
||||
|
||||
## Installazione wheel CUDA
|
||||
|
||||
Installata la wheel:
|
||||
|
||||
```text
|
||||
https://github.com/cudawarped/opencv-python-cuda-wheels/releases/download/4.12.0.88/opencv_contrib_python-4.12.0.88-cp37-abi3-win_amd64.whl
|
||||
```
|
||||
|
||||
Motivo della scelta:
|
||||
|
||||
- il sistema ha CUDA Toolkit `v12.9`;
|
||||
- la release `4.12.0.88` e' compilata contro CUDA `12.9`;
|
||||
- la RTX 3050 ha compute capability `(8, 6)`, supportata dalla wheel.
|
||||
|
||||
## Correzione config.py
|
||||
|
||||
Dopo l'installazione, `import cv2` falliva per DLL mancanti.
|
||||
|
||||
Aggiornato:
|
||||
|
||||
```text
|
||||
C:\Python313\Lib\site-packages\cv2\config.py
|
||||
```
|
||||
|
||||
Aggiunti i path alle DLL NVIDIA presenti in:
|
||||
|
||||
```text
|
||||
C:\Python313\Lib\site-packages\nvidia\cudnn\bin
|
||||
C:\Python313\Lib\site-packages\nvidia\cublas\bin
|
||||
C:\Python313\Lib\site-packages\nvidia\cuda_runtime\bin
|
||||
C:\Python313\Lib\site-packages\nvidia\cufft\bin
|
||||
C:\Python313\Lib\site-packages\nvidia\curand\bin
|
||||
C:\Python313\Lib\site-packages\nvidia\cusolver\bin
|
||||
C:\Python313\Lib\site-packages\nvidia\cusparse\bin
|
||||
C:\Python313\Lib\site-packages\nvidia\nvjitlink\bin
|
||||
```
|
||||
|
||||
## Verifica OpenCV
|
||||
|
||||
Risultato:
|
||||
|
||||
```text
|
||||
cv2 4.12.0
|
||||
GUI: WIN32UI
|
||||
NVIDIA CUDA: YES (ver 12.9.86, CUFFT CUBLAS NVCUVID NVCUVENC)
|
||||
cuDNN: YES (ver 9.10.2)
|
||||
cuda devices: 1
|
||||
gpu resize: OK
|
||||
namedWindow: OK
|
||||
```
|
||||
|
||||
Quindi OpenCV ora ha sia GUI sia CUDA.
|
||||
|
||||
## Stato GPU complessivo
|
||||
|
||||
YOLO / Ultralytics:
|
||||
|
||||
```text
|
||||
torch_cuda True
|
||||
NVIDIA GeForce RTX 3050
|
||||
```
|
||||
|
||||
OpenCV:
|
||||
|
||||
```text
|
||||
CUDA attivo
|
||||
cuda devices 1
|
||||
```
|
||||
|
||||
PaddleOCR:
|
||||
|
||||
```text
|
||||
paddle 3.3.1
|
||||
cuda False
|
||||
device cpu
|
||||
```
|
||||
|
||||
PaddleOCR resta volutamente nel virtualenv CPU per evitare il problema precedente sulle DLL/cuDNN Paddle GPU.
|
||||
|
||||
## Nota operativa
|
||||
|
||||
Ora ha senso lavorare sui target:
|
||||
|
||||
```text
|
||||
preview/acquisizione: 24 fps
|
||||
YOLO: circa 14-15 fps
|
||||
OCR/WMS: asincrono, non deve bloccare la preview
|
||||
```
|
||||
|
||||
OpenCV CUDA non accelera automaticamente tutto il codice: serve usare esplicitamente funzioni `cv2.cuda.*` nei punti in cui conviene. Pero' ora la base CUDA e' disponibile.
|
||||
Reference in New Issue
Block a user