Successfully installed dlib still dlib.DLIB_USE_CUDA returning false
I am trying to use GPU for @ageitgey face recognition api I installed and compiled dlib successfully during installation of dlib I got Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1 (found suitable version "10.1", minimum required is "7.5") -- Looking for cuDNN install... -- Found cuDNN: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/lib/x64/cudnn.lib -- Building a CUDA test project to see if your compiler is compatible with CUDA... -- Checking if you have the right version of cuDNN installed. -- Enabling CUDA support for dlib. DLIB WILL USE CUDA -- C++11 activated. -- Configuring done -- Generating done
BUT now when I am running import dlib print(dlib.DLIB_USE_CUDA) in SPYDER I am getting FALSE please help
##Expected Behavior I expected (dlib.DLIB_USE_CUDA) to return TRUE I expected CNN face detector model to run on GPU
Current Behavior
dlib.DLIB_USE_CUDA is returning false CNN based face detector is taking whole CPU and RAM I also checked gpu usage by using nvidia-smi but it was not showing any usage cuda.get_num_devices() returns 1
Steps to Reproduce
install dlib https://github.com/davisking/dlib install cuda toolkit and other dependecies Run this https://github.com/davisking/dlib
dlib version dlib==19.18.99 dlib: https://github.com/davisking/dlib I am working on Windows 10 64 bit I am using SPYDER
so hard to install dlib....
dlib.DLIB_USE_CUDA is a compile time constant. Therefore, if you install dlib and it says Enabling CUDA support for dlib. DLIB WILL USE CUDA during install, but dlib.DLIB_USE_CUDA is False then this absolutely, 100% guaranteed, means you have installed two separate copies of dlib. One built to use cuda and another not.
This isn't because dlib is hard to install. There is nothing I could possibly do to stop you from installing multiple copies of dlib and configuring them differently.
Maybe I need to emphasize that what is happening here is you have two copies of dlib installed in different python environments and you are getting confused about what python environment you are running your stuff in.
I got your point @davisking Thnx for helping I wanted to ask that can we run dlibs hog face detectort on multiple cpu cores? If yes can you please tell me how
Warning: this issue has been inactive for 35 days and will be automatically closed on 2019-11-28 if there is no further activity.
If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.
Warning: this issue has been inactive for 42 days and will be automatically closed on 2019-11-28 if there is no further activity.
If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.
Notice: this issue has been closed because it has been inactive for 45 days. You may reopen this issue if it has been closed in error.
#2209 import dlib.cuda as cuda print(cuda.get_num_devices()); ... 1 print(cuda.get_device()); 0 dlib.DLIB_USE_CUDA False
still no wits shows that dlib.DLIB_USE_CUDA as False
Can any one tell me how to over come this ?
I have similar issue
C:\dlib\dlib-19.21\dlib-19.21\python_examples>python Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
import dlib print(dlib.cuda.get_num_devices()) 1 print(dlib.DLIB_USE_CUDA) False
My dlib C++ library found cudnn , but the python dlib has a problem to link cudnn
That means it didn't build with cuda support.
On Tue, Feb 2, 2021 at 2:46 PM eagle-dot [email protected] wrote:
I have similar issue
C:\dlib\dlib-19.21\dlib-19.21\python_examples>python Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
import dlib print(dlib.cuda.get_num_devices()) 1 print(dlib.DLIB_USE_CUDA) False
My dlib C++ library found cudnn , but the python dlib has a problem to link cudnn
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/davisking/dlib/issues/1892#issuecomment-771927747, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPYFR2E4R2HTMWGIWQVOUTS5BJBFANCNFSM4I55RHRQ .
DLIB_USE_CUDA
I had the same problem. Later I found out that I had a dlib package in the conda and pip packages. I deleted dlib from the pip packet.
#2209 import dlib.cuda as cuda print(cuda.get_num_devices()); ... 1 print(cuda.get_device()); 0 dlib.DLIB_USE_CUDA False
still no wits shows that dlib.DLIB_USE_CUDA as False
Can any one tell me how to over come this ?
maybe you can try to install it using conda:
https://gist.github.com/nguyenhoan1988/ed92d58054b985a1b45a521fcf8fa781
I got your point @davisking Thnx for helping I wanted to ask that can we run dlibs hog face detectort on multiple cpu cores? If yes can you please tell me how
okay so what can we do about it ? should i uninstall the pip dlib package and rebuild it with cuda ? or something else.
About the HOG stuff not running on the GPU? That code just doesn't run on the GPU. It's not written in CUDA. So it just is what it is.
On Thu, Jan 25, 2024 at 7:56 AM Kush Pandey @.***> wrote:
I got your point @davisking https://github.com/davisking Thnx for helping I wanted to ask that can we run dlibs hog face detectort on multiple cpu cores? If yes can you please tell me how
okay so what can we do about it ? should i uninstall the pip dlib package and rebuild it with cuda ? or something else.
— Reply to this email directly, view it on GitHub https://github.com/davisking/dlib/issues/1892#issuecomment-1910159365, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPYFR3RG7VBDKQLWSMCDT3YQJJA5AVCNFSM4I55RHR2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJRGAYTKOJTGY2Q . You are receiving this because you were mentioned.Message ID: @.***>
DLIB_USE_CUDA
I had the same problem. Later I found out that I had a dlib package in the conda and pip packages. I deleted dlib from the pip packet.
if i delete the pip package dlib then python is unable to find dlib
#2209 import dlib.cuda as cuda print(cuda.get_num_devices()); ... 1 print(cuda.get_device()); 0 dlib.DLIB_USE_CUDA False
still no wits shows that dlib.DLIB_USE_CUDA as False
Can any one tell me how to over come this ?
same problem
Yeah if you delete dlib it will be deleted :)
The pip package isn't really any different from installing directly from the main github repo. If dlib.DLIB_USE_CUDA is false then it means your system is missing the nvidia libraries needed to use cuda. Anyway, if you do pip install -v dlib pip will not hide all the messages the install process is printing. You should see some messages saying something about why your cuda or nvidia libraries are wrong or missing.
can anyone help here, I am getting same error in the dlib usage for cuda device.
import dlib print(dlib.DLIB_USE_CUDA) False
can anyone help here, I am getting same error in the dlib usage for cuda device.
import dlib print(dlib.DLIB_USE_CUDA) False
A little more information would be good in order to resolve the issue like System configuration etc. most likely u must be using pip dlib package but need to build it from scratch also beware of the cuda and cudnn version + path in your environment variables
Thanks for your reply @kushpandey3009 , Yes I followed from scratch, I found the solution provided here and its working fine: https://stackoverflow.com/questions/58261342/successfully-installed-dlib-still-dlib-dlib-use-cuda-returning-false