Nvidia-docker: How to link to nvidia driver library while building image?

Created on 20 Jun 2017  路  3Comments  路  Source: NVIDIA/nvidia-docker

I'm trying to compile OpenCV with NVCUVID in nvidia-docker image. The problem is that, libnvcuvid.so.1 is part of nvidia driver and only mounted into /usr/local/nvidia/lib64/ in runtime(nvidia-docker run ...). So OpenCV cannot find NVCUVID library while building image(docker build ...).

The trivial solution would be copying those libraries into the image in build-time, but losing the driver-agnostic advantages of nvidia-docker. Is there any better idea?

Most helpful comment

Can you give to me a hint or guide on how to create the libnvcuvid stub library?

All 3 comments

Unfortunately we don't have prebuilt stubs for libnvcuvid (see here).
You can create a stub library for libnvcuvid in your container for linking purposes only.
libnvcudvid doesn't have many symbols so this should be pretty straightforward.

For nvcuvid, it looks like the official solution is now to use the files provided with the Video Codec SDK and that will take care of dlopen/dlsym of the cuvid symbols at runtime. So OpenCV might need to update their code.

Can you give to me a hint or guide on how to create the libnvcuvid stub library?

Was this page helpful?
0 / 5 - 0 ratings