Use nvidia-smi in Dockerfile #225
Comments
This is correct, the driver files (libraries and binaries) are mounted from the host (using a Docker volume) when the container is started. But this shouldn't be an issue, you don't need to actually a GPU in your system in order to compile CUDA code. You can install the nvcc toolchain on any machine and compile your code, and then during deployment you do need a machine with a GPU and you use |
@Josca: does that answer your question, can we close this? |
Hi, I've had problems with missing libraries/directories during a build and arrived at this issue. My exact issue is that I ran a Minimal Dockerfile:
Output of
Libraries are found when
Furthermore, there are a few minor annoyances, such as a @flx42, Is there a technical limitation disallowing NVIDIA and CUDA related directories being mounted at build time? IMHO it would be better to have them if possible. |
Yes, there are some minor annoyances, but it's better this way. You want the |
OK, thanks for the fast response. |
We at Graphistry have found that we need various libraries in the environment path when running GPU code (specifically, running via OpenCL) in nvidia-docker. We've been learning Graphistry and docker as we go, so we're always open to suggestions, but what we've done is to add the paths to libraries in our environment, to compensate for the shell not having these by default. Our https://hub.docker.com/r/graphistry/gpu-base/ stock GPU container is built with an environment that gets amended via https://github.com/graphistry/infrastructure/blob/master/container-images/gpu-base/Dockerfile#L10 (this is how I'd do it now, as I've since learned), but that's how we find things work in production for us. Suggestions welcome :) |
@lsb I don't think I follow, this thread is about the driver libraries at build time, not the CUDA binaries/libraries. The CUDA toolkit is always present at build time, and you don't need a GPU or the NVIDIA driver to compile/build. By the way, we already set those variables in the environment/ld.cache: |
Ah, thank you |
Hello,
I would like to call nvidia-smi in Dockerfile, but docker building fails. My Dockerfile:
FROM nvidia/cuda:7.5-cudnn5-devel
RUN nvidia-smi
CMD /bin/bash
I am using building command: nvidia-docker build -t gpu ., but error message is displayed:
/bin/sh: 1: nvidia-smi: not found
When I build another docker image based on nvidia/cuda:7.5-cudnn5-devel and run container using such image, command nvidia-smi works. It seems nvidia GPU and its libraries are not available during docker image building.
Could you help me?
The text was updated successfully, but these errors were encountered: