Clahe.cu:398: error: (-217:Gpu API call) invalid configuration argument in function ‘transform’

Dear all,

I run into errors for testing testing opencv cuda.

Python 3.7.1 (default, Dec 14 2018, 19:28:38)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type “help”, “copyright”, “credits” or “license” for more information.

img = cv2.imread(“image.png”, cv2.IMREAD_GRAYSCALE)
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘cv2’ is not defined
import cv2
img = cv2.imread(“image.png”, cv2.IMREAD_GRAYSCALE)
libpng warning: Application built with libpng-1.6.35 but running with 1.5.13
src = cv2.cuda_GpuMat()
src.upload(img)
clahe = cv2.cuda.createCLAHE(clipLimit=5.0, tileGridSize=(8, 8))
dst = clahe.apply(src, cv2.cuda_Stream.Null())
Traceback (most recent call last):
File “”, line 1, in
cv2.error: OpenCV(4.5.1) /usr/public/pytorch/source/OpenCV-gpu/opencv_contrib-4.5.1/modules/cudaimgproc/src/cuda/clahe.cu:398: error: (-217:Gpu API call) invalid configuration argument in function ‘transform’

I build OpenCV (4,5.1) with cuda10.0/toolkit/10.0.130 , gcc7.4 and Anaconda on linux cluster successfully. GPU is NVIDIA V100, I did cmake with CUDA_ARCH_BIN=7.0

My basic configuration file as below:

– Unavailable: alphamat cnn_3dobj cvv freetype java julia matlab ovis python2 sfm viz

  • NVIDIA CUDA: YES (ver 10.0, CUFFT CUBLAS FAST_MATH)
    – NVIDIA GPU arch: 70
    – NVIDIA PTX archs:
    – cuDNN: YES (ver 7.6.5)
    – OpenCL: YES (no extra features)
    – Include path: /opencv-4.5.1/3rdparty/include/opencl/1.2
    – Link libraries: Dynamic load
    – Python 3:
    /anaconda3/bin/python3 (ver 3.7.1)
    – Libraries: /anaconda3/lib (ver 3.7.1)
    – numpy: /anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy (ver 1.15.4)
    – install path: lib/python3.7/site-packages/cv2/python-3.7

    – Python (for build): /anaconda3/bin/python3
    – Install to: /anaconda3

Any suggestion for fixing this problem? Appreciate your help!

Thanks!

Wei

any suggestion? I can’t fix this issue.

Should I lower version of OpenCV 4.20? The problem is I don’t know what kid of changes I should do. Wei

Hi,

We test it but doesn’t meet the same error as you shared.

>>> import cv2
>>> cv2.__version__
'4.5.1'
>>> img = cv2.imread("/opt/nvidia/vpi1/samples/assets/kodim08.png",cv2.IMREAD_GRAYSCALE)
>>> src = cv2.cuda_GpuMat()
>>> src.upload(img)
>>> clahe = cv2.cuda.createCLAHE(clipLimit=5.0, tileGridSize=(8, 8))
>>> dst = clahe.apply(src, cv2.cuda_Stream.Null())
>>> dst
<cuda_GpuMat 0x7f4e7d76f0>

Could you try to rebuild the OpenCV with this script to see if it works? install_opencv4.5.0_Jetson.sh (1.9 KB)

./install_opencv4.5.0_Jetson.sh <workspace>

Thanks.

Hi,

Since this issue is more related to the OpenCV.
It’s recommended to check the OpenCV team directly:

Thanks.

According your scrip file, I rebuild it from scratch with Anaconda3 (python 3.8) . It works. Thanks a lot for your help!