找回密码
 立即注册
查看: 1338|回复: 0

Linux下双显卡切换

[复制链接]

6782

主题

8

回帖

2万

积分

管理员

积分
21777
发表于 2019-5-20 20:37:21 | 显示全部楼层 |阅读模式
(1)查看显卡是否正常识别

[root@localhost gyq]# lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Device 0116 (rev 09)
01:00.0 VGA compatible controller: ATI Technologies Inc Device 6741

(2)查看内核版本
[root@localhost gyq]# uname -a
Linux localhost.localdomain 2.6.40-4.fc15.i686 #1 SMP Fri Jul 29 18:54:39 UTC 2011 i686 i686 i386 GNU/Linux

(3)查看显卡工作状态
[root@localhost gyq]# cat /sys/kernel/debug/vgaswitcheroo/switch  
0:IGD:+:Pwr:0000:00:02.0
1:DIS: :Pwr:0000:01:00.0
注:+号表示目前工作的显卡  
  
(4)显卡切换
[root@localhost gyq]# echo OFF > /sys/kernel/debug/vgaswitcheroo/switch  

(5)查看切换结果

[root@localhost gyq]# dmesg | tail -2
[   82.404858] TCP lp registered
[  218.270692] radeon: switched off

(6)查看显卡工作状态
[root@localhost gyq]# cat /sys/kernel/debug/vgaswitcheroo/switch  
0:IGD:+:Pwr:0000:00:02.0
1:DIS: :Off:0000:01:00.0



最好把 echo OFF > /sys/kernel/debug/vgaswitcheroo/switch 写在/etc/rc.d/rc.local里面



# 切换
root@BOX:~# echo DDIS > /sys/kernel/debug/vgaswitcheroo/switch
root@BOX:~# cat /sys/kernel/debug/vgaswitcheroo/switch
0: :Off:0000:00:02.0
1:+:Pwr:0000:01:00.0
# 查看dmesg信息
root@BOX:~# dmesg | tail -2
[17815.585947] fbcon: Remapping primary device, fb1, to tty 1-63
[17816.075748] i915: switched off
# 切换回去
root@BOX:~# echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch
root@BOX:~# dmesg | tail -2
[17894.401107] fbcon: Remapping primary device, fb0, to tty 1-63
[17894.401262] radeon: switched off
root@BOX:~# cat /sys/kernel/debug/vgaswitcheroo/switch
0:+:Pwr:0000:00:02.0
1: :Off:0000:01:00.0
root@BOX:~#
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表