【问题标题】:Jupyter Notebook Kernel dies when importing Tensorflow导入 Tensorflow 时 Jupyter Notebook 内核死机
【发布时间】:2018-12-02 05:54:50
【问题描述】:

我正在尝试在包含在我的 Ubuntu 18.04 Bionic Beaver 服务器上运行的 docker 内的 jupyter 笔记本上使用 Tensorflow-gpu。

我已完成以下步骤:
1) 已安装 Nvidia 驱动程序 390.67 sudo apt-get install nvidia-driver-390
2) 已安装 CUDA 驱动程序 9.0 cuda_9.0.176_384.81_linux.run
3) 安装 CuDNN 7.0.5 cudnn-9.0-linux-x64-v7.tgz
4) 安装Dockersudo apt install docker-ce
5)安装nvidia-docker2sudo apt install nvidia-docker2

我尝试执行以下操作 nvidia-docker run -it -p 8888:8888 tensorflow/tensorflow:1.5.1-gpu-py3

我使用 Tensorflow 1.5.1 的原因是因为我在 1.8.0-gpu-py 和我 read that you need to use Tensorflow 1.5 for older CPUs. 上遇到了同样的内核死错误,我认为这不是真正的问题,因为我正在尝试简单地导入它,我正在使用 tensorflow-gpu

当我第一次运行任何导入 tensorflow 的单元格时,我会得到

我的服务器硬件如下

CPU: AMD Phenom(tm) II X4 965 Processor
GPU: GeForce GTX 760
Motherboard: ASRock 960GM/U3S3 FX
Memory: G Skill F3-1600C9D-8GAB (8 GB Memory)

当我简单地使用 import tensorflow as tf 导入 tensorflow 时,我如何确定内核死亡的原因。

这是 nvidia-docker smi 的结果

$ docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
Fri Jun 22 17:53:20 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.67                 Driver Version: 390.67                    |
|-------------------------------+----------------------+----------------------+
| 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 GTX 760     Off  | 00000000:01:00.0 N/A |                  N/A |
|  0%   34C    P0    N/A /  N/A |      0MiB /  1999MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0                    Not Supported                                       |
+-----------------------------------------------------------------------------+

如果我在 docker 外部使用 nvidia-smi,这完全匹配。

这是 nvcc --version 结果:

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Sep__1_21:08:03_CDT_2017
Cuda compilation tools, release 9.0, V9.0.176

如果我尝试执行 nvidia-docker run -it -p 8888:8888 tensorflow/tensorflow:1.5.1-gpu-py3 bash 以调出 bash 提示符,然后当我执行 import tensorflow as tf 时我通过 python 进入 python 会话,我得到 Illegal instruction (core dumped) 所以它在非 jupyter 中不起作用环境也好。即使我先执行import numpy,然后执行import tensorflow as tf,此错误仍然存​​在

【问题讨论】:

    标签: python docker tensorflow jupyter-notebook


    【解决方案1】:

    原来我需要降级到 tensorflow 1.5.0。 1.5.1 是添加 AVX 的地方。 AVX 指令显然用于模块加载以设置库。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-07
      • 1970-01-01
      • 1970-01-01
      • 2016-05-14
      • 1970-01-01
      • 2020-04-21
      相关资源
      最近更新 更多