# How to install openCL (for F@H) Ubuntu



## thebluebumblebee (Jun 13, 2014)

Linux noob here.  Is it really this convoluted to install openCL? I want to use it for F@H, not for developing.   http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html#axzz34QSQ1j3h


----------



## RCoon (Jun 13, 2014)

thebluebumblebee said:


> Linux noob here.  Is it really this convoluted to install openCL? I want to use it for F@H, not for developing.   http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html#axzz34QSQ1j3h



When you're new to linux, everything is convoluted and completely obnoxious. There will never be a year of linux on the desktop. It simply isn't newbie friendly in the slightest

As someone who's used linux rather a lot (I'm no expert like EasyRhino, but I know my way round), you get used to it. Once you've got one kind of app running, the rest is pretty easy. You'll learn your way around.


----------



## Easy Rhino (Jun 13, 2014)

thebluebumblebee said:


> Linux noob here.  Is it really this convoluted to install openCL? I want to use it for F@H, not for developing.   http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html#axzz34QSQ1j3h



The documentation is very clear.

Assuming you have a CUDA capable card and your 64bit Ubuntu version is supported all you need to do is...


```
cd /opt

sudo wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1304/x86_64/cuda-repo-ubuntu1304_6.0-37_amd64.deb

sudo dpkg -i cuda-repo-ubuntu1304_6.0-37_amd64.deb

sudo apt-get update

sudo apt-get install cuda

Then as the user you are going to be running F@H as:

export PATH=/usr/local/cuda-6.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-6.0/lib64:$LD_LIBRARY_PATH  (again assuming 64 bit OS)
```


----------



## thebluebumblebee (Jun 13, 2014)

I'm assuming that Linux is backwards compatible???  The CUDA guide says Ubuntu 13.04, and I'm using 14.04.


----------



## Easy Rhino (Jun 13, 2014)

thebluebumblebee said:


> I'm assuming that Linux is backwards compatible???  The CUDA guide says Ubuntu 13.04, and I'm using 14.04.



From googling it does not look like cuda 6 is working yet with ubuntu 14


----------



## thebluebumblebee (Jun 13, 2014)

So, am I going to have to find the "lowest common denominator" for Linux/Cuda/openCL?

Edit: Do I need to start all over to downgrade Ubuntu?


----------



## Easy Rhino (Jun 13, 2014)

thebluebumblebee said:


> So, am I going to have to find the "lowest common denominator" for Linux/Cuda/openCL?
> 
> Edit: Do I need to start all over to downgrade Ubuntu?



yes you will need to install 13.04 from scratch or wait for a 14.04 version.


----------



## Jstn7477 (Jun 13, 2014)

I might try this at work today as I really want to get some machines off of Windows and back onto Linux again. I also saw this during a brief Google search: http://www.overclock.net/t/1407574/gpu-folding-natively-in-linux


----------



## thebluebumblebee (Jun 13, 2014)

Jstn7477 said:


> I might try this at work today as I really want to get some machines off of Windows and back onto Linux again. I also saw this during a brief Google search: http://www.overclock.net/t/1407574/gpu-folding-natively-in-linux


Read that whole thread.  I don't see people having to do the CUDA/openCL install, BUT, they seem to be mostly using Mint.  Could it be that Mint comes ready to go?  I'm also trying to figure out the knowledge level of the posters there.  The one person doesn't even realize that the reason he went from 35-40K PPD to 95K PPD is (most likely) cause by going from core_15 to core_17 WU's.
Okay, one guy mentions CUDA....

FYI, the work that we do here will be turned into a guide for F@H on Nvidia GPU's on Linux.  The goal is to help Folders AND Crunchers better use Linux.


----------



## Easy Rhino (Jun 13, 2014)

thebluebumblebee said:


> Read that whole thread.  I don't see people having to do the CUDA/openCL install, BUT, they seem to be mostly using Mint.  Could it be that Mint comes ready to go?  I'm also trying to figure out the knowledge level of the posters there.  The one person doesn't even realize that the reason he went from 35-40K PPD to 95K PPD is (most likely) cause by going from core_15 to core_17 WU's.
> Okay, one guy mentions CUDA....
> 
> FYI, the work that we do here will be turned into a guide for F@H on Nvidia GPU's on Linux.  The goal is to help Folders AND Crunchers better use Linux.



i don't have a linux box with an nvidia gpu. if i did i would try and get it working tonight. obviously it is easier when you can sit down and pound out some commands and look at what libraries are being called. i did get wcg working wonders on this centos box with little effort. it was cranking away.


----------



## Jstn7477 (Jun 13, 2014)

I do have a Mint 15 box running just WCG (my 3770K machine, and actually my Q9550 machine as well) so perhaps I'll put it on the bench with a Corsair TX750 and the GTX 465 or something and see if I can get it working.

EDIT: Put a GTX 470 in a Mint 15 box (my 3770K rig), activated the recommended NVIDIA driver from the device drivers menu, downloaded and installed the pre-requisite package to add the CUDA repository:
http://developer.download.nvidia.co.../x86_64/cuda-repo-ubuntu1304_6.0-37_amd64.deb

and then issued the commands:


```
sudo apt-get update

sudo apt-get install cuda
```



Now I'm waiting several hours for the CUDA toolkit to download via the terminal, all the packages amount to >1GB from what I saw, almost 900MB disk space required for the actual install. I guess the next things I need to do are get WINE set up and Windows F@H set up, and I think there's some config needed to download the Windows GPU WUs, I am not sure. I tried this once before, but had no idea about the CUDA toolkit, so it failed miserably. I am currently using this guide for getting CUDA installed: http://docs.nvidia.com/cuda/cuda-ge...or-linux/index.html#post-installation-actions

EDIT2: CUDA Toolkit finished installing, so I went to go get the Linux F@H client from this guide under the Express Installation section: https://folding.stanford.edu/home/guide/linux-install-guide/

Download the fahclient and fahcontrol .deb files, install in that order. You'll be prompted for your credentials in the fahclient installation, and just install and launch fahcontrol afterwards to delete the CPU slot, add a GPU slot and I added the client-type "beta" flag for good measure. After that, you'll see your NVIDIA GPU hop into action with pitiful PPD at first, but then:

(Also, I think installing CUDA automatically updated the display driver as well, I had 310 activated but it says 331 now. GTX 470 is at stock 608MHz core and running a GELID Icy Vision 2 with a 120mm 2000 RPM fan attached, hence the low temperature.CPU is an i7-3770K at 4.2GHz, and World Community Grid is running on 6 of the 8 threads, F@H needs one full thread it seems.)


----------



## BUCK NASTY (Jun 15, 2014)

Jstn, what's the max ppd you have seen on the GTX470?


----------



## Jstn7477 (Jun 15, 2014)

BUCK NASTY said:


> Jstn, what's the max ppd you have seen on the GTX470?



Latest screenshot, definitely the highest I've seen out of this board I feel, even during the days I overclocked it to 700-725MHz:


----------



## mx500torid (Jun 15, 2014)

OK I got an extra C2D combo lying around and a 470. Im gonna get a large bottle of aspirin and give this a try. Gonna use Ubuntu 14.04 though.


----------



## thebluebumblebee (Jun 15, 2014)

mx500torid said:


> OK I got an extra C2D combo lying around and a 470. Im gonna get a large bottle of aspirin and give this a try. *Gonna use Ubuntu 14.04 though.*


Look at posts 4-7 in this thread.


----------



## Jstn7477 (Jun 17, 2014)

I'm going to try flashing my GTX 465 and GTX 470 to 700MHz tonight, and the GTX 470 has been hovering around 24-26K PPD the last two days. We'll see what happens.


----------



## Jstn7477 (Jun 18, 2014)

Cards flashed to 700MHz, noticed the GTX 470 went from 24-34K to around 25.5-36.5K estimated PPD. Best screenie yet:


----------



## Jstn7477 (Aug 23, 2014)

Mint 17 and Ubuntu 14.04 are compatible with CUDA Toolkit now! (And probably have been for a few weeks.)

Download and install: http://developer.download.nvidia.co.../x86_64/cuda-repo-ubuntu1404_6.5-14_amd64.deb

Then, in terminal:


```
sudo apt-get update

sudo apt-get install cuda
```

I have not tested distribution upgrades because honestly I screwed up my Mint 15 install by adding Mint 16 sources and upgrading, which left me without a working desktop.


----------

