Skip to content

Instantly share code, notes, and snippets.

@ShawnHuang
Forked from NTICompass/ati-install.sh
Last active October 19, 2015 07:58
Show Gist options
  • Save ShawnHuang/2268781b9fab93d7579c to your computer and use it in GitHub Desktop.
Save ShawnHuang/2268781b9fab93d7579c to your computer and use it in GitHub Desktop.
#!/bin/sh
sudo /usr/share/ati/amd-uninstall.sh --force
cd /etc
sudo rm -rf ati
cd /usr/share
sudo rm -rf ati
#!/bin/bash
# Get the directory this script is in
AMD=`pwd`
# Ask AMD/ATI for the 12.4 drivers
if [ ! -f "amd-driver-installer-12-4-x86.x86_64.run" ]; then
wget --referer='http://support.amd.com' http://www2.ati.com/drivers/linux/amd-driver-installer-12-4-x86.x86_64.run
chmod +x amd-driver-installer-12-4-x86.x86_64.run
fi
# Extract them, so we can fiddle with the insides
if [ ! -d "fglrx-12.4" ]; then
fakeroot ./amd-driver-installer-12-4-x86.x86_64.run --extract fglrx-12.4
# Patch the module code
cd fglrx-12.4/common/lib/modules/fglrx/build_mod
patch -p0 < $AMD/ati_patch.txt
fi
# Run AMD's installer script
cd $AMD/fglrx-12.4
sudo ./ati-installer.sh 8.961 --install --force
# Set up an initial xorg.conf file
if [ ! -f "/etc/X11/xorg.conf" ]; then
sudo aticonfig --initial -f
fi
Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
---
--- firegl_public.c
+++ firegl_public.c
@@ -5797,10 +5797,16 @@ void ATI_API_CALL KCL_fpu_begin(void)
#ifdef CONFIG_X86_64
kernel_fpu_begin();
#else
+#ifndef TS_USEDFPU
+ preempt_disable();
+ if (__thread_has_fpu(current))
+ __save_init_fpu(current);
+#else
struct thread_info *cur_task = current_thread_info();
preempt_disable();
if (cur_task->status & TS_USEDFPU)
__save_init_fpu(cur_task->task);
+#endif
else
clts();
#endif
@ShawnHuang
Copy link
Author

sudo apt-get install build-essential cdbs fakeroot dh-make debhelper debconf libstdc++6 dkms libqtgui4 wget execstack libelfg0 dh-modaliases linux-headers-generic
sudo apt-get install ia32-libs
./ati-installer.sh 8.961 --buildpkg Ubuntu/precise
cd ../
sudo dpkg -i fglrx*.deb
sudo aticonfig --initial -f
fglrxinfo

@ShawnHuang
Copy link
Author

显卡切换:
1、查看当前显卡
aticonfig --pxl

2、切换独显
sudo aticonfig --px-dgpu

3、切换集显
sudo aticonfig --px-igpu

@ShawnHuang
Copy link
Author

sudo add-apt-repository ppa:linrunner/tlp
sudo apt-get update
sudo apt-get install --no-install-recommends tlp tlp-rdw tp-smapi-dkms smartmontools ethtool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment