Many users desire to run oclHashcat on dedicated Linux servers. This guide will walk you through the best known method for setting up a headless Linux server with AMD Radeon GPUs.
This guide is currently based on Ubuntu Server 12.04.4 LTS and AMD Catalyst 14.9
THIS GUIDE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. WE WILL NOT ACCEPT ANY LIABILITY FOR ANY SECURITY RISKS YOU INTRODUCE TO YOUR ENVIRONMENT UPON FOLLOWING THIS GUIDE.
At a minimum, you should ensure that all commands are executed in a trusted – and preferably isolated – environment.
You might think that 12.04 is ancient. You may be inclined to install a more recent distribution, because “newer must be better.” Don't do it. Don't even think about doing it. Stick with the LTS release. You've been warned.
Download the server install CD from http://mirrors.kernel.org/ubuntu-releases/12.04/. The server install CD allows you to install Ubuntu permanently on a computer for use as a server. It will not install a graphical user interface.
If your server is 64-bit capable, it is highly recommended you download ubuntu-12.04.4-server-amd64.iso.
If you are forced to use a 32-bit system, download ubuntu-12.04.4-server-i386.iso.
If you need help burning these images to disk, see the CD Burning Guide.
The Ubuntu installer is extremely straight-forward – just follow the prompts as normal.
However, when you get to the Software Selection screen, make sure that only “OpenSSH Server” is selected. Do not select any additional software packages!
Immediately upon booting your new installation, you should ensure that all updates are installed. It is important to do this first since you will undoubtedly need to install a newer kernel, which will affect building the fglrx module.
64-bit users: it is highly recommended you disable multiarch support to ensure you have a pure 64-bit environment. It can save yourself a lot of headaches in the future! 32-bit libraries are a cancer… once one gets pulled in, more and more will get pulled in, until you are eventually running a 32-bit userspace with a 64-bit kernel!
Reboot after the system has been upgraded to boot the new kernel.
rm -f /etc/dpkg/dpkg.cfg.d/multiarch ## optional, but HIGHLY recommended! aptitude update aptitude upgrade reboot
Even though we are not using our GPUs to push any pixels, we still need to install a graphical environment on our servers. Not only is X11 is needed for fglrx to even compile, but it is also still needed for fglrx to communicate with the GPUs. Although it is now possible to launch compute jobs as root without a running X server, X11 is still needed for AMD Overdrive and AMD ADL (which is used for temp monitoring, fan control, etc.) Therefore we still need to have an X server installed and running on our Hashcat server.
Since we do not want to install a heavy, bloated desktop environment on our servers, we will instead install a very minimal X11 environment. We can actually make this quite a bit more minimal if we wanted, but it can be useful to have a small working desktop environment for debugging purposes, and it doesn't really require any additional resources, so we do it this way for your convenience.
aptitude install xserver-xorg xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-video-ati x11-xserver-utils lightdm unity-greeter openbox roxterm
This will provide you with a bare-minimum Xorg setup with the Openbox window manager, and the RoxTerm terminal emulator in case you need to do testing from within X11 (since OpenCL apps will not run at console unless the X display is active.)
Last, you will need to tell console applications where your X11 display is. Add the following line to your $HOME/.bashrc file:
echo 'export DISPLAY=:0' >> ~/.bashrc
If your server is headless and/or remote, you will need lightdm to automatically log you in. You may skip this part if you are not running a headless or remote server, and wish to manually log yourself in.
Edit the lightdm configuration file /etc/lightdm/lightdm.conf, and add the following (replacing YOUR_USERNAME with the user that will be running Hashcat):
[SeatDefaults] greeter-session=unity-greeter user-session=openbox autologin-user=YOUR_USERNAME autologin-user-timeout=0
Next, add yourself to the nopasswdlogin group to tell lightdm that it's okay for your user to login automatically. Note that this group is only used by lightdm and other display managers, and will not affect e.g. OpenSSH.
usermod -a -G nopasswdlogin YOUR_USERNAME
Additionally, if you would like other users on the system to run OpenCL applications, you will need to give them xauthority to do so. You can do this through xhost(1).
You may drop this line in $HOME/.config/openbox/autostart so that it is run every time Openbox starts.
First, install all the development tools needed to build fglrx. Do not forget dkms! Without dkms, you will have to re-install the driver every time the kernel gets updated.
aptitude install build-essential dkms unzip
Next, download AMD Catalyst and unpack it:
curl --referer "http://support.amd.com/en-us/download/desktop?os=Linux+x86" -o amd-catalyst-14-9-linux-x86-x86-64.zip http://www2.ati.com/drivers/linux/amd-catalyst-14-9-linux-x86-x86-64.zip unzip amd-catalyst-14-9-linux-x86-x86-64.zip
Then, run the Catalyst install script. You can accept the default answer to most of the prompts. However, note that the default action changed in 14.9 has changed from “Install Driver” to “Generate Distribution Specific Driver Package.” It is highly recommended that you select “Install Driver,” as generating a distribution-specific package will want to pull in 32-bit libraries and Qt dependencies, which you absolutely do not need.
Last, create an xorg.conf using amdconfig and reboot:
amdconfig --adapter=all --initial -f reboot
At this point, your server should have booted straight into Openbox and you should be ready to begin doing compute work.
Verify that things are working:
ps -ef | grep -i openbox ## should show that openbox is running clinfo ## should show ALL of your AMD GPUs, and your CPU amdconfig --adapter=all --odgt ## should show the temperature of all your AMD GPUs
If everything looks good, proceed to download and install all your favorite Hashcat tools! They should work out of the box with this configuration.
If you have identified any errors or inaccuracies with this article, or would like to propose any alternative methods, please contact epixoip