<pre class="font-size:17 line-height:20 lang:default decode:true">   Driver: Installation Failed</pre>
&nbsp;

You may find this error message while trying to set up the NVIDIA CUDA Toolkit in Ubuntu.

I found it when I was installing the toolkit for <a href="http://www.accelereyes.com/products/arrayfire">ArrayFire</a>

&nbsp;

<b>[1]</b><b> </b><span style="text-decoration: underline;"><b>CUDA Toolkit Installation</b></span>

1. Download the CUDA Toolkit in the <a href="https://developer.nvidia.com/cuda-downloads">link</a>. <a href="https://developer.nvidia.com/cuda-downloads" rel="nofollow">
</a>

2. Extract the .run file in a location
<pre class="font-size:17 line-height:20 lang:batch decode:true">   sudo sh cuda_5.0.35_linux_64_ubuntu11.10-1.run --extract &lt;location&gt;</pre>
&nbsp;

3. Exit the X server (press Ctrl+Alt+F1) and stop the display manager by the following command.
<pre class="font-size:17 line-height:20 lang:batch decode:true">   sudo stop lightdm</pre>
&nbsp;

4. cd to the location and now there are run files named samples*, devdriver* and cudatoolkit*.

5. Install devdriver (*only if NVIDIA Driver is not installed)
<pre class="font-size:17 line-height:20 lang:batch decode:true">   sudo sh devdriver_5.0_linux_64_304.54.run</pre>
&nbsp;

6. Install cudatoolkit
<pre class="font-size:17 line-height:20 lang:batch decode:true">   sudo sh cudatoolkit-5.0.35_linux_64_ubuntu11.10.run</pre>
In the end, when it asks <em>"Would you like to create a symbolic link /usr/local/cuda/ pointing to /usr/local/cuda-x.x?"</em>, you must enter (y)es.

If it didn't ask, or you didn't enter (y)es, enter the following command to create a symbolic link.
<pre class="font-size:17 line-height:20 lang:batch decode:true">   ln -s /usr/local/cuda-x.0 ./usr/local/cuda</pre>
&nbsp;

7. Install sample (*optional)
<pre class="font-size:17 line-height:20 lang:batch decode:true">   sudo sh cuda-samples_5.0.35_linux.run</pre>
&nbsp;

8. Reboot your machine
<pre class="font-size:17 line-height:20 lang:batch decode:true">   sudo reboot</pre>
&nbsp;

&nbsp;

<strong>[2]</strong><span style="text-decoration: underline;"><strong> ArrayFire Installation</strong></span>

1. Create <a href="http://www.accelereyes.com/"><i>AccelerEyes</i></a> account to download <a href="http://www.accelereyes.com/products/arrayfire">ArrayFire</a>

2. Unzip arrayfire in /usr/local
<pre class="font-size:17 line-height:20 lang:batch decode:true">   sudo unzip ArrayFire*.zip -d /usr/local</pre>
&nbsp;

&nbsp;

<b>[3] </b><span style="text-decoration: underline;"><b>Environmental Variables Setting</b></span>

<b> </b>1. Open bash setting
<pre class="font-size:17 line-height:20 lang:batch decode:true">   vim ~/.bashrc</pre>
&nbsp;

2. Add the following lines in the end (probably only need to set LD_LIBRARY_PATH)
<pre class="font-size:17 line-height:20 lang:batch decode:true">   export AF_PATH=/usr/local/arrayfire
   export CUDA=/usr/local/cuda
   export PATH=/usr/local/cuda/bin:$PATH
   export LD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/local/cuda/lib64:/lib64:$LD_LIBRARY_PATH</pre>
&nbsp;

3. Reload bash setting
<pre class="font-size:17 line-height:20 lang:batch decode:true">   source ~/.bashrc</pre>
&nbsp;
<div id="content">
<div id="bodyContent">

Note: This may not work in laptops with optimus

</div>
</div>