title: How to Compile CUDA App is Visual Studio 2010?
body: <p>How to Compile CUDA App is Visual Studio 2010 ?</p>
  
  <p>Here are my steps:
  1. Create Empty C++ project without precompiled headers
  2. Add main.cpp</p>
  
  <pre><code>int main()
  {
   return 0;
  }
  </code></pre>
  
  <ol>
  <li><p>Add kernels.cu</p>
  
  <p>I referred to sample project MAtrixMul and copied its settings step by step. it can be complied now</p></li>
  </ol>
  
  <blockquote>
    <p>#include "cuda.h"</p>
  
  <pre><code>__global__ void VecAdd(float* A, float* B, float* C)
  {
   int i = threadId.x;
   C[i] = A[i] + B[i];
  }
  </code></pre>
  </blockquote>
  
  <ol>
  <li>Right-Click on project -> Build customizations -> Check cuda 3.2</li>
  <li>kernels.cu -> properties ->Compile with CUDA C/C++</li>
  <li>TRY Compiling: I get error:</li>
  </ol>
  
  <blockquote>
    <p>Error 37 error : <strong>This version of the
    CUDA Toolkit does not support the v100
    compiler.</strong>  Please verify that the
    Platform Toolset property is set to
    v90 under the General node of the
    project properties. C:\Program Files
    (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA
    3.1.targets 157 4 dfdfs</p>
  </blockquote>
  
  <ol>
  <li>Change Platform ToolSet to v90</li>
  <li>TRY Compiling: I get errors:</li>
  </ol>
  
  <blockquote>
    <p>Error 38 error MSB3721: The command
    ""C:\Program Files\NVIDIA GPU
    Computing
    Toolkit\CUDA\v3.1\bin\nvcc.exe"
    -gencode=arch=compute_10,code=\"sm_10,compute_10\"
    --use-local-env --cl-version 2008 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio
    9.0\VC\bin"  -I"C:\Program Files\NVIDIA GPU Computing
    Toolkit\CUDA\v3.1\include"  -G0 
    --keep-dir "Debug\" -maxrregcount=32  --machine 32 --compile  -D_NEXUS_DEBUG -g    -Xcompiler "/EHsc /nologo /Od /Zi  /MDd " -o "Debug\kernels.obj"
    "E:\Projects!Probing\dfdfs\kernels.cu""
    <strong>exited with code 2</strong>. C:\Program Files
    (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA
    3.1.targets 272 4 dfdfs</p>
    
    <p>Error 37 error : identifier "threadId"
    is
    undefined E:\Projects!Probing\dfdfs\kernels.cu 5 1 dfdfs</p>
  </blockquote>
  
  <p>Please healp me out.</p>
  
  <p>Thanks, Ilya</p>