OpenCV Error: Gpu API call (invalid device ordinal) in allocate when running on AWS GPU Instance
Trying to run gpu-example-video_reader example on and AWS GPU instance Quad GPU running Ubuntu server 14.04, OpenCV 3.0, CUDA 7.0. I get the following message
ubuntu@ip-10-51-184-206:~/cv/build/bin$ ./gpu-example-video_reader def.mp4
libdc1394 error: Failed to initialize libdc1394
init done
opengl support available
OpenCV Error: Gpu API call (invalid device ordinal) in allocate, file /home/ubuntu/cv/modules/core/src/cuda/gpu_mat.cu, line 76
terminate called after throwing an instance of 'cv::Exception'
what(): /home/ubuntu/cv/modules/core/src/cuda/gpu_mat.cu:76: error: (-217) invalid device ordinal in function allocate
The example works fine on my local machine. Any suggestions ?
I am guessing that the AWS system has multiple GPU instances compared to your system locally. So you need to specify and select the device like explained in this SO topic.
I am seem to be having issues with the setGlDevice instead of setDevice. I think it might be somehow related to the fact that I am running the code on a Ubuntu server edition and trying to view the GL display window over X11 on my ubuntu desktop. any other suggestions welcome.
As far as my experience goes, piping OpenCV output through X11 has caused problems before. I have seen problems with that. How about not piping anything. Does your code work then?