Ask Your Question
0

Titan V - Hanging on cuda::CascadeClassifier::detectMultiScale

asked 2018-02-26 13:20:07 -0500

logidelic gravatar image

updated 2018-02-26 14:30:19 -0500

I am trying to get my software working on a Titan V (on Ubuntu 17) but am running into a strange issue. Everything works fine on a GTX1080 (even on the same computer), but if I swap for the Titan V (and install appropriate drivers, etc), my code hangs when it calls cv::cuda::CascadeClassifier::detectMultiScale.

During the hang, nvidia-smi shows that GPU is being used. Also, the system feels noticably sluggish while this is going on. Nevertheless, the app will hang forever at that call until I kill it.

I have tried CUDA 8 as well as CUDA 9, and OpenCV 3.3.1 as well as OpenCV 3.4. Other GPU ops appear to work correctly, so not everything is broken.

Here is my code:

// https://github.com/opencv/opencv/blob/master/data/haarcascades_cuda/haarcascade_frontalface_alt.xml
cv::Ptr<cv::cuda::CascadeClassifier> faceDetectorCv = cv::cuda::CascadeClassifier::create("haarcascade_frontalface_alt.xml");

// img is some valid image loaded into a Mat
auto cvGpuImg = cv::cuda::GpuMat(img);
cv::cuda::GpuMat gpuRects;

// Hangs at this call!
faceDetectorCv->detectMultiScale(cvGpuImg, gpuRects);

As I say, this works correctly on a GTX card...

Any help would be appreciated!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-02-27 05:05:53 -0500

Thats quite understandable. Your GTX1080i uses compute capability 6.1 while the Titan V uses compute capabiltiy 7.0. This is not enabled by default in OpenCV yet (the card is just to god dam new), which means your VOLTA architecture is officially not supported yet.

It is even so new that official CUDA compute capability page does not yet mention the card: https://developer.nvidia.com/cuda-gpus

My suggestion, use CUDA9 (CUDA8 does not support 7.0 compute capability) and try specifying the compute capability explicitly when building OpenCV yourself. However I expect some issues to turn up once you do this.

edit flag offensive delete link more

Comments

1

Thanks for the response! I'm at this again, trying to get this working, but still no luck. I built using:

cmake -DCUDA_GENERATION="Volta" -DCUDA_ARCH_BIN="7.0" -DCUDA_ARCH_PTX="7.0" ..

The build completes successfully (OpenCV 3.4.1), but I still have the same issue with opencv hanging on detectMultiScale.

One thing I notice during cmake is the following message:

--   NVIDIA CUDA:                   YES (ver 9.1, CUFFT CUBLAS)
--     NVIDIA GPU arch:             70
--     NVIDIA PTX archs:

Is it normal that the PTX archs list is empty here?

Any ideas of what I can try?

Thanks again!

logidelic gravatar imagelogidelic ( 2018-03-22 10:57:17 -0500 )edit

Hmm I am afraid the checks for 7.0 are not included officially in OpenCV and thus it does not accept it... might be time to get someone into this with more experience. @mshabunin can you help maybe?

StevenPuttemans gravatar imageStevenPuttemans ( 2018-03-23 05:26:24 -0500 )edit
1

Sorry, I've no experience with CUDA either. You can start reading cmake scripts from here to determine what is wrong: https://github.com/opencv/opencv/blob...

mshabunin gravatar imagemshabunin ( 2018-03-24 03:00:42 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-02-26 13:20:07 -0500

Seen: 258 times

Last updated: Feb 27 '18