### Below is “Nvidia’s way” (modified to actually work)

Even though Nvidia still hasn’t provided RPMs for Fedora 22 (which was launched a couple of months ago as-of this post date, having been in Alpha for 3 months prior), we can fix up their code as it installs.

This write-up is simply a condensed version of Dr Donald Kinghorn’s excellent write-up (with which it’s probably best to follow along, opened in a separate tab) plus additional instructions concerning the building of Theano.

### Set up a scratch directory

As root :

Go to the Nvidia Driver download page, and grab the 76Mb driver package, for installation later…

### Now install the graphics drivers

To enable the ‘DKMS’ part of the installer will run, make sure you have the kernel module compilation parts available:

Before this point, the Nvidia software has not actually checked for the presence of an Nvidia video card.

Now run the Nvidia installer (look at the notes in this section for answer-hints):

• Say “Yes” to the question about registering with DKMS

• Say “Yes” to the question about 32-bit libs

It should now compile the NVIDIA kernel modules…

• Say “No” to the question about running nvidia-xconfig!

Now reboot.

### Test the installation

To see that your driver is installed and working properly, check that the kernel modules are there :

Check on the CUDA compiler:

And an actual check on the card itself :

### Fix the CUDA headers to accept new gcc

Now, as root, fix up Nvidia’s header file that disallows gcc greater than v4.9

In file /usr/local/cuda-7.0/include/host_config.h, look to make the following replacement :

### Test the CUDA functionality

As a regular user, compile the CUDA samples from within a clean directory :

### Cleaning up

If everything tests out Ok above, then the /root/fedora22-cuda directory can be safely deleted.

## The Theano Part

### Installation of libgpuarray

To install the bleeding edge libgpuarray into your virtualenv, first compile the .so and .a libraries that the module creates, and put them in a sensible place :

This will likely complain about not finding clBLAS, which isn’t a problem here. Although, if you know you will require clBLAS in the future (and this is for advanced/experimental users only), see my OpenCL post, since you need to install this before running cmake above).

It may also complain about :

This won’t affect the CUDA functionality (its impact on OpenCL is still TBD).

Next, install the Python component (after going into the same virtualenv) :

And then test it from within a regular user directory (using the same virtualenv) :

A good result is something along the lines of :

### Theano stuff

Store the following to a file gpu_check.py :

And then run, successively :

and

but