Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialization of YoloWrapper stuck when using GPU #168

Open
lnx00 opened this issue Jan 9, 2021 · 10 comments
Open

Initialization of YoloWrapper stuck when using GPU #168

lnx00 opened this issue Jan 9, 2021 · 10 comments

Comments

@lnx00
Copy link

lnx00 commented Jan 9, 2021

Hello,
when I try to use my GPU (RTX 3070) the program will get stuck while initializing the YoloWrapper.
This is the only thing that will be output to the console:

The RAM usage goes up to ~2GB and then stays there.

I've installed CUDA 10.2 correctly and placed the cudnn64_7.dll into my x64 project folder.
Here you can also see that CUDA is correctly installed:

This is the code that initializes the YoloWrapper:

The file names are correct, and they are stored at the correct location.
When using the CPU everything works fine. I only have this problem when using my GPU.

@grandprixgp
Copy link

@lnx00 CUDA 10.2 doesn't support ampere (3000 series) and OpenCV 4.3 doesn't support ampere.

@lnx00
Copy link
Author

lnx00 commented Jan 18, 2021

Damn, is there any workaround or alternative?

@grandprixgp
Copy link

grandprixgp commented Jan 18, 2021

Damn, is there any workaround or alternative?

I am working on building darknet and OpenCV for CUDA 11.2 (supports ampere) right now, I will get back to you with precompiled binaries if I'm successful.

Note: author of this library made the bad decision of calling the darknet compiled library yolo_cpp_dll_gpu.dll for CUDA enabled build and yolo_cpp_dll_cpu.dll for CUDA disabled build while also listing an absolute requirement of CUDA 10.2 in the README. Those should really be called darknet_gpu.dll and darknet_cpu.dll and refer to the darknet project for CUDA compatibility which would probably cut down on people getting confused about compatibility issues.

@BergChristian
Copy link

@grandprixgp really interested if you succeed to get the binaries!

@grandprixgp
Copy link

grandprixgp commented Jan 25, 2021

@grandprixgp really interested if you succeed to get the binaries!

sorry (@lnx00 too) I actually succeeded the next day but forgot about this issue! attached - note it will probably only work on ampere.
yolo_cpp_dll_gpu.zip

also during this time @cenit (AlexeyAB/darknet#7081 (comment)) managed to get OpenCV 4.5 onto vcpkg which now means that building darknet with CUDA support for latest gen GPUs is trivial. before you'd have to build OpenCV from source (took me 6 hours on 5800X) a few times (fixing mistakes/flag issues each time).

@BergChristian
Copy link

Awesome! Thanks for sharing.

I guess I need to include cudnn64_8 instead of cudnn64_7 to make it work...
I guess Alturos could be updated to check for version of card and CUDA installed and switch use of yolo_cpp_dll_gpu?

Annoying to have different versions depending on different cards but it seems that the only way forward ?

@cenit
Copy link

cenit commented Jan 26, 2021

Hi!
Isn't it possible to use Darknet as a CMake target in this project, and so be independent of CUDNN, library name, etc etc...?
Happy to assist if you need help, and sorry for not knowing more your project
You would also avoid distributing binaries, which are not so efficient in a git repository

@Egzscure
Copy link

I am having simular issues. It works with 2070 super but doesnt work with 3070ti. How do i fix it? it just gets stuck

@grandprixgp
Copy link

I am having simular issues. It works with 2070 super but doesnt work with 3070ti. How do i fix it? it just gets stuck

As diagnosed above this library ships with dependencies that don't support 3000 series GPUs. You need to rebuild darknet, OpenCV, etc w/ CUDA > 10.2.

@Egzscure
Copy link

I am having simular issues. It works with 2070 super but doesnt work with 3070ti. How do i fix it? it just gets stuck

As diagnosed above this library ships with dependencies that don't support 3000 series GPUs. You need to rebuild darknet, OpenCV, etc w/ CUDA > 10.2.

but i tried with your dll, and i installed cuda 11.2 (which should support ampere) and im still not beeing able to run :\ any tips, im kind of new in the machine learning field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants