How to Fix Could not load dynamic library ‘libcudart.so.11.0’ [Steps]

What is ‘Could not load dynamic library ‘libcudart.so.11.0’’ error on Ubuntu/Linux?

I this post, we are going to discuss on How to fix Could not load dynamic library ‘libcudart.so.11.0’ error on Ubuntu/Linux computer. You are provided here with easy steps/methods to resolve the issue. Let’s starts the discussion.

Could not load dynamic library ‘libcudart.so.11.0’ error when installing TensorFlow on Ubuntu/Linux:

‘TensorFlow’: TensorFlow is free and open-source software library for machine learning and artificial intelligence. TensorFlow can be used across a range of tasks but has a particular focus on training and interference of deep neural networks. It is available for Linux, macOS, Microsoft Windows OS, Android, and JavaScript platforms. TensorFlow is written in Python, C++ and CUDA programming languages.

However, several users reported they faced Could not load dynamic library ‘libcudart.so.11.0’ error on their Ubuntu/Linux platform when they tried to install TensorFlow. This error is mostly appeared on Ubuntu 20.04 laptop with NVIDIA GPU integrated/attached. This issue indicates you are unable to install TensorFlow program in your Ubuntu/Linux computer with NVIDIA GPU installed in it. If you are facing the same error and looking for ways to fix, then you are in right-place for the solution. Let’s go for the solution.

How to fix Could not load dynamic library ‘libcudart.so.11.0’ error – TensorFlow error on Ubuntu/Linux?

Method: Install NVIDIA Kernel and Cuda 11 libraries from NVIDIA Repository

One possible way to fix the issue is to install NVIDIA Kernel and Cuda 11 libraries from NVIDIA Repository.

Step 1: On your Ubuntu/Linux computer, open ‘Terminal’ window and type the following commands and hit ‘Enter/Return’ key to execute in order to add NVIDIA PPA repository

$ 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/7fa2af80.pub

$ sudo add-apt-repository “deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /”

Step 2: Once executed, now executes the following commands to install NVIDIA Kernel

 

$ sudo apt-get update && sudo apt-get install -y nvidia-kernel-source-460

Step 3: Once executed, install CUDA with following command

$ sudo apt-get -y install cuda

Step 4: Once executed, retry installing TensorFlow and check if the error is resolved.

Conclusion

I hope this post helped you on How to fix Could not load dynamic library ‘libcudart.so.11.0’ error – TensorFlow error on Ubuntu/Linux with easy ways. You can read & follow our instructions to do so. That’s all. For any suggestions or queries, please write on comment box below.

Sakshi Anant Author