title: How to use CUDA_FORCE_PTX_JIT?
body: <p>According to NVIDIA Programming Guide:</p>
  
  <blockquote>
    <p>Any PTX code loaded by an application at runtime is compiled further
    to binary code by the device driver. This is called just-in-time
    compilation. Just-in-time compilation increases application load time,
    but allows applications to benefit from latest compiler improvements.</p>
  </blockquote>
  
  <p>...</p>
  
  <blockquote>
    <p>Setting CUDA_FORCE_PTX_JIT to 1 forces the device driver to ignore any
    binary code embedded in an application (see Section 3.1.4) and to
    just-in-time compile embedded PTX code instead; if a kernel does not
    have embedded PTX code, it will fail to load</p>
  </blockquote>
  
  <p>I've compiled my simple vectorAdd using following flags:</p>
  
  <pre><code>nvcc -o vectorAdd -gencode arch=compute_20,code=sm_20 vectorAdd.cu
  </code></pre>
  
  <p>When the <code>CUDA_FORCE_PTX_JIT</code> environment variable is unset, I get correct results. But when I set the <code>CUDA_FORCE_PTX_JIT</code> environment variable to <code>1</code> I get following error from <code>cudaGetErrorString</code>:</p>
  
  <pre><code>invalid device function 
  </code></pre>
  
  <p>How can I fix this issue and get CUDA_FORCE_PTX_JIT working? Maybe the way of my compilation does not embed any PTX code.</p>
  
  <p>Thanks in Advance.</p>
  
  <p><em><strong>Further information:</em></strong></p>
  
  <p>CUDA Driver Version: 295.41</p>
  
  <p>CUDA Toolkit version: 4.0</p>
  
  <p>OS: Ubuntu 10.04</p>
  
  <p>Hardware: GTX 480, or Tesla C2050</p>