-
Notifications
You must be signed in to change notification settings - Fork 303
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
Question: How to unlock multiple NVENC video encoding sessions in nvidia-docker? #131
Comments
Hello! My pleasure! This patch modifies userland libraries, so I guess environment inside docker also has to be patched. Easiest and most reproducible way to achieve this is to make your own I don't actually use nvidia-docker, but I think FROM nvidia/cuda:9.0-base
RUN curl -s -o /var/tmp/patch.sh 'https://github.com/keylase/nvidia-patch/blob/master/patch.sh' && \
chmod +x /var/tmp/patch.sh && \
/var/tmp/patch.sh && \
rm -f /var/tmp/patch.sh Build this image with following command: docker build -t nvidia-patched . And use Also you may find some useful info on nvidia-patch in Docker in this issue: #43 |
Thanks for your response! Yes, I've already tried to run |
Users in that thread reported patch of a host system helped them, but now I see it's not the case. It seems nvidia-docker runs container with a special runtime which mounts actual utilities and libraries into running container as a read-only volume. And probably this set of binaries is not even with host machine driver files. It might be worth to peek into docker/runc arguments or pinpoint location of another set of libraries in your host system. Could you please show output of following command from host system:
|
Search from root takes much time on my machine. I ran
|
What is sha1 sum of each of these files?
Also output of command |
sha1 sum:
|
Thanks. Now I see - nvidia files inside container definitely bind-mounted from host system as a read-only overlay. Can you please check sha1sum of nvcuvid.so file mounted inside container? It should be like:
|
Sure! Here's sha1sum: |
@vBLFTePebWNi6c SHA1 sum of file in container matches to sum of original unpatched file, which was moved out of the way. You still have original file somewhere in your system. Probably you should also check |
On the other hand, you may build container which sorts this out automatically. All you have to do is to ensure your container entrypoint bind-mounts library to writable location and patches on start. Like this: https://gist.github.com/Snawoot/59ddc6ae9d3654da50b3653d98428543 Here entrypoint does patching job and runs original command with all parameters. This way docker-image will be independent from host, whether it patched or not. |
Gist updated, I forgot to invoke patch itself. Please let me know if it works for you and I'll this workaround into main patch file. |
mount approach won't work, it'll require CAP_SYS_ADMIN privilige, so it makes containers almost pointless. But I found another solution which utilizes dynamic linker for patching needs (via #132), so now Docker support with example Dockerfile is available on master branch. See instructions on this topic at main page. |
Tried your solution today and it worked like a charm! Thanks, man! Very appreciate your help :) |
Hello! Thanks for the patch!
I'm trying to use my program that runs multiple ffmpeg encoding processes in parallel inside nvidia-docker, but when I run more than 2 processes if crashes with following errors:
Host machine was patched and it can run more than 2 sessions at once. Inside docker image i can run 2 and less sessions as well.
I'd be glad for any suggestions to move towards solving this problem.
The text was updated successfully, but these errors were encountered: