在CUDA与Windows的性能严重下,使英特尔主GPU?

我在双引导系统( Windows 10Ubuntu 16.04.x )上完成了GPU tensorflow安装

两个操作系统的驱动程序版本大致相同

 Lenovo P50 laptop with Nvidia Quadro M1000M Windows 376.51 nvidia driver version Ubuntu 375.66 nvidia driver version 

我训练深度学习模型,每个训练集花费的时间差别很大

 Windows 10 + Tensorflow 1.3 GPU + CUDA = 8 min. per epoch Ubuntu 16.04 + Tensorflow 1.3 GPU + CUDA = 45 min. per epoch 

Ubuntu安装是通过apt-get (不是source install)和pip所有默认设置

到目前为止,我的一个想法是,我必须使用NVIDIA GPU绘制图形……而不是将所有GPU用于计算……有没有办法检查这个? 我已经安装了所有相同的东西..包括CUDA 8.x的补丁

我甚至不清楚问题是什么,但看起来驱动程序设置为使用Optimus ..也许我需要将其切换到不同的配置文件?

在此处输入图像描述

想法一:我明天可能会尝试从源代码重新编译tensorflow ..在Ubuntu 16.x中进行所有CPU优化..也许pip安装比Windows上的二进制安装更痛苦…

想法二:如果上面什么也没做,我将进入BIOS并强制intel集成显卡..重新安装并尝试安装noveua图形..有点像这样:

似乎这是一台“Optimus”启用的笔记本电脑..我不能完全关闭nvidia gpu进行渲染,只能启用混合模式。 也许我会做一个全新安装..删除所有的nvidia驱动程序,看看我是否可以让X工作那样..?

Build Personal Deep Learning Rig: GTX 1080 + Ubuntu 16.04 + CUDA 8.0RC + CuDnn 7 + Tensorflow/Mxnet/Caffe/Darknet

 "So I went to BIOS and set the integrated graphics as default and restart. Remember to switch the HDMI from the port on GTX1080 to that on the motherboard. Now the display works well. I successfully installed Ubuntu following its prompt guides." 

https://devtalk.nvidia.com/default/topic/991849/-solved-run-cuda-on-dedicated-nvidia-gpu-while-connecting-monitors-to-intel-hd-graphics-is-this-possible – /

 When installing the NVIDIA display driver, be sure to: 1. not install the openGL libs (there are command line options with driver runfile installers or CUDA runfile installers to allow this) 2. make sure not to make any changes to the xorg.conf configuration. 

经过多次狩猎,搜索……煤炭化……我成功地找到了问题并修复了它! 是的,Windows中的英特尔GPU正在被使用,而在Linux中却未被利用……迫使NVIDIA GPU绘制屏幕并丢失资源。

我在以前的系统上重新安装了一个新的Ubuntu 16.04 USB Stick ..

 During reinstallation choose updates, but don't use 3rd party libraries 

安装完成后,您应该validation您是否处于英特尔驱动程序模式…而不是Nvidia的专有驱动程序。

现在来了奇怪的部分

这里的用户指出了同样的问题..但是对于桌面部署

https://devtalk.nvidia.com/default/topic/991849/cuda-setup-and-installation/-solved-run-cuda-on-dedicated-nvidia-gpu-while-connecting-monitors-to-intel-hd -graphics-是此结果possible- /

基本上…

总之,为了使这个工作,你需要

 1. make sure you have enabled onboard graphics in the BIOS settings (or set it as primary) 

我做混合模式..因为没有英特尔选项

 2. install both xorg intel driver and nvidia/cuda drivers 

在这里,你需要传递旗帜

 --no-opengl-files //for the driver install I choose latest (384) --no-openfl-libs // cuda 8.0 + patch here .. 

一定要禁用nouveau ..以及说明中列出的所有步骤..

知道你很好的主要方式..安装glmark2并始终确保它输出英特尔

 3. start nvidia-settings, and go to the PRIME settings page, set Intel (Power Saving Mode) as default 4. modify your .bashrc and set LD_LIBRARY_PATH to at least contain /usr/local/cuda/lib64:/usr/lib/nvidia-XXX where XXX in my case is 375. 

这个文件夹对我来说根本不存在。 我仍然添加了post install cuda指令中概述的默认LD_LIBRARY_PATHPATH

 4. logout to restart X or reboot 5. run glmark2 to confirm GL status 

既然你应该安装而不安装opengl文件..这可能是不必要的

 6. (update) if the libGL printed from step 5 points to nvidia's driver folder, you need to remove/rename the libGL.so*/libGLX.so*/libGLdispatch.so* under nvidia driver folder so that your OS can pick up the mesa libGL library. 7. run nvidia-smi to list your dedicated NVIDIA GPU, and run your CUDA program, you should not see any errors. 

这对我来说不起作用,直到我运行nvidia-modprobe一次..然后突然一切都奏效了。

更新:可悲的是重新启动打破了配置。 不知道如何修复……