Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Run VPF without CUDA Toolkit? #532

Open
mark-selyaeff opened this issue Sep 20, 2023 · 3 comments
Open

Run VPF without CUDA Toolkit? #532

mark-selyaeff opened this issue Sep 20, 2023 · 3 comments

Comments

@mark-selyaeff
Copy link

I am trying to build a docker image with VPF using multiple stages. Firstly I use offical nvidia/cuda docker image to build VPF and other GPU-dependent packages, then I copy Python environment with installed packages over to ubuntu20.04 in order to reduce the size of the docker image.

FROM nvidia/cuda:11.4.3-cudnn8-devel-ubuntu20.04

# after creating an env, installing needed packages and updating PATH
RUN pip install git+https://github.com/NVIDIA/VideoProcessingFramework

FROM ubuntu:20.04
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video

RUN /testenv/bin/python -c 'import PyNvCodec; PyNvCodec.GetNumGpus()'

VPF builds successfully during first stage, however a simple test run /testenv/bin/python -c 'import PyNvCodec; PyNvCodec.GetNumGpus()' raises the following error:

Traceback (most recent call last):
  File "/testenv/lib/python/site-packages/PyNvCodec/__init__.py", line 17, in <module>
    from ._PyNvCodec import *  # noqa
ImportError: libnppig.so.11: cannot open shared object file: No such file or directory

Could I run VPF without CUDA Toolkit being installed? If I stick to cuda image and don't use plain ubuntu:20.04 the code runs fine without errors.

@RomanArzumanyan
Copy link
Contributor

Hi @mark-selyaeff

There's not enough info to answer your question. I don't know what packages are installed in plain ubuntu:20.04.

ImportError: libnppig.so.11: cannot open shared object file: No such file or directory

This error tells you that VPF libraries were linked against various NV libraries like libcuda.so, libnppig.so, etc. and hence these libraries are required to run VPF.

Unless you have them in your LD_LIBRARY_PATH there's no chance VPF could run for obvious reasons.

@mark-selyaeff
Copy link
Author

Using ldd I found and copied over 6 .so files from /usr/local/cuda to ubuntu:20.04 which had no signs of CUDA at all, and now all seems to be working without errors. Is there a way to do that automatically, i.e. pack all needed libraries into a standalone distribution?

@RomanArzumanyan
Copy link
Contributor

RomanArzumanyan commented Sep 20, 2023

Hi @mark-selyaeff

This approach isn't sustainable, you need to install GPU driver on your Ubuntu machine at least.
Most probably it's already installed somehow, otherwise CUDA and NPP libraries won't be able to communicate with GPU.

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

No branches or pull requests

2 participants