无法加载动态库"libcuda.so.1";dlerror:libcuda.so.1:无法打开共享对象文件:没有这样的文件或目录 [英] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory

查看:655
本文介绍了无法加载动态库"libcuda.so.1";dlerror:libcuda.so.1:无法打开共享对象文件:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在mt计算机中进行Docker构建,而NVDIA GPU不可用.我使用tensorflow/tensorflow Docker映像作为CPU的基础映像.

I am doing a Docker build in mt computer where NVDIA GPU is not available. I use tensorflow/tensorflow Docker image as the base image with CPU.

Dockerfile

Dockerfile

FROM tensorflow/tensorflow 
WORKDIR /project
COPY /app .
RUN python3 main.py

但是显示错误

2020-06-12 20:06:56.822576: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2020-06-12 20:06:56.825090: E tensorflow/stream_executor/cuda/cuda_driver.cc:313] failed call to cuInit: UNKNOWN ERROR (303)
2020-06-12 20:06:56.827746: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (735abddf4141): /proc/driver/nvidia/version does not exist
2020-06-12 20:06:56.837312: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-06-12 20:06:57.040593: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 2400000000 Hz
2020-06-12 20:06:57.045853: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f377c000b20 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-06-12 20:06:57.045913: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-06-12 20:07:07.017642: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 614400000 exceeds 10% of free system memory.
Killed

运行此代码时

model = tf.keras.models.Sequential([
                        tf.keras.layers.Conv2D(32, (3, 3), activation='relu', input_shape=(32, 32, 3)),
                        tf.keras.layers.MaxPooling2D(2, 2),
                        tf.keras.layers.Conv2D(64, (3, 3), activation='relu'),
                        tf.keras.layers.MaxPooling2D(2, 2),
                        tf.keras.layers.Conv2D(64, (3, 3), activation='relu'),
                        tf.keras.layers.Flatten(),
                        tf.keras.layers.Dense(128, activation='relu'),
                        tf.keras.layers.Dense(10, activation='softmax')])

我不想使用GPU版本.我需要在CPU上运行它.

I don't want to use GPU version. I need to run this with CPU.

推荐答案

作为@Dr.史努比(Snoopy)评论这是内存错误.您应该例如在此帖子

As @Dr. snoopy has commented this is a memory error. you should increase the docker memory for example following this post

这篇关于无法加载动态库"libcuda.so.1";dlerror:libcuda.so.1:无法打开共享对象文件:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆