Monday, February 10, 2014

Installing AMD Catalyst 13.12 on Ubuntu Server 12.04.4 LTS

So, you've tried to install AMD's linux driver 13.12 on an Ubuntu Server (12.04.4 or similar) and find yourself with a failed driver install. My blog entry this week will give you an option to get past that.

All commands here should be executed as root. 
The problem:
[email protected]:~$ ./amd-catalyst-13.12-linux-x86.x86_64.run 

Things seem to be going fine, but then you get this:

After investigating, you open the log file and find that the following errors occurs in the installer:
Building module:
cleaning build area....
cd /var/lib/dkms/fglrx/13.251/build; sh make.sh --nohints --uname_r=3.11.0-15-generic --norootcheck.....(bad exit status: 1)
[Error] Kernel Module : Failed to build fglrx-13.251 with DKMS
[Error] Kernel Module : Removing fglrx-13.251 from DKMS

------------------------------
Deleting module version: 13.251
completely from the DKMS tree.
------------------------------

The problem is because the DKMS scripts are calling methods that are not supported in this kernel version. The kernel version i've found to fail is : 3.11.0-15-generic

Now there are a few options here, one of which is to extract and edit the Catalyst driver (simply add --extract <foldername> to get the amd driver installer to just extract the file to the target foldername)

However for those who just want to get moving, especially in my case since this machine is only for running GPU-based Password Crackers (Hashcat), there is a simpler way.

You need to use a kernel below 3.11.
Therefore, simply do:
aptitude search linux-image | grep -i 3.9     // or 3.8 if you wish etc. The key is to stay at 3.10 or below

In my case, I'm going to take kernel linux-image-3.8.0-35-generic 
So I run;
aptitude install linux-image-3.8.0-35-generic

Once that is done, you now need to modify GRUB to boot that kernel. In a stock-install of Ubuntu Server, you will have 2 boot-up kernel options, 0 is default (3.11.x) and 1 is the recovery mode. Therefore we want to tell GRUB to boot kernel option 2 - which is now our new 3.8.0-35 kernel.
therefore;
vi /etc/default/grub 
Change this line:
GRUB_DEFAULT=0
TO
GRUB_DEFAULT=2         // or another number if you have more kernels installed

Save the file, and then install your new grub config by doing;
update-grub

Now, reboot to boot your new kernel. If you see at boot-time on the local console that the wrong option is being selected, just choose the right boot kernel and then make a note of which option you should change the default to.

Once rebooted, confirm the right kernel is now running by doing a;
uname -r
It should say 3.8.0-35-generic - or whichever one under 3.11 you chose.

The only thing left to do is to install the linux-headers for your new kernel 3.8.0-35-generic.
To do this, just execute;
aptitude install linux-headers-`uname -r`

Once that is done, you're all set! Go to your AMD Driver directory and re-run;
[email protected]:~$ ./amd-catalyst-13.12-linux-x86.x86_64.run 

Your result, if all went well ,will be :

enjoy! :)

Thanks to Philsmd from Hashcat


Dimitri AKA Rurapenthe
@Bitcrack_Cyber