gpt4 book ai didi

docker - 无法加载动态库 'libcuda.so.1'; dlerror : libcuda. so.1:无法打开共享对象文件:没有这样的文件或目录

转载 作者:行者123 更新时间:2023-12-05 08:06:07 33 4
gpt4 key购买 nike

我正在 mt 计算机上构建 Docker,其中 NVDIA GPU 不可用。我使用 tensorflow/tensorflow Docker 镜像作为带 CPU 的基础镜像。

docker 文件

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 运行它。

最佳答案

我正在使用 tensorflow 服务并遇到这个问题,我发现 TFS dockerfile.gpu 基于 docker image nvidia/cuda,所以,在安装 nvidia-docker 后,解决了这个问题。希望这对您有所帮助。

关于docker - 无法加载动态库 'libcuda.so.1'; dlerror : libcuda. so.1:无法打开共享对象文件:没有这样的文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62351943/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com