3

Does anyone know what _ITERATOR_DEBUG_LEVEL the NVCC sets?

I'm working in a Cmake project in VS2010 and get a linking error when trying to link the project:

2>warper_cuda.lib(cudakernels.cu.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in ColorTable.obj

I can set the _ITERATOR_DEBUG_LEVEL to 0 for the c++ files, but then it doesn't link anymore with some other libraries. So I need a way to make the nvcc compile with level 2.

Using everything in release mode works, so there the level seems to be set correctly. The command line used to compile look like this:

"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v4.0/bin/nvcc.exe" C:/path/to/cudakernels.cu -c -o "C:/path/to/cudakernels.cu.obj" -ccbin "c:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin" -m64 -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -Xcompiler ,\"/DWIN32\",\"/D_WINDOWS\",\"/W3\",\"/Zm1000\",\"/EHsc\",\"/GR\",\"/openmp\" -DNVCC -I -IC:/include/directory ...
Jan Rüegg
  • 9,587
  • 8
  • 63
  • 105
  • I think `_ITERATOR_DEBUG_LEVEL` is an internal visual studio setting. Are you sure you don't have some host object files or libraries which have been built for debugging? – talonmies Mar 14 '12 at 15:03
  • Yeah it's a visual studio thing. See http://stackoverflow.com/questions/5727815/how-to-set-iterator-debug-level-in-vs2010 – jli Mar 15 '12 at 03:19

1 Answers1

6

Just found the solution here: http://llpanorama.wordpress.com/2008/05/21/my-first-cuda-program/

I had to add "-D_DEBUG" to the NVCC command line to make it use an _ITERATOR_DEBUG_LEVEL of 2...

Jan Rüegg
  • 9,587
  • 8
  • 63
  • 105