Failed importing opencv in Docker image

Hello, I’m trying to use nvcr.io/nvidia/l4t-ml:r32.6.1-py3 on my docker image and import cv2 module.

When running sudo docker run -it --rm --runtime nvidia --network host nvcr.io/nvidia/l4t-ml:r32.6.1-py3 and run a python interpreter and import cv2 in it, it works well.
But when using l4t-ml image in docker image and importing cv2 module it throws -
ImportError: libcublas.so.10: cannot open shared object file: No such file or directory

On bashrc I have -
export PATH="/usr/local/cuda-10.2/bin:$PATH"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.2/lib64/

and my dockerfile -

FROM nvcr.io/nvidia/l4t-ml:r32.6.1-py3
COPY hello.py hello.py
ENTRYPOINT [“python3”, “hello.py”]

Thanks!

Hi @tomerdayan168, are you also specifying --runtime nvidia when you start your own container that’s based off of l4t-ml?

1 Like