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

Does docker-version support GPU #6

Open
akrea opened this issue Jun 18, 2022 · 7 comments
Open

Does docker-version support GPU #6

akrea opened this issue Jun 18, 2022 · 7 comments

Comments

@akrea
Copy link

akrea commented Jun 18, 2022

Hi

I could not find this info anywhere in the specs: Does the docker-version of the external-model support GPU usage?

If yes: great!!

If no: would it be possible to provide a dockerfile that includes this option?

Background: I do have a perfectly smooth running NC inculding easy update-processes and custom configuration. So I would much prefer not to build an own NC image as I suspect a high probablity of having issues in bringing my current set-up back to life. Another unknown are update/-gradability issues of the self-compiled image. To add the external-model on the same host seems a much safe route to take.

Thanks for clarification!
akrea

@akrea
Copy link
Author

akrea commented Jul 13, 2022

  • OK - what I found out: the external model does not work with cuda cores.
  • In addition, to use the external version one still needs the dlib package on nextcloud installed in order to load the face recognition app.

So I will wait till the docker nextcloud version provides the dlib-package by default. It should happen as soon as dlib is out of its "infant" state.

Still I would prefer to use cuda cores on the external model.

cheers

@KoMa1012
Copy link

KoMa1012 commented Mar 5, 2024

I was able to get the external model with cuda running on ubuntu, however I didn't document how I did it.

Since I want to get rid of my ubuntu setup I might try to get it running in a docker container, however I have 0 experience with this, so this will take quite some time!

@mrbrdo
Copy link

mrbrdo commented May 26, 2024

After much testing I managed to make a docker image which works for me in docker:
https://github.com/mrbrdo/facerecognition-external-model-cuda

I am using nvidia driver version 535 on Ubuntu 22.04 with nvidia-container-toolkit (see nvidia install docs)

To use it (port 8090):

cd facerecognition-external-model-cuda
docker build --tag 'facerecognition-external-cuda' .
sudo docker run --rm --runtime=nvidia --gpus all -i -p 8090:5000 -v /PATH/TO/YOUR/api.key:/app/api.key -e FACE_MODEL=4 --name facerecognition-external-cuda facerecognition-external-cuda

@guillebot
Copy link

guillebot commented May 26, 2024 via email

@guillebot
Copy link

Well to add more information, I was able to rebuild the image with

FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04 AS builder

There is no version mismatch anymore, but getting the same error.

Will keep troubleshooting this

regards

@mrbrdo
Copy link

mrbrdo commented May 26, 2024

@guillebot I'm not sure why you have that issue. Perhaps try with the driver version 535? Is the nvidia-smi output from the host or the container?
I don't think the CUDA version should matter, as long as it is not higher than what nvidia-smi says (that's the max supported version). You could even try with CUDA 11.

@KoMa1012
Copy link

KoMa1012 commented Oct 15, 2024

After much testing I managed to make a docker image which works for me in docker: https://github.com/mrbrdo/facerecognition-external-model-cuda

I am using nvidia driver version 535 on Ubuntu 22.04 with nvidia-container-toolkit (see nvidia install docs)

To use it (port 8090):

cd facerecognition-external-model-cuda
docker build --tag 'facerecognition-external-cuda' .
sudo docker run --rm --runtime=nvidia --gpus all -i -p 8090:5000 -v /PATH/TO/YOUR/api.key:/app/api.key -e FACE_MODEL=4 --name facerecognition-external-cuda facerecognition-external-cuda

It's Kinda working for me, I can curl host:port/welcome and it returns"{"facerecognition-external-model":"welcome","model":4,"version":"1.0.0"}" However, if I start to recognize faces it's reporting:
"Faces found: 0. Image will be skipped because of the following error: External model response /detect with error. HTTP status code: 412"

I'm running a gtx1070 with driver 560.35.03 but I also tested with v550.120 with the same behavior. Unfortunately I can not switch to 535 since I'm using unraid and driver installation isn't trivial there. Any Ideas if this is related to the driver or what is going on? I can run nvidia-smi within the container and it's outputing information.

Is there any way to get more output than this general error? So, a debugging flag or something would be nice.

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

4 participants