分页: 1 / 1

debian切换双显卡

发表于 : 2015-10-02 18:10
yangdawei.hit
系统:Debian Jessie
显卡:nvidia gt 620m
intel 3rd gen core processor graphics controller

经过poloshiao和vickycq的指点(见viewtopic.php?f=165&t=472945),已经能够安装合适的nvidia闭源显卡驱动。现在遇到新的问题,如何切换显卡?

阅读了Bumblebee的用法(见https://wiki.debian.org/Bumblebee#Bumblebee_Project),里面只是假设系统没有安装nvidia驱动,同时安装闭源驱动和Bumblebee。对于已经安装了闭源驱动的情况,应如何处理呢?是否仅仅安装bumblebee就可以呢?其中需要注意哪些要点?继续请教各位,期待指点。

代码: 全选

sudo lshw -class video
[sudo] password for yangdawei: 
  *-display               
       description: 3D controller
       product: GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: driver=nvidia latency=0
       resources: irq:16 memory:f2000000-f2ffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:5000(size=128)
  *-display UNCLAIMED
       description: VGA compatible controller
       product: 3rd Gen Core processor Graphics Controller
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 09
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list
       configuration: latency=0
       resources: memory:f3000000-f33fffff memory:d0000000-dfffffff ioport:6000(size=64)
另外,网上说*-display UNCLAIMED表示没有该模块没有被加载,见http://ubuntuforums.org/showthread.php?t=870807。是否由于默认启用nvidia显卡的原因呢?

Re: debian切换双显卡

发表于 : 2015-10-02 18:24
yangdawei.hit
刚尝试安装了一下bumblebee,重启后就进不了桌面了,按之前的认识删除了 /etc/X11/xorg.conf,再启机就进入桌面系统了。但再次查看显卡,发现nvidia显卡不见了。
始终没有见一个全面的nvidia和intel显卡的管理介绍。还请各位给出具体一些的指导。

Re: debian切换双显卡

发表于 : 2015-10-02 18:38
poloshiao
现在遇到新的问题,如何切换显卡?
1. viewtopic.php?p=3144143#p3144143
11-1. 切換工具
*-display UNCLAIMED
product: 3rd Gen Core processor Graphics Controller
vendor: Intel Corporation
physical id: 2
configuration: latency=0
2. 把下面指令 複製 貼進終端機 執行
sudo lsmod | grep i915
把結果直接 選取/複製 貼上來
是否由于默认启用nvidia显卡的原因呢?
3. 如何設定 默认启用nvidia显卡 ?

Re: debian切换双显卡

发表于 : 2015-10-02 19:15
yangdawei.hit
2. 把下面指令 複製 貼進終端機 執行
sudo lsmod | grep i915
把結果直接 選取/複製 貼上來

代码: 全选

i915                 1028096  0
drm_kms_helper        102400  1 i915
drm                   278528  2 i915,drm_kms_helper
i2c_algo_bit           16384  1 i915
video                  20480  1 i915
button                 16384  1 i915
3. 如何設定 默认启用nvidia显卡 ?
是的,我希望默认启用nvidia显卡,感觉温度高时可以随时切换到intel显卡。

Re: debian切换双显卡

发表于 : 2015-10-02 20:09
poloshiao
抱歉 沒把問題 描述清楚
我是想弄清楚這句話 :
是否由于默认启用nvidia显卡的原因呢?
你如何設定默认启用nvidia显卡

Re: debian切换双显卡

发表于 : 2015-10-02 20:13
yangdawei.hit
1. viewtopic.php?p=3144143#p3144143
11-1. 切換工具
阅读了Hybrid Graphics方案。(https://help.ubuntu.com/community/Hybri ... ch_the_GPU)可是查看vgaswitcherroo时没有这个目录。是否因为Debian没有这个机制呢?

代码: 全选

 sudo cat /sys/kernel/debug/vgaswitcheroo/switch
cat: /sys/kernel/debug/vgaswitcheroo/switch: No such file or directory
另,因如下原因:
vga_switcheroo is the kernel mechanism that allows you to switch between GPUs if your machine has a hardware mux. Note that this method is not supported by all machines and only works if you are using the opensource driver (nouveau, radeon) and not the proprietary ones (nvidia, fglrx).
我卸载了闭源nvidia驱动

代码: 全选

sudo nvidia-installer --uninstall
然后按要求修改了grub

代码: 全选

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i915.modeset=1" 

代码: 全选

sudo update-grub
再启机后查看显卡状态为:

代码: 全选

  *-display UNCLAIMED     
       description: 3D controller
       product: GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: latency=0
       resources: memory:f2000000-f2ffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:5000(size=128)
  *-display
       description: VGA compatible controller
       product: 3rd Gen Core processor Graphics Controller
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 09
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:30 memory:f3000000-f33fffff memory:d0000000-dfffffff ioport:6000(size=64)

Re: debian切换双显卡

发表于 : 2015-10-02 21:11
vickycq
刚尝试安装了一下bumblebee,重启后就进不了桌面了,按之前的认识删除了 /etc/X11/xorg.conf,再启机就进入桌面系统了。但再次查看显卡,发现nvidia显卡不见了。
Bumblebee不会自动切换显卡,只会默认禁用独立显卡。什么时候需要独立显卡了,就使用 optirun / primusrun 以独立显卡运行程序。
如需用独立显卡玩Minecraft : primusrun java -jar Hello_Minecraft_Launcher.jar
阅读了Bumblebee的用法(见https://wiki.debian.org/Bumblebee#Bumblebee_Project),里面只是假设系统没有安装nvidia驱动,同时安装闭源驱动和Bumblebee。对于已经安装了闭源驱动的情况,应如何处理呢?是否仅仅安装bumblebee就可以呢?其中需要注意哪些要点?继续请教各位,期待指点。
sudo nvidia-installer --uninstall
没看错的话,你的闭源驱动(NVIDIA)是从官网下载手工安装,而不是从软件源安装的?
可以尝试只安装 'bumblebee' 这个包,此包的配置默认令 bumblebee 使用 nouveau 驱动。参见以下链接配置 bumblebee 使用 nvidia 私有驱动:
https://github.com/Bumblebee-Project/Bu ... figuration
https://github.com/Bumblebee-Project/Bu ... issues/685
也可以尝试自己编译安装bumblebee:https://wiki.debian.org/Bumblebee/ManualInstall

也可以把手工安装的驱动完全卸载,再从软件源安装 'bumblebee-nvidia',会自动从软件源安装私有驱动,并配置bumblebee使用nvidia私有驱动。
观察了一会儿,又变成了49度了。刚才安装了 bumblebee-nvidia ,但重启后仅在应用菜单中看到了NVIDIA Server Settings项,点击弹出消息称You do not appear to be using the NVIDIA X driver.
感觉这时候你的双显卡已经正常工作了。此时默认禁用独立显卡。什么时候需要独立显卡了,就使用 optirun / primusrun 以独立显卡运行程序。
此时应该用 sudo bumblebeed --debug 查看配置是否正确,是否使用nvidia驱动,optirun / primusrun 能否正常运作
poloshiao 写了: 11-1. 切換工具
11-1-1. bbswitch
11-1-2. vga_switcheroo
這是 Ubuntu 的文章 是否適合於 Debian ? 待查證.
1. bbswitch 在 debian 中独立打包为 'bbswitch-dkms',且在 bumblebee 3.0 及以后的版本中默认启动。如果 bumblebee 是从软件源安装的,会自动安装此包。
https://wiki.debian.org/Bumblebee#Power_Management
2. vga_switcheroo 只适用于 nouveau 开源驱动

Re: debian切换双显卡

发表于 : 2015-10-02 21:36
yangdawei.hit
没看错的话,你的闭源驱动(NVIDIA)是从官网下载手工安装,而不是从软件源安装的?
可以尝试只安装 'bumblebee' 这个包,此包的配置默认令 bumblebee 使用 nouveau 驱动。
也可以把手工安装的驱动完全卸载,再从软件源安装 'bumblebee-nvidia',会自动从软件源安装私有驱动,并配置bumblebee使用nvidia私有驱动。
是的,我卸载了官网手工安装的驱动。按你的建议安装了bumblebee-nvidia。

代码: 全选

sudo apt-get install bumblebee bumblebee-nvidia
配置bumblebee就改动了bumblebee.conf一处:

代码: 全选

[bumblebeed]
Driver=nvidia
原文件该选项是空的,说如果不填就自动选择。我的理解是,如果填上这一项,启机自动选择的就是nvidia驱动。


重启后执行sudo lshw -class video显示:

代码: 全选

  *-display               
       description: VGA compatible controller
       product: 3rd Gen Core processor Graphics Controller
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 09
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:30 memory:f3000000-f33fffff memory:d0000000-dfffffff ioport:6000(size=64)
看来只是驱动了intel显卡。到这时我才明白,如果display后面跟UNCLAIMED,就是说这个显卡没驱动起来。而Nvidia显卡显然是没被识别。

我猜可能bumblebee配置中选择了nvidia驱动,可是并没有找到这个驱动,因此也就没有识别这个显卡。不知猜得对不对。另外,如果只显示一块显卡,那么bbswitch也就用不上了吧。

代码: 全选

sudo bumblebeed --debug 
[  525.629657] [DEBUG]bbswitch has been detected.
[  525.629716] [INFO]Switching method 'bbswitch' is available and will be used.
[  525.629735] [DEBUG]Active configuration:
[  525.629752] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[  525.629769] [DEBUG] X display: :8
[  525.629784] [DEBUG] LD_LIBRARY_PATH: /usr/lib/x86_64-linux-gnu/nvidia:/usr/lib/i386-linux-gnu/nvidia:/usr/lib/nvidia
[  525.629800] [DEBUG] Socket path: /var/run/bumblebee.socket
[  525.629817] [DEBUG] pidfile: /var/run/bumblebeed.pid
[  525.629833] [DEBUG] xorg.conf file: /etc/bumblebee/xorg.conf.nvidia
[  525.629849] [DEBUG] xorg.conf.d dir: /etc/bumblebee/xorg.conf.d
[  525.629865] [DEBUG] ModulePath: /usr/lib/nvidia,/usr/lib/xorg/modules
[  525.629882] [DEBUG] GID name: bumblebee
[  525.629899] [DEBUG] Power method: auto
[  525.629915] [DEBUG] Stop X on exit: 1
[  525.629931] [DEBUG] Driver: nvidia
[  525.629947] [DEBUG] Driver module: nvidia-current
[  525.629962] [DEBUG] Card shutdown state: 1
[  525.630122] [DEBUG]Process /sbin/modprobe started, PID 1696.
[  525.630259] [DEBUG]Hiding stderr for execution of /sbin/modprobe
[  525.632493] [DEBUG]SIGCHILD received, but wait failed with No child processes
[  525.632541] [DEBUG]Configuration test passed.
[  525.632620] [ERROR]Daemon already running, pid 617
不知道最后一行error信息的含义是什么?

Re: debian切换双显卡

发表于 : 2015-10-02 21:44
vickycq
yangdawei.hit 写了: 是的,我希望默认启用nvidia显卡,感觉温度高时可以随时切换到intel显卡。
https://bbs.archlinux.org/viewtopic.php?id=154458
http://www.linuxforums.org/forum/hardwa ... vidia.html

Re: debian切换双显卡

发表于 : 2015-10-02 21:58
vickycq
[ 525.629931] [DEBUG] Driver: nvidia
[ 525.629947] [DEBUG] Driver module: nvidia-current
正常工作了。
[ 525.629962] [DEBUG] Card shutdown state: 1
因为正常工作了,所以独立显卡被默认关闭。什么时候需要独立显卡了,就使用 optirun / primusrun 以独立显卡运行程序。
如需用独立显卡玩Minecraft : primusrun java -jar Hello_Minecraft_Launcher.jar
[ 525.632620] [ERROR]Daemon already running, pid 617
bumblebeed 守护进程已经在运行了。用 bumblebeed --debug 检查配置也会试图启动bumblebeed。但因为已经在运行了,所以防呆机制启动。

Re: debian切换双显卡

发表于 : 2015-10-02 22:22
vickycq

代码: 全选

sudo apt install primus mesa-utils
optirun glxgears 或 primusrun glxgears
此时再用 lshw -C display 和 bumblebeed --debug 观察状态,看是否正常运作

Re: debian切换双显卡

发表于 : 2015-10-03 7:08
poloshiao
debian切换双显卡
1. 想要更進一步 徹底駕馭切换双显卡
一定需要先確認你的 nvidia 顯卡是
MUXedMUXless

2. 什麼是 MUX
https://zh.wikipedia.org/wiki/%E6%95%B0 ... 9%E5%99%A8
數據多工器
http://en.wikipedia.org/wiki/Multiplexer (or mux)
Multiplexer (or mux)

3. 什麼是 MUXed
http://wiki.cchtml.com/index.php/Features#MUXed_Systems

4. 什麼是 MUXless
http://wiki.cchtml.com/index.php/Featur ... ss_Systems

5. nVidia 顯卡是 MUXed 或 MUXless ?
https://forums.geforce.com/default/topi ... 6/#4206266
早期的 nVidia 顯卡大多是 MUXed (所以可以歸類為獨顯 可以從 Bios 啟用/關閉 啟用/關閉/切換)
目前的 nVidia 顯卡 (包含 Optimus 顯卡) 是 MUXless (所以無法從 Bios 啟用/關閉 只能使用 驅動或軟體 啟用/關閉/切換)
5-1. 目前使用 nVidia 顯卡 (包含 Optimus 顯卡) MUXless 的困境
https://forums.geforce.com/default/topi ... 6/#4206266
5-1-1. I had asked this "drivers" to NVIDIA`s technical support(=chat), and I got answer .
The answer is.. "We consider Optimus / non Optimus circuits to make drivers. All circuits, technical supports are "device maker"`s responsibility.
nVidia 同時考慮 Optimus / 非 Optimus 電流線路 但是 實際上的 電流線路 歸屬於 設備 (例如 晶片/主板) 製造者的責任
意思是 萬一兩者不適配 跟 nVidia 無關
5-1-2. And last, all of "makers" uses MUXless design, because MUXless design is cheaper than MUXed design
意思是 MUXless 比較便宜 所以大多數 設備 (例如 晶片/主板) 製造者 提供 MUXless 設計

6. Ubuntu 對於 MUXed 或 MUXless 的策略
https://blueprints.launchpad.net/ubuntu ... d-graphics

7. Debian 對於 MUXed 或 MUXless 的策略
<如果 網友有發現 請幫忙補充>

8. 建議
目前使用 開源驅動 / 閉源驅動 在 Optimus 顯卡 引起的問題
主要在於 MUXed 或 MUXless 的糾結 定位不清楚
8-1. 購買硬件時 查閱清楚 顯卡硬件規格 是 MUXed 或 MUXless
8-1-1. 晶片/主板/Bios/UEFI 是否支援 MUXed 或 MUXless
8-2. 引用 驅動/軟體時 查閱清楚 適用於 MUXed 或 MUXless

Re: debian切换双显卡

发表于 : 2015-10-03 15:09
yangdawei.hit
@poloshiao @vickycq 跟二位学习大涨知识啊。

我现在是彻底关闭nvidia显卡,即不加载。且驱动intel显卡。这样本子温度终终在52度左右,风扇也不吵。看来,当挂载了nividia 显卡又没有正确趋动时,很容易会使本子温度提升到70度。