Reputation: 274
I was trying to run Darknet with GPU acceleration using CUDA API. So I followed instructions from here, changed GPU=1 in Makefile and started make. When I'm trying to run test it fails due to CUDA Error.
./darknet yolo test cfg/yolo.cfg yolo.weights data/dog.jpg CUDA Error: unknown error darknet: ./src/cuda.c:21: check_error: Assertion `0' failed.
I'm using Ubuntu 14.04, CUDA 7.5 and my NVIDIA-SMI 352.93 and Driver Version: 352.93 on Titan X I'm pretty sure that my CUDA works fine and driver's version is up to date, because I'm using it to accelerate Caffe. My guess is that Darknet cannot locate CUDA directory.
Can anyone help me with that issue?
Upvotes: 4
Views: 10792
Reputation: 416
I had the same problem. Modifying the ARCH in Makefile solved my problem. My gpu was GTX 1080 (I checked it out using nvidia-smi)
> $nvidia-smi
I found the setting suitable for my gpu here.
http://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/
I changed my arch setting in the Makefile as follows.
ARCH= -gencode arch=compute_61,code=[sm61,compute_61] \
Upvotes: 2
Reputation: 91
I just encountered this problem and solved it. My solution was
sudo rm -rf ~/.nv
and then reboot.
Upvotes: 0
Reputation: 121
Maybe u should modify the ARCH in Makefile.Ur GPU score can be found in this site: https://developer.nvidia.com/cuda-gpus
Upvotes: 0
Reputation: 11
Agree with “user6568204”. in addition, you can modify the value of configure parameter 'ARCH' in \Makefile, and you can find other 'ARCH' value in this website: http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#virtual-architecture-feature-list or look this picture virtual-architecture-feature-list
Upvotes: 1
Reputation: 66
you should modify the value of configure parameter 'ARCH'. the default value is --gpu-architecture=compute_52, --gpu-code=compute_52. my setting is --gpu-architecture=compute_30, --gpu-code=compute_30, and it works. it depends on your actual gpu architecture. more detail is in cuda toolkit documentation.
Upvotes: 5
Reputation: 9779
You could find out the reason by reading the code in ./src/cuda.c
at line 21, and checking what assertion is failed, as indicated by the error message.
./src/cuda.c:21: check_error: Assertion `0' failed.
Upvotes: 0