While I using tensorflow, it can detect cuda device.
While I using dlib dnn_mmod_ex, there is one error aroused.
Error while calling cudaGetDevice(&dev) in file /home/randy/dlib/dlib/dnn/cuda_dlib.cu:26. code: 38, reason: no CUDA-capable device is detected

And I try to reinstall cuda via package manager. It seems that all is installed.


Your libraries are compiled and that means that compilation is successfull, it does not mean it will run well.
Running Dlib with CUDA support enable requires Nvidia GPU with Kepler or newer architecture (CUDA device compute compatibility 3+). It will not work on AMD/Intel/other gpu/without gpu or with old Nvidia cards
If you do not have compatible GPU on your machine, you should recompile Dlib without CUDA support and work with CPU mode or you can run your binaries on other machine...
Your GPU is too old. I should point out that the requirements for CUDA compute capability 3.0 or newer, which your card does not satisfy because it's too old, are requirements from cuDNN. So this isn't a dlib issue. Anything that uses cuDNN needs newer hardware. Here is the relevant documentation from cuDNN's manual:
cuDNN v5.1 supports NVIDIA GPUs of compute capability 3.0 and higher and requires
an NVIDIA Driver compatible with CUDA Toolkit 7.5 (CUDA Toolkit 7.0 for ARM
platforms).
So I don't know what tensorflow is doing. It probably silently disables cuDNN.
I have a pretty new GPU: Titan X (Pascal) with CUDA 8, but I am getting the same error:
@davisking @e-fominov @pencoa
face_encoder = dlib.face_recognition_model_v1(face_recognition_model)
RuntimeError: Error while calling cudaGetDevice(&the_device_id) in file /tmp/pip-build-dls8jvxk/dlib/dlib/dnn/gpu_data.cpp:178. code: 38, reason: no CUDA-capable device is detected
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:22:03_CST_2017
Cuda compilation tools, release 8.0, V8.0.61
This should be a problem with hardware or drivers
Check the output of nvidia-smi command line tool
For Pascal I can recommend to use driver version 381
thanks. It solved the problem. It was a problem of paths as as usual :(
Same kind of problem happen but solved thanks.
thanks. It solved the problem. It was a problem of paths as as usual :(
how can u solved..pls help me out
Same kind of problem happen but solved thanks.
how can u solved..pls help me out
Most helpful comment
Your libraries are compiled and that means that compilation is successfull, it does not mean it will run well.
Running Dlib with CUDA support enable requires Nvidia GPU with Kepler or newer architecture (CUDA device compute compatibility 3+). It will not work on AMD/Intel/other gpu/without gpu or with old Nvidia cards
If you do not have compatible GPU on your machine, you should recompile Dlib without CUDA support and work with CPU mode or you can run your binaries on other machine...