惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
P
Privacy & Cybersecurity Law Blog
G
GRAHAM CLULEY
T
The Exploit Database - CXSecurity.com
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Project Zero
Project Zero
S
Security @ Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
A
Arctic Wolf
Webroot Blog
Webroot Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Security Latest
Security Latest
H
Heimdal Security Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
T
Tor Project blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
The Last Watchdog
The Last Watchdog
Y
Y Combinator Blog
宝玉的分享
宝玉的分享
Scott Helme
Scott Helme
A
About on SuperTechFans
M
MIT News - Artificial intelligence
V
V2EX
V
Visual Studio Blog
Recorded Future
Recorded Future
博客园 - 叶小钗
F
Fortinet All Blogs
L
Lohrmann on Cybersecurity
The GitHub Blog
The GitHub Blog
博客园 - Franky
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Secure Thoughts
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
I
InfoQ
SecWiki News
SecWiki News
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
J
Java Code Geeks
B
Blog RSS Feed
AWS News Blog
AWS News Blog
Know Your Adversary
Know Your Adversary
V
Vulnerabilities – Threatpost
H
Help Net Security

博客园 - 老翅寒暑

AI模型的回调能力的理解和实现 关于AI时代的程序架构的变化 关于需求规范和需求评审的一点看法 关于低代码和无代码---喧嚣背后的致命问题 为Jekyll静态网站添加PlantUML插件 企业要为现金流建模 关于通用框架的一些想法 XenServer 5.5 断电重启虚拟机磁盘丢失的修复 Preserving Remote IP/Host while proxying 异步javascript的原理和实现 需求的最初形式:12306ng的需求小说 需求与设计过程(1)-用例 项目进度控制的技术 项目管理沙龙第十二次会议纪要--为没有共识的项目组定制敏捷方法 项目管理沙龙第十一次聚会纪要--当敏捷没有共识的时候 项目管理沙龙第十次聚会纪要-AOM项目的敏捷实践 项目管理沙龙第九次聚会纪要 项目管理沙龙第八次聚会纪要 项目管理沙龙第七次聚会纪要
Fix catalyst driver in Ubuntu 13.04 / 13.10
老翅寒暑 · 2014-01-20 · via 博客园 - 老翅寒暑

1. Introduction

I found lots of people struggling to get catalyst driver work in Ubuntu 13.04. This issue has been persistent for some laptops, ever since Ubuntu 13.04 came out, specially for Intel, AMD dual graphics setup. For people, who have been looking at catalyst drivers ever since http://ubuntuforums.org/showthread.php?t=1930450 post was published, should not be that hard to find the solution, but for those who are new to Linux, or don’t have time for these kinds of issues, this might be a show stopper bug.

2. Installation

I removed the downgrading libudev and xserver-xorg-video section. Therefore, if you want to install 13.4 stable follow this link. For this tutorial, I will be using 13.11 beta 1 driver. I recommend you download the beta driver from here. I don’t always test the newer versions (let me know if there is some problem installing the newer versions). Unless AMD changes compatibility with xorg, kernel and xserver-xorg-video-intel it should be fine.

If possible, always use latest drivers. Before downloading the driver, make sure to read the release note (found in the download page) to find out the supported kernel and xorg versions and bug fixes. Download catalyst driver from here and unzip it in a directory. Using command line and building packages is the preferred method of installing the driver.

i. Using a GUI method

Using a terminal go to the directory, where you have unzipped the file and run following command.

sudo sh ./amd*.run

Screenshot from 2013-07-25 19:32:32

It should open up a GUI, which you can use to easily install the driver. After reboot, you can follow from Step 4 of this tutorial. However, If you want to play 32-bit games as well, install necessary library using following command and then follow Step 4. If you are on ubuntu 13.10, ia32-libs is not available (see 32-bit library installation problem).

sudo apt-get install ia32-libs lib32gcc1 libc6-i386

Note: Many people have reported lots of problems (graphics and library) using above method. If you have graphics related errors, make sure you follow following option. However, make sure you properly remove this package (5. Reset Everything), before going with following option.

32-bit library installation problem: In ubuntu 13.10, ia32-libs meta package is not present. If you get error while playing some 32-bit games, you need to install the 32-bit counter part of the package that provides the library with :i386 suffix. E.g If the error mentions libGLU.so.1, you need to install libglu1-mesa:i386 and so on. You can inspect necessary packages from this link or if you want to install the packages I installed (after inspecting ia32-libs dependency in ubuntu 13.04), install them from this link.

ii. Using command line and building the packages

a. Install the packages you need to compile the driver

sudo apt-get install build-essential cdbs fakeroot dh-make debhelper debconf libstdc++6 dkms libqtgui4 wget execstack libelfg0 dh-modaliases linux-headers-generic xserver-xorg-core libgcc1

b. Fix 64-bit dependency issue (ia32-libs is not available for ubuntu 13.10, see above)

sudo apt-get install ia32-libs lib32gcc1 libc6-i386

c. Remove old fglrx driver ( if installed already), and reboot. If you have used GUI method to install, see 5. Reset Everything below instead.

sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev*
sudo rm /etc/X11/xorg.conf
sudo apt-get install --reinstall xserver-xorg-core xserver-xorg-video-intel libgl1-mesa-glx libgl1-mesa-dri libgl1-mesa-glx:i386 libgl1-mesa-dri:i386
sudo dpkg-reconfigure xserver-xorg
sudo reboot

d. Build and install the downloaded driver. Using a terminal go to the directory, where you have unzipped the file and run following commands.

sudo sh ./amd-*.run --buildpkg Ubuntu/raring
sudo dpkg -i fglrx*.deb
sudo aticonfig --initial -f
sudo reboot

For ubuntu 13.10, use Ubuntu/saucy. You can find out the string using following command.

sh ./amd-*.run --listpkg

e. If second last command does not execute (say it complains about not having any graphics card installed), you might have turned off AMD graphics card using vgaswitcheroo switch, which you can enable using following command and then will be able to execute above command (before reboot). If you have already rebooted, go to a virtual terminal (Ctrl + Alt + F1), before login, and run above command (second last) to create xorg.conf file.

sudo su
echo ON > /sys/kernel/debug/vgaswitcheroo/switch

Also, if you later plan to remove catalyst and go with open source only option, you can copy following line into /etc/rc.local file (before exit 0) and this will turn off your AMD graphics card at boot and fix the heating caused by AMD graphics card.

echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

3. Other Errors

a. Fix unity, if it broke during installation (this will reset your Desktop)
cd ~/.config
rm -rf compiz-1 dconf gnome-session

You can also install compizconfig-settings-manager (cccsm) and enable OpenGL and Ubuntu Unity Plugin to get back the dash and other visual components.

b. TF2, Dota 2, Steam OpenGL or networking error

i. If other applications runs, but steam fails to start  with proper OpenGL support while using AMD drivers, you may choose to follow the command line and building the packages option, and if that does not fix the problem, you might have to clean up and re-install Steam.

Screenshot from 2013-07-25 21:56:19

Move SteamApps directory to some other place (it will be very fast, if you don’t change the drive), and re-install steam. You can move back that directory, after first login.

ii. If you get following error while playing TF2 or Dota 2

Required OpenGL extension “GL_EXT_texture_sRGB_decode” is not supported. Please update your OpenGL driver

It is probably because of a file in your home directory called .drirc. To fix this error, delete this hidden file logout login back and start the game in Steam. If it still does not work, make sure libtxc-dxtn-s2tc0 is installed. Also, you can create another user, copy or link steam related files and directories (~/.steam, ~/.local/share/Steam, ~/.steampid, ~/.steampath) and start Steam using this new account, to see if the error exists.

iii. While using AMD card, if it fails to login, it might be because of this error.

Adding following text to /etc/hosts might solve the network related error. However, use this text only if it fails due to networking issue.

87.248.210.253    media.steampowered.com
c. GPU Hang

With Intel drivers you might get sudden desktop freeze, or programs may slow down. Let us find out if it is actually a GPU hang issue, that I am talking about.

While the desktop or some application freezes, go to a virtual terminal (Ctrl + Alt + F1), login and run following command

tail /var/log/Xorg.0.log
i915_hangcheck_hung *ERROR* Hangcheck timer elapsed... GPU hung
capturing error event; look for more information in /debug/dri/0/i915_error_state

If you get error like this, you could fix this issue temporarily by killing gnome-session using

sudo killall gnome-session

Capture values of log files under /var/log directory (at runtime) using following command and report the bug to appropriate project or search online for that error.

tail -f /var/log/logfile > ~/logfile

Note: Here logfile could be any file under /var/log directory, specially dmesg, Xorg.0.log, syslog etc.

Also make sure, you set game settings to lower, if you want to play it using Intel graphics card.

If you get slow frames per second in wine while using AMD graphics card, it might be because of the input lag that has not been fixed for a long time. For Intel graphics card in wine there is this sudden drop in FPS. I suggest you install software packages called htop (sudo apt-get install htop) and xosd-bin (sudo apt-get install xosd-bin). Run htop in a virtual terminal (Ctrl + Alt + F1) and run game with following command (to show frame per seconds on the screen).

WINEDEBUG=fps wine yourgame.exe 2>&1 | tee /dev/stderr | grep --line-buffered "^trace:fps:" | osd_cat

When game starts to lag and frame per seconds drops, switch to the virtual terminal, wait till the cpu percentage for the game process drops to normal (below 100) and switch back to X (Ctrl + Alt + F7) and continue playing. I was experimenting with xf86-video-intel-2.99.903 and the installation process was not seamless. I found this package to be quite good (only  two or three instances of severe lag). Therefore, upgrade to this version (when it releases) and use above method to see how it performs. In my test, I found in one of the games under wine (1.7.1), Intel graphics card to have better frame per seconds than the catalyst driver.

4. Test

a. Run fgl_glxgears and check the speed.

$ fgl_glxgears
fgl_glxgears

b. If you have dual graphics cards (Intel and AMD), switch between both and see if they work

sudo aticonfig --px-igpu # for integrated intel card
sudo aticonfig --px-dgpu # for discrete amd card
aticonfig --pxl  # list currently active card

5. Reset Everything

If this solution did not work for you, it is time to reset everything and go back to where you were before the installation.

If you had used GUI method to install the catalyst driver, you can remove catalyst driver using following command.

sudo sh /usr/share/ati/fglrx-uninstall.sh

After reboot, it should work as it used to work before the installation.

If you had used command line and building the packages method, you don’t have to do anything other than repeat commands at 2.c above. I will list them once again anyway.

sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev*
sudo rm /etc/X11/xorg.conf
sudo apt-get install --reinstall xserver-xorg-core xserver-xorg-video-intel libgl1-mesa-glx libgl1-mesa-dri libgl1-mesa-glx:i386 libgl1-mesa-dri:i386  
sudo dpkg-reconfigure xserver-xorg 
sudo reboot

6. Graphical Card Switcher (Optional)

As you saw in 4 (above), you can switch between two graphics cards using the command line. Firing up command line each time you want to switch graphics cards is not very intuitive. In that case, you could open Catalyst Control Center using sudo amdcccle and press the appropriate radio button and logout and login back. Since, even that step is not that good, I thought I would share a script that does it for me. Create a file in the bin directory of your home folder called switchamdintel.pl (you can name it anything you like) with following content.

#!/usr/bin/perl
$checkGraphicsCommand = ` aticonfig --pxl`;
chomp $checkGraphicsCommand;
if ($checkGraphicsCommand eq "PowerXpress: Integrated GPU is active (Power-Saving mode).") {
 # Activate the discrete GPU driver 
 system "pkexec aticonfig --px-dgpu && pkill gnome-session"
} else {
 # Activate the integrated intel HD driver
 system "pkexec aticonfig --px-igpu && pkill gnome-session"
}

Next, create a desktop file called switchamdintel.desktop inside ~/.local/share/applications directory (i.e the hidden folder inside your home directory, press Ctrl + H to show it) with following content.

[Desktop Entry]
Name=Switch AMD Intel 
Comment=Switch to AMD Graphics card
Exec=/home/username/bin/switchamdintel.pl
Icon=/home/username/Icons/amd-intel.png
Terminal=false
Type=Application
Categories=System

As you might have guessed, in above script you should change username to your actual username and place a 256×256 png image of something that says amd and intel inside Icons directory called amd-intel.png. Also, adjust path of Exec and Icon path to locations where these files are located. If string comparison line in above perl script is different, change it to the actual output thrown by aticonfig –pxl command.

amd-intel

Make both files executable using chmod +x filename. If you logout and login, from now on you can search switch keyword in unity dash or go to System category in application menu and launch the switcher. It will change the graphics cards and logout.

Hope it helps. Cheers !!