I’m trying to utilize GPU for quadratic optimization problem, but the error is as follows:
error Traceback (most recent call last)
in () 38 prev_src_image_example = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) 39 src_image_example = cv2.cuda_GpuMat() —> 40 src_image_example.upload(prev_src_image_example) 41 clahe = cv2.cuda.createCLAHE(clipLimit=5.0, tileGridSize=(8, 8)) 42 dst = clahe.apply(src_image_example, cv2.cuda_Stream.Null())
error: OpenCV(4.1.2) /io/opencv/modules/core/include/opencv2/core/private.cuda.hpp:109: error: (-216:No CUDA support) The library is compiled without CUDA support in function ‘throw_no_cuda’
I’m using Colab’s GPU resource but don’t get why it fails. Please, HELP!
OpenCV can be compiled with or without CUDA support. If you compile it without CUDA support, or if you install a version of OpenCV that is compiled without CUDA support, and then you try to use a feature that depends on CUDA support, like:
GpuMat or cv2.cuda…
you will get this error. The solution is to switch to a different OpenCV install that has been compiled with CUDA, or to modify the program you are running so that it does not use CUDA features in OpenCV.
OpenCV and Colab are not NVIDIA products or resources, so that is about as far as I can go.
How about the following CUDA version then:
Sat Apr 17 08:13:01 2021
±----------------------------------------------------------------------------+
| NVIDIA-SMI 460.67 Driver Version: 460.32.03 CUDA Version: 11.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 Tesla T4 Off | 00000000:00:04.0 Off | 0 |
| N/A 35C P8 9W / 70W | 0MiB / 15109MiB | 0% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+
±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
±----------------------------------------------------------------------------+
This has basically nothing to do with your CUDA version. It has to do with your OpenCV. Changing your CUDA install won’t change this at all.
This is my OpenCV version: 4.1.2
Do you mean that I have to upgrade it? Which version is compatible with CUDA?