title: Cuda Hello World printf not working even with -arch=sm_20
body: <p>I didn't think I was a complete newbie with Cuda, but apparently I am.</p>
  
  <p>I recently upgraded my cuda device to one capable capability 1.3 to 2.1 (Geforce GT 630). I thought to do a full upgrade to Cuda toolkit 5.0 as well.</p>
  
  <p>I can compile general cuda kernels, but printf is not working even with -arch=sm_20 set.</p>
  
  <p>Code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;assert.h&gt;
  #include &lt;cuda.h&gt;
  #include &lt;cuda_runtime.h&gt;
  
  __global__ void test(){
  
      printf("Hi Cuda World");
  }
  
  int main( int argc, char** argv )
  {
  
      test&lt;&lt;&lt;1,1&gt;&gt;&gt;();
          return 0;
  }
  </code></pre>
  
  <p>Compiler:</p>
  
  <pre><code>Error   2   error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_20,compute_10\" --use-local-env --cl-version 2010 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin"  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include"  -G   --keep-dir "Debug" -maxrregcount=0  --machine 32 --compile -arch=sm_20  -g   -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd  " -o "Debug\main.cu.obj" "d:\userstore\documents\visual studio 2010\Projects\testCuda\testCuda\main.cu"" exited with code 2.  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.0.targets  592 10  testCuda
  Error   1   error : calling a __host__ function("printf") from a __global__ function("test") is not allowed d:\userstore\documents\visual studio 2010\Projects\testCuda\testCuda\main.cu    9   1   testCuda
  </code></pre>
  
  <p>I'm about done with life because of this problem...done done done. Please talk me down from the rooftops with an answer.</p>