Olá, tenho um Notebook HP G42-371BR que veio com Windows 7 Home Basic. Estou usando nele o Ubuntu 13.10 (Saucy Salamander) 64 Bits. Ele tem duas placas de vídeo (integrada e discreta). Quando inicio o sistema ele usa a integrada, e eu gostaria de ativar a discreta para os jogos. Pesquisei na internet e descobrir o vgaswitcheroo. O meu problema é o seguinte, quando executo os comandos para ativar a discreta e depois o comando: gnome-session-quit --logout --force, para finalizar a sessão. Ele finaliza a sessão mas não volta, fica em uma tela preta com o computador travado. O que devo fazer para resolver isso?
Kernel: 3.11.0-3-generic
Resultado do comando lspci:
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] RS880 Host Bridge
00:01.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] RS780/RS880 PCI to PCI bridge (int gfx)
00:03.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] RS780 PCI to PCI bridge (ext gfx port 1)
00:05.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] RS780/RS880 PCI to PCI bridge (PCIE port 1)
00:06.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] RS780 PCI to PCI bridge (PCIE port 2)
00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode]
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 SMBus Controller (rev 42)
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA) (rev 40)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 LPC host controller (rev 40)
00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 PCI to PCI Bridge (rev 40)
00:14.5 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
00:16.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:16.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor HyperTransport Configuration
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Address Map
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Miscellaneous Control
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Link Control
01:05.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RS880M [Mobility Radeon HD 4225/4250]
01:05.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] RS880 HDMI Audio [Radeon HD 4200 Series]
02:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Robson CE [Radeon HD 6370M/7370M]
04:00.0 Network controller: Broadcom Corporation BCM4313 802.11bgn Wireless Network Adapter (rev 01)
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)
Conteúdo do arquivo /etc/rc.local:
chown eduslack /sys/kernel/debug
chown eduslack /sys/kernel/debug/vgaswitcheroo/switch
Contéudo do arquivo /sys/kernel/debug/vgaswitcheroo/switch:
0:IGD:+:Pwr:0000:01:05.0
1:DIS: :Pwr:0000:02:00.0
Script utilizado:
#!/bin/bash
#Script para alternar entre placas de video by kriador
#versao 20110429 para ubuntu+kernel 2.6.38
#subindo o modulo radeon
modprobe radeon
#Checando status das GPUs
STATEDIS=`cat /sys/kernel/debug/vgaswitcheroo/switch | grep :DIS: | cut -c6-12`
STATEIGD=`cat /sys/kernel/debug/vgaswitcheroo/switch | grep :IGD: | cut -c6-12`
#Definindo status das GPUs
if [ "$STATEDIS" == ":+:Pwr:" ] && [ "$STATEIGD" == ": :Pwr:" ] || [ "$STATEDIS" == ":+:Pwr:" ] && [ "$STATEIGD" == ": :Off:" ]
then
VGASTATE="GPU para Alto Desempenho"
VGAOFF="GPU para Economia de Energia"
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
elif [ "$STATEDIS" == ": :Pwr:" ] && [ "$STATEIGD" == ":+:Pwr:" ] || [ "$STATEDIS" = ": :Off:" ] && [ "$STATEIGD" = ":+:Pwr:" ]
then
VGASTATE="GPU para Economia de Energia"
VGAOFF="GPU para Alto Desempenho"
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
else
VGASTATE="Erro de Leitura de estado"
VGAOFF="Erro de Leitura de estado"
fi
#pegando o PID do X
PIDX=`pgrep X`
#criando a dialog
zenity --question --title "VGA Switcher" --text "Unidade Grafica Atualmente Em Uso:\n\n$VGASTATE\n\nDeseja Alternar para $VGAOFF ?"
#realizando a mudança
if [ "$?" == "0" ]
then
if [ "$STATEDIS" == ":+:Pwr:" ]
then
echo ON > /sys/kernel/debug/vgaswitcheroo/switch
echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch
zenity --warning --title "VGA Switcher" --text "Alternando para GPU Integrada\nSua Sessão será reiniciada"
#kill $PIDX
gnome-session-quit --logout --force
elif [ "$STATEIGD" = ":+:Pwr:" ]
then
echo ON > /sys/kernel/debug/vgaswitcheroo/switch
echo DDIS > /sys/kernel/debug/vgaswitcheroo/switch
zenity --warning --title "VGA Switcher" --text "Alternando para GPU Discreta\nSua Sessão será reiniciada"
#kill $PIDX
gnome-session-quit --logout --force
else zenity --warning --title "VGA Switcher" --text "Houve um erro inesperado, por favor notificar a criador desse script no e-mail kriador@gmail.com"
fi
else exit
fi