AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.74k stars 7.96k forks source link

CUDA error on ubuntu system #378

Open nirajvermafcb opened 6 years ago

nirajvermafcb commented 6 years ago

Hi, I am using ubuntu 16.04 with nvidia GEFORCE 920 gpu and I have CUDA version 7.5 installed on my computer. I have made the necessary changes in make file replacing the values of GPU and CUDNN as 1.And then when I run make command it gives me this error.

fatal error: cudnn.h: No such file or directory compilation terminated. Makefile:89: recipe for target 'obj/gemm.o' failed make: *** [obj/gemm.o] Error 1

When i don't make this changes it just works fine..

TheMikeyR commented 6 years ago

Did you install cudnn correctly? It seems that it can't find cudnn.h file, which you are getting when installing cudnn. Try to compile with Cudnn=0 and see if that works. You can check this answer on how to install cudnn and do these steps and try to remake.

nirajvermafcb commented 6 years ago

yes with Cudnn = 0 it is working but I want to run it with GPU.

TheMikeyR commented 6 years ago

GPU is 1, so you are running it with GPU. cuDNN is just a library which adds faster computation for deep learning operations

is a GPU-accelerated library of primitives for deep neural networks. cuDNN provides highly tuned implementations for standard routines such as forward and backward convolution, pooling, normalization, and activation layers. cuDNN is part of the NVIDIA Deep Learning SDK. source

If you want to run with cuDNN on you should install like it's described in the link in my previous comment or you can read below, copied from source, You can skip step 0, since you already installed CUDA.:

Step 0: Install cuda from the standard repositories. (See How can I install CUDA on Ubuntu 16.04?)

Step 1: Register an nvidia developer account and download cudnn here (about 80 MB)

Step 2: Check where your cuda installation is. For the installation from the repository it is /usr/lib/... and /usr/include. Otherwise, it will be /usr/local/cuda/ or /usr/local/cuda-<version>. You can check it with which nvcc or ldconfig -p | grep cuda

Step 3: Copy the files:

$ cd folder/extracted/contents
$ sudo cp -P include/cudnn.h /usr/include
$ sudo cp -P lib64/libcudnn* /usr/lib/x86_64-linux-gnu/
$ sudo chmod a+r /usr/lib/x86_64-linux-gnu/libcudnn*

Then recompile your darknet with CUDNN=1, and it should complete the compilation if you followed step 0-3, I assume you have installed CUDA drivers already since you can compile with GPU=1 so you can just go to step 1-3.

nirajvermafcb commented 6 years ago

I uninstalled 7.5 version and again installed 9.1 version from nvidia website with all updated drivers as per my system.It is still giving me the same error.

AlexeyAB commented 6 years ago

@nirajvermafcb Did you use in the Makefile?

GPU=1
CUDNN=0
nirajvermafcb commented 6 years ago

Yes with GPU = 1 and CUDNN = 0 it is running fine but when I set CUDNN = 1 it is showing me this error @AlexeyAB

AlexeyAB commented 6 years ago

@nirajvermafcb Did you do all 3 steps (1, 2, 3) that written by TheMikeyR: https://github.com/AlexeyAB/darknet/issues/378#issuecomment-363701504

SJRogue commented 6 years ago

I've had this problem as well until i finally did the installation of cuDNN correctly, also the referring.

Be carefull you're saying u have version 9.1 CUDA, do you have the right CUDA/cuDNN match?

[EDIT: is your GPU CC >= 3.0 ?] [EDIT 2: is your system variable set? I'm on windows so for Linux it's different ->

Alexey's instruction:

to build with cuDNN v5/v6 to accelerate training by using GPU (cuDNN should be in /usr/local/cudnn)