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

Getting error in loading shared libraries #8

Open
razapk opened this issue Jun 22, 2021 · 5 comments
Open

Getting error in loading shared libraries #8

razapk opened this issue Jun 22, 2021 · 5 comments

Comments

@razapk
Copy link

razapk commented Jun 22, 2021

Hi,
I am getting the following error:

darknet: error while loading shared libraries: libcuda.so.1: cannot open shared object file: No such file or directory

My Dockerfile looks like:

FROM daisukekobayashi/darknet:gpu-cv-cc86
# I think the lines here are not relevant to the problem
...
darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg

Thanks in advance,
Raza

@razapk razapk changed the title Getting error while loading shared libraries Getting error in loading shared libraries Jun 26, 2021
@maininformer
Copy link

maininformer commented Jun 27, 2021

@razapk
try:

export LD_LIBRARY_PATH="/usr/local/cuda/compat:${LD_LIBRARY_PATH}"

inside the container

Alternatively, you may add the following line to the runtime container; put it in the end

 ENV LD_LIBRARY_PATH="/usr/local/cuda/compat:${LD_LIBRARY_PATH}"

note you will need to build your own container with this method:

  • Copy the Dockerfile
  • Copy the configure.sh
  • run $ chmod +x configure.sh
  • run $ docker build --build-arg SOURCE_BRANCH=master --build-arg SOURCE_COMMIT=8bbdb --build-arg CONFIG=gpu-cv-cc75 --tag darknet:latest .

you may replace the --build-args with your desired values.

I am hesitant to PR this and will play with it a bit more first.

@dannje
Copy link

dannje commented Jun 27, 2021

Hello,

I'm getting the same error as above:
darknet: error while loading shared libraries: libcuda.so.1: cannot open shared object file: No such file or directory

After running:
docker run --runtime=nvidia --rm -v C:\Users\Dan\Desktop\ocv\dockershit\darknet\build\darknet\x64:/workspace -w /workspace daisukekobayashi/darknet:gpu darknet detector test data/coco.data yolov3.cfg yolov3.weights -i 0 -thresh 0.25 dog.jpg -ext_output

Thanks for your help,
Dan

@daisukekobayashi
Copy link
Owner

@razapk @dannje
Hi. What OS are you using?
Using —runtime=nvidia option, you need the NVIDIA Container Toolkit. And I think that the NVIDIA Container Toolkit only support Linux distributions. You can see supported platforms here.

In dannje's command, it seems that you are using Windows.

@razapk
Copy link
Author

razapk commented Jun 29, 2021

@daisukekobayashi
I am using Ubuntu 20.04.2 LTS and have Nvidia Container Toolkit installed. Here is my docker compose file I am using:

version: "3.9"
services:
  backend:
    build: .
    ports:
      - "3333:3333"
    deploy:
      resources:
        reservations:
          devices:
          - driver: nvidia
            count: 1
            capabilities: [gpu, utility]

@dancronintix
Copy link

dancronintix commented Jun 30, 2021

I got it working @daisukekobayashi
Thank you!

I was on Windows 10 attempting to use WSL which doesn't have CUDA. I needed to install WSL2 and that worked. 👍

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