简体   繁体   English

在 docker 中运行 CuFFT 时出现 CUDA cudaErrorInsufficientDriver 错误

[英]CUDA cudaErrorInsufficientDriver error when running an CuFFT in docker

i was doing some CUFFT routine in docker and faced some problem.我在 docker 中做一些 CUFFT 例程并遇到了一些问题。 I use the following Dockerfile.我使用以下 Dockerfile。

FROM nvidia/cuda:9.1-runtime-ubuntu16.04
ENV NVIDIA_VISIBLE_DEVICES all
ENV LD_LIBRARY_PATH /usr/local/cuda-9.1/lib64/

FROM python:3.7
COPY --from=0 /usr/local/cuda-9.1 /usr/local/cuda-9.1
ENV VIRTUAL_ENV=/opt/venv
ENV PATH="/opt/venv:$PATH"
RUN pip install numpy
RUN apt update && \
    apt-get -y install gcc && \
    apt-get -y install apt-utils && \
    apt-get -y install g++ && \
    apt-get -y install pciutils && \
    apt-get -y install libc6

ADD helmsolver /helmsolver
CMD ls /usr && ls /usr/local
CMD dpkg -l | grep -i cuda
CMD cd helmsolver && bash tests.sh

To build and run docker i use such commands.要构建和运行 docker 我使用这样的命令。

docker build -t helm .
docker run --gpus all helm

I'm able to run my code on host, but after running in docker the error 35 ( cudaErrorInsufficientDriver ) appears in this type of code cudaMalloc((void**)&d_array, memsize) .我可以在主机上运行我的代码,但是在 docker 中运行后,错误 35 ( cudaErrorInsufficientDriver ) 出现在这种类型的代码cudaMalloc((void**)&d_array, memsize)中。 What's wrong with my code or is it that just some .so files are missing?我的代码有什么问题,还是只是缺少一些.so文件? Here are my CUDA, docker, nvidia-smi versions这是我的 CUDA、docker、nvidia-smi 版本

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85
Docker version 19.03.4
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.67       Driver Version: 418.67       CUDA Version: N/A      |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GT 640      On   | 00000000:01:00.0 N/A |                  N/A |
| 40%   36C    P8    N/A /  N/A |     48MiB /  4035MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 760     On   | 00000000:02:00.0 N/A |                  N/A |
| 17%   36C    P8    N/A /  N/A |      1MiB /  4037MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+

Adding NVIDIA_DRIVER_CAPABILITIES compute, utility as ENV solves the issue.添加NVIDIA_DRIVER_CAPABILITIES compute, utility作为 ENV 解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM