από sotos21 » 07 Μάιος 2012, 22:28
Λοιπόν ξεκινάμε πρώτα απεγκαθιστούμε σωστά τους fglrx
- Κώδικας: Επιλογή όλων
sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev*
- Κώδικας: Επιλογή όλων
sudo apt-get install --reinstall libgl1-mesa-glx libgl1-mesa-dri
- Κώδικας: Επιλογή όλων
sudo dpkg-reconfigure xserver-xorg
- Κώδικας: Επιλογή όλων
sudo rm /etc/X11/xorg.conf
Μετά κάνε επανεκκίνηση
Κοίτα αν υπάρχει το αρχείο switch στη διαδρομή /sys/kernel/debug/vgaswitcheroo/switch δώσε δηλαδή
- Κώδικας: Επιλογή όλων
gksu gedit /sys/kernel/debug/vgaswitcheroo/switch
πρέπει να σου ανοίξει ένα αρχείο που να περιέχει κάτι μέσα δηλαδή να μην είναι κενό.
Αν ναι προχωράμε
Αντέγραψε το παρακάτω αρχείο στο home/username
- Κώδικας: Επιλογή όλων
#!/bin/bash
# "switch_between_cards.sh" script by RM, with useful changes from LoLL
# version 20101107
pci_integrated=$(lspci | grep VGA | sed -n '1p' | cut -f 1 -d " ")
pci_discrete=$(lspci | grep VGA | sed -n '2p' | cut -f 1 -d " ")
integrated=$(cat /sys/kernel/debug/vgaswitcheroo/switch | grep $pci_integrated | grep -o -P ':.:...:')
discrete=$(cat /sys/kernel/debug/vgaswitcheroo/switch | grep $pci_discrete | grep -o -P ':.:...:')
name_integrated=$(lspci | grep VGA | sed -n '1p' | sed -e "s/.* VGA compatible controller[ :]*//g" | sed -e "s/ Corporation//g" | sed -e "s/ Technologies Inc//g" | sed -e 's/\[[0-9]*\]: //g' | sed -e 's/\[[0-9:a-z]*\]//g' | sed -e 's/(rev [a-z0-9]*)//g' | sed -e "s/ Integrated Graphics Controller//g")
name_discrete=$(lspci | grep VGA | sed -n '2p' | sed -e "s/.* VGA compatible controller[ :]*//g" | sed -e "s/ Corporation//g" | sed -e "s/ Technologies Inc//g" | sed -e 's/\[[0-9]*\]: //g' | sed -e 's/\[[0-9:a-z]*\]//g' | sed -e 's/(rev [a-z0-9]*)//g' | sed -e "s/ Integrated Graphics Controller//g")
if [ "$integrated" = ":+:Pwr:" ]
then
integrated_condition="(*) - Power ON"
elif [ "$integrated" = ": :Pwr:" ]
then
integrated_condition="( ) - Power ON"
elif [ "$integrated" = ": :Off:" ]
then
integrated_condition="( ) - Power OFF"
fi
if [ "$discrete" = ":+:Pwr:" ]
then
discrete_condition="(*) - Power ON"
elif [ "$discrete" = ": :Pwr:" ]
then
discrete_condition="( ) - Power ON"
elif [ "$discrete" = ": :Off:" ]
then
discrete_condition="( ) - Power OFF"
fi
gxmessage -center \
-buttons "_Cancel":1,"switch to _Integrated":101,"switch to _Discrete":102 \
-wrap \
-title "Choose Hybrid Graphic Card" \
"Choose Hybrid Graphic Card
=================
Integrated: $integrated_condition : $name_integrated
Discrete: $discrete_condition : $name_discrete"
whichCard=$?
case "$whichCard" in
1)
echo "Exit"
;;
101)
if [ "$integrated" == ":+:Pwr:" ] && [ "$discrete" == ": :Pwr:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_down.png" "switching to $name_integrated"
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
elif [ "$integrated" == ": :Pwr:" ] && [ "$discrete" == ":+:Pwr:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_down.png" "switching to $name_integrated"
echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch
if [ "$DESKTOP_SESSION" = "openbox" ]
then
gnome-session-save --logout
elif [ "$DESKTOP_SESSION" = "gnome" ]
then
gnome-session-save --logout
fi
elif [ "$integrated" == ": :Off:" ] && [ "$discrete" == ":+:Pwr:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_down.png" "switching to $name_integrated"
echo ON > /sys/kernel/debug/vgaswitcheroo/switch
echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch
if [ "$DESKTOP_SESSION" = "openbox" ]
then
gnome-session-save --logout
elif [ "$DESKTOP_SESSION" = "gnome" ]
then
gnome-session-save --logout
fi
elif [ "$integrated" == ":+:Pwr:" ] && [ "$discrete" == ": :Off:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_down.png" "already switched to $name_integrated"
fi
;;
102)
if [ "$integrated" == ":+:Pwr:" ] && [ "$discrete" == ": :Pwr:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_up.png" "switching to $name_discrete"
echo DDIS > /sys/kernel/debug/vgaswitcheroo/switch
if [ "$DESKTOP_SESSION" = "openbox" ]
then
gnome-session-save --logout
elif [ "$DESKTOP_SESSION" = "gnome" ]
then
gnome-session-save --logout
fi
elif [ "$integrated" == ": :Pwr:" ] && [ "$discrete" == ":+:Pwr:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_up.png" "switching to $name_discrete"
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
elif [ "$integrated" == ":+:Pwr:" ] && [ "$discrete" == ": :Off:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_up.png" "switching to $name_discrete"
echo ON > /sys/kernel/debug/vgaswitcheroo/switch
echo DDIS > /sys/kernel/debug/vgaswitcheroo/switch
if [ "$DESKTOP_SESSION" = "openbox" ]
then
gnome-session-save --logout
elif [ "$DESKTOP_SESSION" = "gnome" ]
then
gnome-session-save --logout
fi
elif [ "$integrated" == ": :Off:" ] && [ "$discrete" == ":+:Pwr:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_up.png" "already switched to $name_discrete"
fi
ονόμασε το
switch_between_cards.shΌπου $USER το δικό σου.
Δεξί κλικ -δικαιώματα και όρισε το εκτελέσιμο.
Ανοιξε ένα τερματικό και δώσε
- Κώδικας: Επιλογή όλων
sudo gedit /etc/rc.local
Πρόσθεσε μια γραμμή πριν από το τέλος(δηλαδή το exit 0)
chmod -R 705 /sys/kernel/debug
chown -R $YOURUSERNAME:$YOURUSERNAME /sys/kernel/debug/vgaswitcheroo
echo OFF > /sys/kernel/debug/vgaswitcheroo/switchΌπου $YOURUSERNAME το δικό σου
Δώσε τις παρακάτω εντολές μια-μια
- Κώδικας: Επιλογή όλων
$ sudo apt-get update
$ sudo apt-get install wget gxmessage libnotify-bin
$ wget -P /home/"$USER"/.local/share/icons/ http://lh4.ggpht.com/_Dw3SC8gD9Jk/S-MGVcEfaiI/AAAAAAAAAIA/Pguy_uSeqSk/s800/hardware_down.png
$ wget -P /home/"$USER"/.local/share/icons/ http://lh5.ggpht.com/_Dw3SC8gD9Jk/S-MGVSO0JbI/AAAAAAAAAIE/_mdAnW7UiCQ/s800/hardware_up.png
$ wget -P /home/"$USER"/.local/share/icons/ http://lh4.ggpht.com/_Dw3SC8gD9Jk/TNbQXzK6hrI/AAAAAAAAAJ8/YlqK46MusuE/s800/hardware.png
$ wget -P /home/"$USER"/.local/share/icons/ http://lh5.ggpht.com/_Dw3SC8gD9Jk/S41DjuMt_MI/AAAAAAAAAF4/5pQm2-dX6Sg/s800/switch_before_shutdown.png
Επανεκκίνηση.
Διπλό κλικ στο αρχείο switch_between_cards.sh και επέλεξε την Integrated
Τελευταία επεξεργασία από
sotos21 και 12 Ιούλ 2012, 22:48, έχει επεξεργασθεί 7 φορά/ες συνολικά
1 Γνώσεις Linux: Πρώτα βήματα ┃ Προγραμματισμού: Καθόλου ┃ Αγγλικών: Καθόλου
2 Ubuntu 23.10 Mantic Minotaur 6.3.0-7-generic 64bit (el_GR.UTF-8, Unity:Unity7:ubuntu unity)
3 AMD Ryzen 7 7730U with Radeon Graphics ‖ RAM 15368 MiB ‖ASUS TN3604YA - ASUS Vivobook_S_Flip TN3604YA_TN3604YA
4 Advanced Micro Devices, Inc. [AMD/ATI] Barcelo [1002:15e7] {amdgpu}
5 wlp1s0: MEDIATEK Corp. Device [14c3:7922]