Ask Your Question
0

GPU API Call error, invalid configuration argument when using CUDA

asked 2018-04-02 20:12:14 -0600

luisruiz gravatar image

updated 2018-04-06 01:45:12 -0600

I compiled OpenCV3 in Windows 10 with CUDA, the compilation was succesful. I am using:

  • Visual Studio 2015 in Windows 10
  • CUDA 9.1
  • NVIDIA Quadro P5000
  • OpenCV 3.4.1

It compiles and I am able to do image processing without CUDA. When I use CUDA, I can detect the NVIDIA device and all its properties but I cannot call any image processing function. Maybe I am missing some configuration. I debugged it and found that it fails when checking for the block and grid configuration of the card, those values are passed as the Policy to the transform function but are hardcoded. It's there a way to set those values at runtime?

When I compiled OpenCV I set CUDA_ARCH_BIN and CUDA_ARCH_PTX to 6.1. Now, 6.1 is was not available before in CUDA_ARCH_BIN, but as it can be seen in the error below it is supported by the NVIDIA card I am using.

Edit 1

I still cannot run the threshold code I have.

On the other hand, opencv_test_cudaarithm can run, altough I have some errors. These are the values of the variables involved in one call of the threshold funcion.

size:[128 x 128]
type:0
channel:1
threshOp:0
useRoi:0

This are the errors after running opencv_test_cudaarithm:

[----------] Global test environment tear-down
[==========] 11613 tests from 67 test cases ran. (15629 ms total)
[  PASSED  ] 11595 tests.
[  FAILED  ] 18 tests, listed below:
[  FAILED  ] CUDA_Arithm/Bitwise_Scalar.Or/8, where GetParam() = (Quadro P5000, 128x128, CV_32S, Channels(4))
[  FAILED  ] CUDA_Arithm/Bitwise_Scalar.Or/17, where GetParam() = (Quadro P5000, 113x113, CV_32S, Channels(4))
[  FAILED  ] CUDA_Arithm/Bitwise_Scalar.And/8, where GetParam() = (Quadro P5000, 128x128, CV_32S, Channels(4))
[  FAILED  ] CUDA_Arithm/Bitwise_Scalar.And/17, where GetParam() = (Quadro P5000, 113x113, CV_32S, Channels(4))
[  FAILED  ] CUDA_Arithm/Bitwise_Scalar.Xor/8, where GetParam() = (Quadro P5000, 128x128, CV_32S, Channels(4))
[  FAILED  ] CUDA_Arithm/Bitwise_Scalar.Xor/17, where GetParam() = (Quadro P5000, 113x113, CV_32S, Channels(4))
[  FAILED  ] CUDA_Arithm/PolarToCart.Accuracy/0, where GetParam() = (Quadro P5000, 128x128, AngleInDegrees(false), whole matrix)
[  FAILED  ] CUDA_Arithm/PolarToCart.Accuracy/1, where GetParam() = (Quadro P5000, 128x128, AngleInDegrees(false), sub matrix)
[  FAILED  ] CUDA_Arithm/PolarToCart.Accuracy/2, where GetParam() = (Quadro P5000, 128x128, AngleInDegrees(true), whole matrix)
[  FAILED  ] CUDA_Arithm/PolarToCart.Accuracy/3, where GetParam() = (Quadro P5000, 128x128, AngleInDegrees(true), sub matrix)
[  FAILED  ] CUDA_Arithm/PolarToCart.Accuracy/4, where GetParam() = (Quadro P5000, 113x113, AngleInDegrees(false), whole matrix)
[  FAILED  ] CUDA_Arithm/PolarToCart.Accuracy/5, where GetParam() = (Quadro P5000, 113x113, AngleInDegrees(false), sub matrix)
[  FAILED  ] CUDA_Arithm/PolarToCart.Accuracy/6, where GetParam() = (Quadro P5000, 113x113, AngleInDegrees(true), whole matrix)
[  FAILED  ] CUDA_Arithm/PolarToCart.Accuracy/7, where GetParam() = (Quadro P5000, 113x113, AngleInDegrees(true), sub matrix)
[  FAILED  ] CUDA_Arithm/MeanStdDev.Async/0, where GetParam() = (Quadro P5000, 128x128, whole matrix)
[  FAILED  ] CUDA_Arithm/MeanStdDev.Async/1, where GetParam() = (Quadro P5000, 128x128, sub matrix)
[  FAILED  ] CUDA_Arithm/MeanStdDev.Async/2, where GetParam() = (Quadro P5000, 113x113, whole matrix)
[  FAILED  ] CUDA_Arithm/MeanStdDev.Async/3, where GetParam() = (Quadro P5000, 113x113, sub matrix)

Info

This is the output with the error I get:

CUDA with OPENCV test program
<1> CUDA device(s) found
[CUDA Device 0]
name: Quadro P5000 ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-04-05 08:02:54 -0600

updated 2018-04-05 08:03:42 -0600

I don't have a windows 10 machine to test on, but I am able to call cuda::threshold in OpenCV 3.4.1 on windows 8.1 without any issues.

Did you build a Debug configuration of OpenCV with -DINSTALL_TESTS=ON? If so, do you get the same error when you make opencv_test_cudaarithm the start up project, place a breakpoint at line 2564 in the below file, and run through the debugger? https://github.com/opencv/opencv/blob...

If you have a Debug config, have you inspected the line 318 of transform.hpp when the error is observed?

Did you compile the OpenCV 3.4.1 tag or a newer version?

edit flag offensive delete link more

Comments

I am compiling 3.4.1. Yes I already check transform.hpp and it seems that I have to configure something.

luisruiz gravatar imageluisruiz ( 2018-04-06 01:47:07 -0600 )edit

As the test worked have you tried your code with the same parameters which you mentioned above to see if it works? If it does what is the difference between the test params and yours?

What are the dimensions of your image and the values of grid, block, rows, cols in the below (transform.hpp, line 318) when you get your error?

 transformSmart<Policy::shift><<<grid, block, 0, stream>>>(src, dst, op, mask, rows, cols);
cudawarped gravatar imagecudawarped ( 2018-04-09 04:07:03 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-04-02 20:12:14 -0600

Seen: 1,899 times

Last updated: Apr 06 '18