2017-04-19, 02:36:09 PM (This post was last modified: 2017-11-05, 02:05:14 PM by
tiwake.)
If you're anything like me, you probably love Windows because if nothing else, it just works. It might have its issues with privacy, security or performance, but if you want to get a system set up, the amount of work typically required would be exponentially less on Windows, than it would be for a system running Linux.
Problem is, when dealing with the realm of citizen science, particularly the vast majority of projects that focus on using computing power to complete tasks, Windows falls short on two key factors: Performance and reliability. The following guide aims to walk you though setting up a system running Linux in a (hopefully) simple and straightforward manner.
Please note that this guide is for users with nVidia cards. As I have no AMD/ATI cards and therefore no experience installing such a system, I cannot provide tested instructions.
For this guide, feel free to choose between either
Mint,
Ubuntu, or
Lubuntu as your distro. They're all Linux systems, but they come with varying software and interfaces. However, these three distros are among the simpler to use, and have good support. For a dedicated system that won't be used outside of F@H, pick Lubuntu. If you wish to use the system regularly while you fold, I'd recommend Mint with the Cinnamon desktop. Whichever distro you go for, pick the 64 bit over the 32 bit. Unless you're running on hardware from the early 2000s, there's no need to use 32 bit.
After downloading, you'll want to download a tool like PowerISO on your Windows system to burn the .ISO file to a disc, or make a bootable flash drive.
Once your removable media is ready to go, insert it into the computer you wish to install your distro on, and boot it up. Keep an eye on the very first thing you see on your screen when the computer turns on, as it will mention somewhere that you should press a certain key to take you to a boot order setting. The boot order option might not exist, in which case you need to look out for the key you need to press to enter the BIOS or UEFI. Press it before the screen disappears. If you're entering through the BIOS/UEFI, look for the boot menu. There will be a boot order list which you will need to swap around, so that your removable media becomes the first in the boot order. Once this is done, save and exit.
Your distro should start loading. Either an installer will appear, or it will load a desktop that would appear as if the system is already installed. If the latter, you will find an icon to install the system, which would bring up the same installer. Follow these instructions as they come. Most should be simple to go through. Once finished, the installer will ask you to remove the disc/flash drive and restart. Normally the computer should then boot into the installed operating system, but if it gets stuck, return to the boot order and set the first device to the one you installed your distro to.
As soon as you get to the desktop, you'll want to open up the command line, which henceforth will be referred to as the terminal. You can usually find a button at the bottom of the screen to open it up, or you can simply use Ctrl + Alt + T. Type or copy each line, one by one, into the terminal:
Code:
wget http://launchpadlibrarian.net/109052632/python-support_1.0.15_all.deb
sudo dpkg -i python-support_1.0.15_all.deb
Note that Ctrl + V will not work in the terminal. You will need to right click inside it and click paste. Ctrl + C in your browser will still work just fine though.
After entering the second line, you will be asked for the password you used when you set up your account during installation. This will then install the .deb file you just downloaded, which will be a prerequisite for the F@H software. Some additional software will also need to be installed, namely the drivers and OpenCL support for nVidia cards. Firstly, you will need to specify an extra place for the updater/installer to look for additional software, which in this case would be for the drivers:
Code:
sudo add-apt-repository ppa:graphics-drivers/ppa
When prompted, press enter. If you are using the same terminal window from before, you will not need to enter your password again, but if you closed it and opened a new one, you will need your password. Next:
This will update the database that the apt-get function uses to find software as well as inform you of other available updates. We can worry about the latter once everything is set up though. Once this is done, type the following line, but instead of pressing enter, press tab:
Code:
sudo apt-get install nvidia-
Pressing tab will either autocomplete what you're typing, or if there are multiple entries that could complete what you started typing, it will display a list. In this case, it will display several nVidia driver versions. Pick the highest driver version. For example, "nvidia-370". Don't bother with the ones ending with "dev". Once you complete this line, press enter to install. When asked if you want to continue, press "y" and enter.
Note that nvidia-370 is verified stable. If the highest driver version does not work well, you can downgrade. Alternatively, you can check F@H communities to see if anyone else has verified a version to be working. Once the drivers are installed, install the rest:
Code:
sudo apt-get -y install python-gnome2 mesa-common-dev freeglut3-dev nvidia-settings gedit
Next, download and install FAHClient and FAHControl from the Folding@Home site. To keep things easy, download them to your home folder (the one named after your user name). If you can't install them by double clicking and following the graphical interface, type "sudo dpkg -i ", followed by the file name of the FAHClient and FAHControl files you downloaded. Remember that you can use tab to autocomplete the file name if it's too long.
During the installation for FAHClient, you will be asked for your F@H user name, team number, and passcode. Go ahead and put these in. When the two programs are installed, go back to your terminal and type:
This will navigate you to the fahclient folder and list its contents. Look for a file called GPUs.txt. If the file does not exist, type:
Code:
sudo wget http://fah-web.stanford.edu/file-releases/public/GPUs.txt
Skip this step if the file is already there. Remember, to type this into the same terminal you performed the cd command in, or else you will download the file to the wrong place.
Go ahead and restart your computer now, either by typing reboot into the terminal, or from the relevant button on your taskbar/start menu. Once you're back into the desktop, open your terminal and type "FAHControl". Keep in mind that this will be case sensitive. You should see that familiar window you've been using on Windows. If you don't see your GPU in the slot list, add it manually by going to Configure > Slots > New Slot. Select the GPU button and save. This should be sufficient for a single GPU setup, and you should see your GPU slot initialising.
For multi GPU setups, you may need to manually assign the ID of each individual GPU when you're adding the slot. This should not be necessary, but if needed, type "nvidia-settings" into the terminal to open up nVidia X Server. On the left, you will see a list showing the device number of each GPU installed (eg, GPU0, GPU1, etc.). The number will be the ID of each card. Regardless of whether or not you need to manually set the ID or leave it at -1 for F@H to decide, save and monitor the folding slots. If they are stuck at Ready, or if X Server shows the GPU usage of a card to be anything other than 85-100%, you may need to manually set the CUDA and OpenCL indexes for each slot.
To do this, pause one GPU slot in FAHControl. Go to the slot settings for that same GPU. Set CUDA and OpenCL to 0, then save and resume the slot. If there are no changes, and it still doesn't fold after 20 or 30 seconds, repeat the process, increasing the index values by 1 each time. Keep repeating this until the slot works, then repeat the entire process for every other problematic GPU you have. This took about 5 minutes on my quad card setups. That said, if your indexes are in the double digits, then there may be other issues.
If everything has gone well, your cards should be up and running. Remember that you generally need one CPU core per GPU slot, so the number of cores used for CPU folding may have to be manually adjusted, if not completely disabled. Whatever the case may be, confirm once again in X server that each GPU is running at full or near full load.
You're now hopefully folding on Linux. But the fun does not stop there. You may wish to set a custom fan speed for your cards. Unfortunately, software like PrecisionX or Afterburner do not exist on Linux, so fire up the terminal once more and type the following:
Code:
sudo nvidia-xconfig -a --cool-bits=28 --allow-empty-initial-configuration
cd ~
gedit fancontrols
Note that you may need to repeat the first line twice in a row, before the "cd ~" command.
A text editor should appear after the final line. Here, you can add commands that will set your fan speed to whatever value you would like. You will need the GPU IDs of each GPU you have first. So let's say you have three GPUs with IDs 0, 1 and 2, and you want all their fans at 100%. Add the following lines to the editor:
Code:
nvidia-settings -a [gpu:0]/GPUFanControlState=1
nvidia-settings -a [fan:0]/GPUTargetFanSpeed=100
nvidia-settings -a [gpu:1]/GPUFanControlState=1
nvidia-settings -a [fan:1]/GPUTargetFanSpeed=100
nvidia-settings -a [gpu:2]/GPUFanControlState=1
nvidia-settings -a [fan:2]/GPUTargetFanSpeed=100
The ControlState line enabled fan control the the specified GPU, while the FanSpeed sets the speed as a percentage. If you wish to overclock, you can also add the following lines to the file:
Code:
nvidia-settings -a [gpu:0]/GPUGraphicsClockOffset[3]=
nvidia-settings -a [gpu:0]/GPUMemoryTransferRateOffset[3]=
Adding a number after the "=" allows you to adjust the offset of the core and memory clocks in MHz. It is very important to keep in mind that this is an offset from the stock clocks. Forgetting this little detail can damage your card. If your stock core is 1000 MHz and you want to overclock to 1100 MHz, do NOT type in 1100, or you'll basically tell the software to run your GPU at 2100 MHz. Instead, type in 100.
Whether you choose to overclock or just set fan speeds, save the file and exist. In the same terminal, type:
Code:
sudo chmod +x fancontrols
This allows the file to be executable. Next, go to your startup applications list. This will be listed in your system settings menu, or through a search for startup applications. Add a new startup entry and browse for the file you just saved. If you followed the commands before opening the text editor, it should be in your home directory, or ~. Select the file, give it a name, and save. If you reboot, you should hear your fans adjusting to your set speeds when the system starts up.
Hopefully this should cover the basics. If you like to run dedicated systems, you might want to look into downloading Teamviewer to remotely connect to your following systems from your main computer. Temperature monitoring is possible from X server in the thermal settings of each GPU as well.
I know this all looks like it would be a pain in the ass to do. However, F@H performs better with Linux, as does BOINC. A dedicated folding rig should always run Linux, and unless you're gaming, you could probably also make the switch if you have the patience to learn a little. I myself am not patient in the slightest, and while Linux still gives me aneurysms, I can at least acknowledge the pros of it.