安装了GPU支持的Caffe-SSD线程错误“无法在CPU-only Caffe中使用GPU”

问题描述 投票:0回答:1

我已经安装了caffe-ssd和OpenCV版本3.2.0,CUDA版本9.2.148和CuDNN版本7.2.1.38。

这些是我在Makefile.config中的设置

# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1

# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1

# Uncomment if you're using OpenCV 3
OPENCV_VERSION := 3

# We need to be able to find Python.h and numpy/arrayobject.h.
PYTHON_INCLUDE := /usr/include/python2.7 \
        /usr/local/lib/python2.7/dist-packages/numpy/core/include

# Uncomment to support layers written in Python (will link against    Python libs)
WITH_PYTHON_LAYER := 1

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial/

所有测试都通过了。

[----------] Global test environment tear-down
[==========] 1266 tests from 168 test cases ran. (45001 ms total)
[  PASSED  ] 1266 tests.

此后,我跟随这个link用于SSD。 LMDB创建没有问题,但是当我运行时

python examples/ssd/ssd_pascal.py

我收到以下错误

I0820 14:16:29.089138 22429 caffe.cpp:217] Using GPUs 0
F0820 14:16:29.089301 22429 common.cpp:66] Cannot use GPU in CPU-only Caffe: check mode.
*** Check failure stack trace: ***
    @     0x7f97322a00cd  google::LogMessage::Fail()
    @     0x7f97322a1f33  google::LogMessage::SendToLog()
    @     0x7f973229fc28  google::LogMessage::Flush()
    @     0x7f97322a2999  google::LogMessageFatal::~LogMessageFatal()
    @     0x7f973284f8a0  caffe::Caffe::SetDevice()
    @     0x55b05fe50dcb  (unknown)
    @     0x55b05fe4c543  (unknown)
    @     0x7f9730ae3b97  __libc_start_main
    @     0x55b05fe4cffa  (unknown)
Aborted (core dumped)

我有一块NVIDIA GeForce GTX 1080 Ti显卡。

Mon Aug 20 14:26:48 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 396.51                 Driver Version: 396.51                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:01:00.0 Off |                  N/A |
| 44%   37C    P8    19W / 250W |     18MiB / 11177MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1356      G   /usr/lib/xorg/Xorg                             9MiB |
|    0      1391      G   /usr/bin/gnome-shell                           6MiB |
+-----------------------------------------------------------------------------+

我尝试用nvcc编译一个简单的Cuda代码并运行它没有任何问题。我能够没有任何问题import caffe

我检查了this问题,这不是我的问题。

caffe
1个回答
0
投票

错误错误== cudaSuccess(7 vs. 0)

在ssd_pascal.py中从gpus = "0,1,2,3"更改为gpus = "0",并在Makefile.config中检查CUDA_DIR中的cuda路径,并使用系统中安装的正确路径和版本对其进行更新。

错误“无法在CPU-only Caffe中使用GPU”使用make test命令再次构建ssd

© www.soinside.com 2019 - 2024. All rights reserved.