darknet icon indicating copy to clipboard operation
darknet copied to clipboard

Fatal error: "cuda_runtime.h" not found

Open giacomobartoli opened this issue 6 years ago • 15 comments

Hi, I am trying YOLO with CUDA. Following the guide reported in the website I change the Makefile enabling the flag GPU=1 but when I try to "make" the project again I get this error:

cuda_error

It is clear that there's a missing library (cuda_runtime.h). However, where am I supposed to add this library? At which path in my osx system? According to the control panel it seems that CUDA is correctly installed

screen shot 2018-05-01 at 21 23 10

I would really appreciate any help, thanks :-)

giacomobartoli avatar May 01 '18 19:05 giacomobartoli

Run the following -

  1. which nvcc You should see a path like /usr/local/cuda-8.0/bin/nvcc

  2. Based on what path you see modify below command accordingly sudo ln -s /usr/local/cuda-8.0 /usr/local/cuda

This works in my implementation.

ankitshah009 avatar May 08 '18 09:05 ankitshah009

This might be a Mac OSX issue ?

AmmarkoV avatar May 08 '18 10:05 AmmarkoV

Same issue on Ubuntu 18.04, CUDA 9.0, cuDNN 7.14 with MakeFile only GPU = 1, all the else = 0.

DDOwzw avatar Jul 11 '18 19:07 DDOwzw

Hello guys, my solution was to rollback to the previous version of nvidia cuda drivers: 387.10.10.10.30

giacomobartoli avatar Jul 12 '18 08:07 giacomobartoli

Hi guys, if I do not have root permission, how can I fix this issue?

NengQian avatar Feb 04 '19 14:02 NengQian

Run the following -

  1. which nvcc You should see a path like /usr/local/cuda-8.0/bin/nvcc
  2. Based on what path you see modify below command accordingly sudo ln -s /usr/local/cuda-8.0 /usr/local/cuda

This works in my implementation.

does it really work?

shaqing avatar Apr 03 '19 09:04 shaqing

@shaqing - Yes it does.. But be aware that CUDA 10 is the latest, so you need to create symlink of whatever version of Cuda you have..

so do: ls /usr/local/cuda*

then create symbolic link to your version, for example, mine is "cuda-10.0" so you need to create symlink like this:

sudo ln -s /usr/local/cuda-10.0 /usr/local/cuda

kooscode avatar Apr 10 '19 19:04 kooscode

When you run ln -s /usr/local/cuda-8.0 /usr/local/cuda can you explain what should be exactly these folders ? In my case I have nothing similar to both of them.

My CUDA_PATH is C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1 and when I run which nvcc I get /cygdrive/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/bin/nvcc

Someone could advise me please ? :)

ArnaudNorel95 avatar Oct 17 '19 14:10 ArnaudNorel95

sorry, i have no idea on how to fix your cuda issues on windows..

kooscode avatar Oct 17 '19 16:10 kooscode

@shaqing - Yes it does.. But be aware that CUDA 10 is the latest, so you need to create symlink of whatever version of Cuda you have..

so do: ls /usr/local/cuda*

then create symbolic link to your version, for example, mine is "cuda-10.0" so you need to create symlink like this:

sudo ln -s /usr/local/cuda-10.0 /usr/local/cuda

It's still not working too on my desktop bruh... look same Screenshot from 2019-11-15 13-24-59

Abdurrasith avatar Nov 15 '19 06:11 Abdurrasith

Same exact issue as Abdurrasith

Quanttom avatar Nov 25 '19 23:11 Quanttom

I am facing the same issue when I try to run "make" on windows 10. Did anyone find a solution to this?

skradha26 avatar Apr 13 '20 23:04 skradha26

@skradha26 Same issue when I am compiling OpenCV with Qt on Windows 10 using this article

zubairahmed-ai avatar May 10 '20 16:05 zubairahmed-ai

I'm facing same issue in Mac M1. Does anyone know solution?

nijatmursali avatar Dec 25 '21 03:12 nijatmursali

@nijatmursali CUDA is for Nvidia, Apple since quite some time does not use Nvidia GPUs

im-AMS avatar Mar 20 '22 13:03 im-AMS