title: Missing nvcc compiler - theano
body: <p>I use ubuntu 14.04 and cuda 7.5. I get cuda version information using <code>$ nvcc --version</code> : </p>
  
  <pre><code>nvcc: NVIDIA (R) Cuda compiler driver
  Copyright (c) 2005-2015 NVIDIA Corporation
  Built on Tue_Aug_11_14:27:32_CDT_2015
  Cuda compilation tools, release 7.5, V7.5.17
  </code></pre>
  
  <p>$PATH and $LD_LIBRARY_PATH are below : </p>
  
  <pre><code>$ echo $PATH
  /usr/local/cuda-7.5/bin:/usr/local/cuda-7.5/bin/:/opt/ros/indigo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
  
  $ echo $LD_LIBRARY_PATH
  /usr/local/cuda-7.5/lib64
  </code></pre>
  
  <p>I install theano. I use it with cpu but not gpu. <a href="http://deeplearning.net/software/theano/tutorial/using_gpu.html" rel="nofollow">This guide</a> says that </p>
  
  <blockquote>
    <p>Testing Theano with GPU¶
    To see if your GPU is being used, cut and paste the following program into a file and run it.</p>
  </blockquote>
  
  <pre><code>from theano import function, config, shared, sandbox import
  &gt; theano.tensor as T import numpy import time
  &gt; 
  &gt; vlen = 10 * 30 * 768  # 10 x #cores x # threads per core iters = 1000
  &gt; 
  &gt; rng = numpy.random.RandomState(22) x =
  &gt; shared(numpy.asarray(rng.rand(vlen), config.floatX)) f = function([],
  &gt; T.exp(x)) print(f.maker.fgraph.toposort()) t0 = time.time() for i in
  &gt; range(iters):
  &gt;     r = f() t1 = time.time() print("Looping %d times took %f seconds" % (iters, t1 - t0)) print("Result is %s" % (r,)) if
  &gt; numpy.any([isinstance(x.op, T.Elemwise) for x in
  &gt; f.maker.fgraph.toposort()]):
  &gt;     print('Used the cpu') else:
  &gt;     print('Used the gpu') The program just computes the exp() of a bunch of random numbers. Note that we use the shared function to make
  &gt; sure that the input x is stored on the graphics device.
  </code></pre>
  
  <blockquote>
    <p>If I run this program (in check1.py) with device=cpu, my computer
    takes a little over 3 seconds, whereas on the GPU it takes just over
    0.64 seconds. The GPU will not always produce the exact same floating-point numbers as the CPU. As a benchmark, a loop that calls
    numpy.exp(x.get_value()) takes about 46 seconds.</p>
    
    <p>$ THEANO_FLAGS=mode=FAST_RUN,device=cpu,floatX=float32 python
    check1.py [Elemwise{exp,no_inplace}()]
    Looping 1000 times took 3.06635117531 seconds Result is [ 1.23178029 
    1.61879337  1.52278066 ...,  2.20771813  2.29967761
      1.62323284] Used the cpu</p>
    
    <p>$ THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python
    check1.py Using gpu device 0: GeForce GTX 580
    [GpuElemwise{exp,no_inplace}(),
    HostFromGpu(GpuElemwise{exp,no_inplace}.0)] Looping 1000 times took
    0.638810873032 seconds Result is [ 1.23178029  1.61879349  1.52278066 ...,  2.20771813  2.29967761
      1.62323296] Used the gpu Note that GPU operations in Theano require for now floatX to be float32 (see also below).</p>
  </blockquote>
  
  <p>I run gpu version command without sudo, it throws permission denied error : </p>
  
  <pre><code>/theano/gof/cmodule.py", line 741, in refresh
      files = os.listdir(root)
  OSError: [Errno 13] Permission denied: '/home/user/.theano/compiledir_Linux-3.16--generic-x86_64-with-Ubuntu-14.04-trusty-x86_64-2.7.6-64/tmp077r7U'
  </code></pre>
  
  <p>If I use it with sudo, the compiler cannot find nvcc path. </p>
  
  <pre><code>ERROR (theano.sandbox.cuda): nvcc compiler not found on $PATH. Check your nvcc installation and try again.
  </code></pre>
  
  <p>How can I fix this error? </p>