title: how to load different version of Cuda in ubuntu?
body: <p>I am trying to use cuda 9.0 on a company's computing facilities. After I log in, I use the command <code>nvcc --version</code> to identify what the current version of cuda is being loaded. The command returns</p>
  
  <blockquote>
    <p>nvcc: NVIDIA (R) Cuda compiler driver</p>
    
    <p>Copyright (c) 2005-2016 NVIDIA Corporation</p>
    
    <p>Built on Tue_Jan_10_13:22:03_CST_2017</p>
    
    <p>Cuda compilation tools, release 8.0, V8.0.61</p>
  </blockquote>
  
  <p>I then use the command <code>module av cuda</code> to indentify what versions of cuda is avalilabel. The command returns</p>
  
  <blockquote>
    <p>----------------------------- /alt/applic/spack/modules/linux->ubuntu16.04-x86_64 -----------------------------</p>
    
    <p>cuda/6.5.14/gcc-7.2.0-ijjnj2a  </p>
    
    <p>cuda/9.0.176/gcc-7.2.0-lxmyjxx</p>
    
    <p>cuda/7.5.18/gcc-7.2.0-abx65q6  </p>
    
    <p>cuda/9.2.88/gcc-7.2.0-cqfnheu</p>
    
    <p>utility.c(2245):ERROR:50: Cannot open file >'/alt/applic/spack/modules/linux-ubuntu16.04-x86_64/cuda/8.0.61' for >'reading'</p>
    
    <p>-------------------------------------- /alt/applic/modules/modulefiles >---------------------------------------
    cuda/4.0</p>
  </blockquote>
  
  <p>SO it shows that cuda/9.0 is available (it is wired that it has an error regarding to cuda/8.0...). Then I try to load this cuda/9.0 with command </p>
  
  <pre><code>module load modules.new
  
  module load cuda/9.0.176/gcc-7.2.0-lxmyjxx
  </code></pre>
  
  <p>Then I enter again the command <code>nvcc --version</code> but it still returns <code>cuda/8.0</code> but not <code>cuda/9.0</code>...</p>
  
  <p>What should I do to load cuda/9.0? Also, how can I find the path to this cuda/9.0? I tried to use <code>locate cuda</code> but it only returns the information of cuda/8.0, nothing else.</p>
  
  <p>Thank you!</p>
  
  <hr>
  
  <p>update:</p>
  
  <p>I found the dir of cuda/9.0 file, which is under a bit wired location 
  <code>/alt/applic/spack/modules/linux-ubuntu16.04-x86_64/cuda/9.0.176</code></p>
  
  <p>So I removed the old dir for cuda/8.0, which is <code>/usr/local/cuda-8.0</code>, from <code>$PATH</code> and add the new dir as above into <code>$PATH</code>. Now, I again type in <code>nvcc --version</code>, I got the error msg says 
  <code>-bash: nvcc: command not found</code></p>
  
  <p>any ideas?</p>