Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the cuda version in docker container be different with the host machine?

Tags:

cuda

I want to run the code that is written with cuda8.0 and tensorflow-1.2. I want to run the code in another machine,which the cuda is 9.0, So I use the docker to generate a container,that use this command:

FROM nvidia/cuda:8.0-cudnn5-devel

when I run the code in this container, there is the error below:

CUDA driver version is insufficient for CUDA runtime version

So, Is it wrong? How to solve that?

like image 456
Lily.chen Avatar asked May 18 '18 09:05

Lily.chen


People also ask

Do Docker containers have access to GPU?

However, Docker® containers are most commonly used to easily deploy CPU-based applications on several machines, where containers are both hardware- and platform-agnostic. The Docker engine doesn't natively support NVIDIA GPUs as it uses specialized hardware that requires the NVIDIA driver to be installed.

What is Cuda container?

The CUDA Toolkit from NVIDIA provides everything you need to develop GPU-accelerated applications. The CUDA Toolkit includes GPU-accelerated libraries, a compiler, development tools and the CUDA runtime. The CUDA container images provide an easy-to-use distribution for CUDA supported platforms and architectures.

What is a host machine in Docker?

In Docker, the host is a machine responsible for running one or more containers. Docker network host, also known as Docker host networking, is a networking mode in which a Docker container shares its network namespace with the host machine.

What is Dockerized container?

Dockerizing is the process of packing, deploying, and running applications using Docker containers. Docker is an open source tool that ships your application with all the necessary functionalities as one package.


1 Answers

For anyone that stumbles upon this, the issue here is the version of the CUDA driver library on the host is too old for the CUDA runtime library inside the container. The CUDA driver forms part of your NVIDIA driver installation on the host.

The CUDA drivers are not forwards compatible so the host needs to be at least be as recent as the version of the CUDA runtime you are trying to use in the container. For the widest range of options you should update the NVIDIA driver and CUDA driver on the host to the latest stable version.

like image 82
Ed Bordin Avatar answered Oct 07 '22 01:10

Ed Bordin