在成功安装和测试使用GPU支持编译的Tensorflow之后,我最近遇到了一个问题.
重新启动计算机后,当我尝试运行Tensorflow程序时收到以下错误消息:
...
('Extracting', 'MNIST_data/t10k-labels-idx1-ubyte.gz')
modprobe: FATAL: Module nvidia-uvm not found in directory /lib/modules/4.4.0-34-generic
E tensorflow/stream_executor/cuda/cuda_driver.cc:491] failed call to cuInit: CUDA_ERROR_UNKNOWN
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:140] kernel driver does not appear to be running on this host (caffe-desktop): /proc/driver/nvidia/version does not exist
I tensorflow/core/common_runtime/gpu/gpu_init.cc:92] No GPU devices available on machine.
(0, 114710.45)
(1, 95368.891)
...
(98, 56776.922)
(99, 57289.672)
代码:https://github.com/llSourcell/autoencoder_demo
问:为什么重新启动Ubuntu 16.04机器会破坏Tensorflow?
解决方法:
我实际上解决了我自己的问题,并希望分享对我有用的解决方案.
谷歌的神奇搜索是:
“modprobe:致命:在目录/ lib / modules /中找不到模块nvidia-uvm”
这导致我在askubuntu上得到以下答案:
https://askubuntu.com/a/496146
该答案的作者Sneetsher在解释方面做得非常好,如果链接不是404,我会从那里开始.
悬崖笔记
诊断:我怀疑Ubuntu可能在重新启动时安装了内核更新.
解决方案:重新安装NVIDIA驱动程序修复了错误.
问题:无法在运行X服务器的情况下安装NVIDIA驱动程序
修复NVIDIA驱动程序的两种不同方法
1)键盘和显示器:
解释askubuntu答案:
1) Switch to text-only console (Ctrl+Alt+F1 or any to F6).
2) Build driver modules for the current kernel (which just installed)
sudo ./<DRIVER>.run -K
信用“Sneetsher”:https://askubuntu.com/a/496146
我没有连接到这台PC的键盘或显示器,所以这是我实际使用的“无头”方法:
2)通过SSH:
按照本指南重新启动到控制台:
http://ubuntuhandbook.org/index.php/2014/01/boot-into-text-console-ubuntu-linux-14-04/
$sudo cp -n /etc/default/grub /etc/default/grub.orig
$sudo nano /etc/default/grub
$sudo update-grub
根据上面的链接编辑grub文件(3个更改):
- Comment the line GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”, by adding # at the beginning, which will disable the Ubuntu purple screen.
- Change GRUB_CMDLINE_LINUX=”” to GRUB_CMDLINE_LINUX=”text”, this makes Ubuntu boot directly into Text Mode.
Uncomment this line #GRUB_TERMINAL=console, by removing the # at the beginning, this makes Grub Menu into real black & white Text Mode (without background image)
UPDATE: (If running Ubuntu 16.04 If
$sudo systemctl set-default multi-user.targetReboot into console
$sudo shutdown -r now
$sudo service lightdm stop
$sudo ./<DRIVER>.run
按照NVIDIA驱动程序安装程序
$sudo mv /etc/default/grub /etc/default/grub.textonly
$sudo mv /etc/default/grub.orig /etc/default/grub
$sudo update-grub
$sudo shutdown -r now
结果(现在看起来像GPU成功检测到了什么)
...
('Extracting', 'MNIST_data/t10k-labels-idx1-ubyte.gz')
I tensorflow/core/common_runtime/gpu/gpu_init.cc:118] Found device 0 with properties:
name: GeForce GTX 970
major: 5 minor: 2 memoryClockRate (GHz) 1.342
pciBusID 0000:01:00.0
Total memory: 3.94GiB
Free memory: 3.88GiB
I tensorflow/core/common_runtime/gpu/gpu_init.cc:138] DMA: 0
I tensorflow/core/common_runtime/gpu/gpu_init.cc:148] 0: Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:868] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 970, pci bus id: 0000:01:00.0)
(0, 113040.92)
(1, 94895.867)
...
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。