dlib不使用CUDA [英] dlib not using CUDA

查看:626
本文介绍了dlib不使用CUDA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用pip安装了dlib。我的图形卡支持CUDA,但是在运行dlib时,它没有使用GPU。

I installed dlib using pip. my graphic card supports CUDA, but while running dlib, it is not using GPU.

我正在使用ubuntu 18.04

Im working on ubuntu 18.04

Python 3.6.5 (default, Apr  1 2018, 05:46:30) 
[GCC 7.3.0] on linux
>>> import dlib
>>> dlib.DLIB_USE_CUDA
False

我还安装了NVidia Cuda Compile驱动程序,但仍然

I have also installed the NVidia Cuda Compile driver but still it is not working.

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85

有人可以帮助我如何使其正常运行。 ?

Can anyone help me how to get it working. ?

推荐答案

我遇到了类似的问题,就我而言,我缺少cuDNN库,该库阻止了dlib使用CUDA指令进行编译,尽管我安装了CUDA编译器和其他驱动程序。

I had similar issues, in my case I was missing the cuDNN library, which prevented dlib from compiling with CUDA instructions, although I had CUDA compiler and other drivers installed.

下一部分是从此仓库

然后运行此命令以使用CUDA和AVX指令安装dlib,您无需使用make文件通过CMake进行手动编译:

Then run this command to install dlib with CUDA and AVX instructions, you do not need to manually compile it with CMake using make file:

python setup.py install --yes USE_AVX_INSTRUCTIONS --yes DLIB_USE_CUDA

现在重要的部分是读取日志,如果python可以实际找到CUDA,cuDNN并可以使用CUDA编译器来编译测试项目。这些是重要的行:

Important part now is to read the log, if the python can actually find CUDA, cuDNN and can use CUDA compiler to compile the test project. These are the important lines:

-- Found CUDA: /usr/local/cuda/bin/ (found suitable version "8.0", minimum required is "7.5")
-- Looking for cuDNN install...
-- Found cuDNN: /usr/local/cuda/lib64/libcudnn.so
-- Building a CUDA test project to see if your compiler is compatible with CUDA...

第二个问题是面临与CMake版本有关。最新版本的cuda和dlib存在一些已知问题,因此我必须安装CMake 3.12.3才能使其正常工作。

The second problem I was facing was related to CMake versions. The latest version had some known problems with cuda and dlib, so I had to install CMake 3.12.3 in order to make it work.

这篇关于dlib不使用CUDA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆