Running a docker image but its throwing an error

I have created a docker image and getting the following error while running on a aws machine.

Could not load library libcudnn_ops_infer.so.8. Error: libcublas.so.11: cannot open shared object file: No such file or directory
Please make sure libcudnn_ops_infer.so.8 is in your library path!

As a solution I had inserted the following line in the docker file:
RUN export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8

But am still getting the same error. If anyone could help me it would be great.

Export will not help in the image. That variable will only exist in that layer created by the RUN instruction which does not make sense. Try this:

ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8

Also make sure that the path exists and you installed the necessary libraries

“installing the necessary libraries” means…, insertion of following lines into the docker file will do ?

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/${last_public_key}.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt-get update
sudo apt-get install libcudnn8
sudo apt-get install libcudnn8-dev

If I knew what were the necessary libraries, I would have just told you that :slight_smile: The only thing I saw was the error message. If you those files are not even there, setting environment variables can’t help. Since I rarely use GPU with Docker and I have never seen that error message, this is all I could tell. You wrote days ago. I hope you could find a solution since then.