Dlib cuda python windows

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling dlib with CUDA on Windows 10 #2375

Compiling dlib with CUDA on Windows 10 #2375

Comments

I tried to compile dlib with CUDA on windows 10.
I followed those instruction

-- Building for: Visual Studio 15 2017 -- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.19042. -- The C compiler identification is MSVC 19.16.27035.0 -- The CXX compiler identification is MSVC 19.16.27035.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Using CMake version: 3.19.2 -- Compiling dlib version: 19.22.99 -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of void* -- Check size of void* - done -- Enabling AVX instructions -- Searching for BLAS and LAPACK -- Searching for BLAS and LAPACK -- Looking for pthread.h -- Looking for pthread.h - not found -- Found Threads: TRUE -- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0 (found suitable version "8.0", minimum required is "7.5") CMake Warning at dlib/CMakeLists.txt:615 (message): You have CUDA installed, but we can't use it unless you put visual studio in 64bit mode. -- Found CUDA, but CMake was unable to find the cuBLAS libraries that should be part of every basic CUDA install. Your CUDA install is somehow broken or incomplete. Since cuBLAS is required for dlib to use CUDA we won't use CUDA. -- DID NOT FIND CUDA -- Disabling CUDA support for dlib. DLIB WILL NOT USE CUDA -- C++11 activated. -- Configuring done -- Generating done 

It shows issues about an CUDA 8 broken version.
I have multiple CUDA version installed but the one on the path is clearly v10.1
nvcc —version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2019 NVIDIA Corporation Built on Sun_Jul_28_19:12:52_Pacific_Daylight_Time_2019 Cuda compilation tools, release 10.1, V10.1.243

Читайте также:  My Website Title

Also I have Visual Studio Community 2019 v16.4.2 installed in 64 bit, but its still appeared invisible.

The text was updated successfully, but these errors were encountered:

Hi,
As I remember I’ve been following this intruction THIS instruction/ when succesfully installed CUDA with dlib. The magic is in a proper istallation of CUDNN and copying dlls to their places as well.

Hi, as mentionned in the instruction you send me both bandwithTest.exe and deviceQuery.exe result in PASS, meaning that the installation is clean

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\extras\demo_suite>bandwidthTest.exe [CUDA Bandwidth Test] - Starting. Running on. Device 0: GeForce RTX 2070 Quick Mode Host to Device Bandwidth, 1 Device(s) PINNED Memory Transfers Transfer Size (Bytes) Bandwidth(MB/s) 33554432 12783.9 Device to Host Bandwidth, 1 Device(s) PINNED Memory Transfers Transfer Size (Bytes) Bandwidth(MB/s) 33554432 12878.1 Device to Device Bandwidth, 1 Device(s) PINNED Memory Transfers Transfer Size (Bytes) Bandwidth(MB/s) 33554432 377692.5 Result = PASS NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\extras\demo_suite>deviceQuery.exe deviceQuery.exe Starting. CUDA Device Query (Runtime API) version (CUDART static linking) Detected 1 CUDA Capable device(s) Device 0: "GeForce RTX 2070" CUDA Driver Version / Runtime Version 11.1 / 10.1 CUDA Capability Major/Minor version number: 7.5 Total amount of global memory: 8192 MBytes (8589934592 bytes) (36) Multiprocessors, ( 64) CUDA Cores/MP: 2304 CUDA Cores GPU Max Clock rate: 1740 MHz (1.74 GHz) Memory Clock rate: 7001 Mhz Memory Bus Width: 256-bit L2 Cache Size: 4194304 bytes Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384) Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers Total amount of constant memory: zu bytes Total amount of shared memory per block: zu bytes Total number of registers available per block: 65536 Warp size: 32 Maximum number of threads per multiprocessor: 1024 Maximum number of threads per block: 1024 Max dimension size of a thread block (x,y,z): (1024, 1024, 64) Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535) Maximum memory pitch: zu bytes Texture alignment: zu bytes Concurrent copy and kernel execution: Yes with 6 copy engine(s) Run time limit on kernels: Yes Integrated GPU sharing Host Memory: No Support host page-locked memory mapping: Yes Alignment requirement for Surfaces: Yes Device has ECC support: Disabled CUDA Device Driver Mode (TCC or WDDM): WDDM (Windows Display Driver Model) Device supports Unified Addressing (UVA): Yes Device supports Compute Preemption: Yes Supports Cooperative Kernel Launch: Yes Supports MultiDevice Co-op Kernel Launch: No Device PCI Domain ID / Bus ID / location ID: 0 / 9 / 0 Compute Mode: < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 11.1, CUDA Runtime Version = 10.1, NumDevs = 1, Device0 = GeForce RTX 2070 Result = PASS 

I tried to build in a build dir with cmake ( cmake -D DLIB_USE_CUDA=1 -D USE_AVX_INSTRUCTIONS=1 ../ ) and got the same issues as before.

Читайте также:  Java отступы в коде

When I try python setup install it shows that it will compile using cuda, then it breaks at subprocess.CalledProcessError: Command ‘[‘cmake’, ‘—build’, ‘.’, ‘—config’, ‘Release’, ‘—‘, ‘/m’]’ returned non-zero exit status 1.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

The wheel package files (.whl) of dlib for python 3.7, 3.8, 3.9, 3.10, and 3.11 on Windows_x64.

License

eddiehe99/dlib-whl

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

pip install dlib-XX.XX.X-cpXX-cpXX-win_amd64.whl

The XX depends on your situation.

Open file C:\Users\XXX\AppData\Local\Programs\Python\PythonXX\Lib\site-packages\dlib\_init_.py .

The XXX depends on your situation or the whole filepath may be totally different based on your installation configuration.

If you use CUDA, configure the code:

if "ON" == "ON": add_lib_to_dll_path( "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/vXX.X/lib/x64/cudnn.lib" ) add_lib_to_dll_path( "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/vXX.X/lib/x64/cudart.lib" )

The XX.X depends on your situation or the whole filepath may be totally different based on your installation configuration.

If you do not use CUDA, delete the code:

if "ON" == "ON": add_lib_to_dll_path( "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/vXX.X/lib/x64/cudnn.lib" ) add_lib_to_dll_path( "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/vXX.X/lib/x64/cudart.lib" )

Probably. I have not tried it.

import dlib print(dlib.DLIB_USE_CUDA) print(dlib.cuda.get_num_devices())

It is a matter of luck whether the .whl file works on your computer.

Читайте также:  Css all child with class

If the .whl file smooth your installation, you could send a e-mail of gratitude to me. This is enough to delight me not less than a day.

If it does not work, I highly recommend you to download the source code and install by yourself. Besides, you could also send a e-mail full of swear words or other trash to me.

About

The wheel package files (.whl) of dlib for python 3.7, 3.8, 3.9, 3.10, and 3.11 on Windows_x64.

Источник

compile dlib with cuda

enter image description here

But I receive an error. Can anyone help me to solve it?

Hi I have checked CMakeOutput.log. there is only one line: «The system is: Windows — 10.0.16299 — AMD64»

Probably it requires cmake and some c++ compiler installed, as per instructions on dlib.net/compile.html

2 Answers 2

Create a folder for host the source

mkdir -p /opt/SP/packages/ cd $_ 
git clone https://github.com/davisking/dlib.git cd dlib git submodule init git submodule update 

Create a folder for build the software (cmake have to be installed)

Now run cmake with the following options:

cmake -D DLIB_USE_CUDA=1 -D USE_AVX_INSTRUCTIONS=1 ../ 

NOTE: Install cuDNN, openblas and Intel MKL/BLAS/LAPACK if your system is compliant with them.

Now you can compile the source with

cmake --build . --config Release 

After these step, the source is compiled.

Now you can install the python API.

cd ../ python setup.py install 

NOTE: The compilation this time will use all the available CPU, be sure that you have enough memory for compile.

Once completed, you can query your python packages for be sure that dlib is now installed:

For check if the installation was succesfully:

>>> import dlib.cuda as cuda; >>> print(cuda.get_num_devices()); 1 >>> import dlib >>> dlib.DLIB_USE_BLAS True >>> dlib.DLIB_USE_CUDA True >>> dlib.DLIB_USE_LAPACK True 

I followed your instruction, and got on the python setup.py install — ` subprocess.CalledProcessError: Command ‘[‘cmake’, ‘—build’, ‘.’, ‘—config’, ‘Release’, ‘—‘, ‘/m’]’ returned non-zero exit status 1.` Although, it did not show any issue on the config part. Any idea how I got that ?

Steps which you should take care, note that the solution I am giving here is general. It will work with all the users. Download latest version of dlib from official site (current is dlib 19.15).

  1. Check your Ubuntu/Mint version. If you are using bionic then you should download cuda10 and cudnn for cuda 10. Artful and Xenial can go with cuda 9.
  2. Install the latest version of CMake i.e. 3.12.x (current). Otherwise you may get some errors like
sudo python setup.py install --yes USE_AVX_INSTRUCTIONS --yes DLIB_USE_CUDA 
sudo python3 setup.py install --yes USE_AVX_INSTRUCTIONS --yes DLIB_USE_CUDA 
sudo apt-get install python3-dev or sudo apt-get install python2-dev 
sudo apt-get install libpython2.7-dev python-numpy 

If you are working on Anaconda then just copy the content of

Источник

Оцените статью