Does a docker container need to use the exact same libcuda version of the host server?

I’m trying to run an application that uses torch and tensorflow inside a docker container but I’m getting this error message:

“kernel version 450.66.0 does not match DSO version 450.142.0 – cannot find working devices in this configuration”

The cuda-compat-11-0 version inside the container is 450.142.0 but the host driver version is 450.66.0.

As I can’t find cuda-compat-11-0 version 450.66.0, I tried other versions around it but I got the same error.

I’m not able to change the Host driver, so my question is:

Do I really have to install the exact same version on the docker container in order to make it work, or am I doing something wrong?

Please help me understand this issue. Thanks in advance!

Are you using the Nvidia Container Toolkit? If not, I think this may resolve the issue for you. Please let me know how it works out.

How to Properly Use the GPU within a Docker Container | by Jacob Solawetz | Towards Data Science