dnn setup problem
Hello,
I just upgraded my system to a new nvidea graphic card(gtx 1050 TI - windows7) and my example code which was reading a darknet model started crashing. The same program was running fine before and also still runs fine in the cloud(no gpu).
I am assuming something is wrong with my open-cl runtime? Any suggestions on this could be helpful. Thx a lot(i always run into complicated things) + Greetings, Holger
String imageFilePath = "C:\\development\\opencvjava\\test.png";
String modelConfiguration = "C:\\development\\opencvjava\\voc.cfg";
String modelBinary = "C:\\development\\opencvjava\\yolov2-voc.weights";
try {
classNames = Files.readAllLines(Paths.get("C:\\development\\opencvjava\\voc.names"));
} catch (IOException e) {
throw new RuntimeException(e);
}
// import the Caffe model
net = readNetFromDarknet(modelConfiguration, modelBinary);
System.err.println("Hello cloud---");
Mat img = imread(imageFilePath);
cvtColor(img, img, Imgproc.COLOR_BGRA2BGR);
//read in blob
Mat blob = blobFromImage(img, 1 / 255.F, new Size(416, 416), new Scalar(0), true, false);
net.setInput(blob);
// classify the image by applying the blob on the net
long start = System.currentTimeMillis();
//here program crashes
Mat detectionMat = net.forward();//compute output
long end = System.currentTimeMillis();
System.err.println("net detection took: "+(end-start)+"ms");
Output
Process finished with exit code -1073740791 (0xC0000409)
https://developer.nvidia.com/opencl "OpenCL support is included in the latest NVIDIA GPU drivers, available at www.nvidia.com/drivers"
So maybe the opencl version i got via the driver is incompatible? I am using open cv 3.4.1 binary.
A Restart fixed this(hand on head) But the detection times are now way worse than before (same machine - only new graphic card)
Before 257ms
Now 1569ms
I got the same hardware- same program - only new graphic card. I dont really understand this behaviour, can someone comment on this please? Is open cl deciding to use my gpu and its still to weak?
I wil try to further diagone - when downloading some sample from nvia and executing them i get.
C:\Users\Holger\Downloads\oclBandwidthTest\NVIDIA GPU Computing SDK\OpenCL\bin\Win32\Debug\oclBandwidthTest.exe Starting...
WARNING: NVIDIA OpenCL platform not found - defaulting to first platform! Error -1 in clGetDeviceIDs call !!!
I will try to get this to work and hope the opencv things fix with it.
OpenCL SDK samples included with NVIDIA GPU Computing SDK require a GPU with CUDA Compute Architecture to run properly. For a complete list of CUDA-Architecture compute-enabled GPUs, see the list online at: http://www.nvidia.com/object/cuda_lea...
https://developer.nvidia.com/cuda-gpusgtx 1050 is listed, but not gtx 1050 TI maybe thats the reason.
https://www.geforce.com/hardware/desk... states that cuda is supported - i will try download cuda sdk. Then i will compile with vs studio and try to get nvidea open cl example running.
Uiuiui
@holger, your code sample doesn't use OpenCL backend of dnn.
yes u are right and thank you for response, pasted wrong code - heres the current code - still my problem
Had problem pasting - here the current code
Output is
my cuda sdk in the meantime means
Running on...
Device 0: GeForce GTX 1050 Ti Quick Mode
Host to Device Bandwidth, 1 Device(s) PINNED Memory Transfers Transfer Size (Bytes) Bandwidth(MB/s) 33554432 5368.1
Device to Host Bandwidth, 1 Device(s) PINNED Memory Transfers Transfer Size (Bytes) Bandwidth(MB/s) 33554432 5306.2
Device to Device Bandwidth, 1 Device(s) PINNED Memory Transfers Transfer Size (Bytes) Bandwidth(MB/s) 33554432 95144.6
Result = PASS
maybe compiling opencv could help - on ubuntu is was not that difficult.