CUDA Emulation not working Sample SDK Projects fail, Exceptions

Hello,

I’ve been trying to get CUDA working for the past day.

I’ve installed

  • CUDA Toolkit 2.1 (CudaSetup-2.1-win32.exe)

  • CUDA SDK 2.1 (NVIDIA_SDK10_CUDA_2.10.1215.2015.exe)

  • Microsoft Visual Studio 2008 Professional Edition

I’m trying this on a Laptop (Lenovo Y410) with Intel Graphics (I plan to use Emulation for CUDA).

Intel Core2Duo T5450 , 2GB Ram

Windows XP SP3 all updates.

So the first thing I tried was going to Projects dir

C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA CUDA SDK\projects

I’ve ran Release_vc90.sln, set MatrixMul as Main Startup Project, selected EmuDebug and ran.

Unfortunately it does not work well.

The console output is as follows:

[codebox]‘matrixMul.exe’: Loaded ‘C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA CUDA SDK\bin\win32\EmuDebug\matrixMul.exe’, Symbols loaded.

‘matrixMul.exe’: Loaded ‘C:\WINDOWS\system32\ntdll.dll’

‘matrixMul.exe’: Loaded ‘C:\WINDOWS\system32\kernel32.dll’

‘matrixMul.exe’: Loaded ‘C:\CUDA\bin\cudart.dll’, Binary was not built with debug information.

‘matrixMul.exe’: Loaded ‘C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA CUDA SDK\bin\win32\EmuDebug\cutil32D.dll’

First-chance exception at 0x7c812adb in matrixMul.exe: Microsoft C++ exception: cudaError_enum at memory location 0x0012fc90…

First-chance exception at 0x7c812adb in matrixMul.exe: Microsoft C++ exception: cudaError at memory location 0x0012fc8c…

The thread ‘Win32 Thread’ (0x1a4) has exited with code 0 (0x0).

The thread ‘Win32 Thread’ (0xc4c) has exited with code 0 (0x0).

The thread ‘Win32 Thread’ (0x6d8) has exited with code 0 (0x0).

[Lots like this]

The thread ‘Win32 Thread’ (0x11d8) has exited with code 0 (0x0).

The thread ‘Win32 Thread’ (0x894) has exited with code -1 (0xffffffff).

The thread ‘Win32 Thread’ (0x930) has exited with code -1 (0xffffffff).

The program ‘[3960] matrixMul.exe: Native’ has exited with code -1 (0xffffffff).

[/codebox]

All projects behave the same, even the Template project.

I’ve reinstalled CUDA and even VS 2008.

I’ve called a friend and got him to try. He installed CUDA Toolkit + SDK + VS2008 Express. He gets the same errors !

I’ve installed a fresh XP SP3 in a VmWare machine. Installed just CUDA + VS08 + Emulate (he has an ATI Card) and again the exact same problem.

I will now try and install VS 2005 and switch to CUDA 2.0 instead but it is becoming very frustrating. Will try and post back.

Searching the net for solutions to my problem came up rather empty to my surprise.

Still it does not seem to be such an isolated case. Am I missing something essential before running these projects ?

If you have any ideas, please feel free to mention them!

Thank you very much for your time.

Hello again,

I’ve installed VS 2005 and kept CUDA 2.1. Still same problem.
Uninstalled CUDA 2.1 and installed CUDA 2.0 -> all WORKING fine!

Tried to convert a CUDA 2.0 (VS 05) project to a VS 08 project and it’s WORKING.

Unfortunately, I’d love to use CUDA 2.1 still.

Any ideas please ?

You were compiling the wrong solutions. The projects in the CUDA 2.1 SDK come with solution files for VS2005 and VS2008. The VS2008 solutions end in _vc90.sln. If you run try compiling the other solution in the folder with VS2005, it should work.

Thank you but both the .sln (opened with VS05) and vc90.sln (opened with VS08) files from CUDA 2.1 projects, give the same errors at run.
This is why I think it’s something wrong with CUDA 2.1 …

Before compiling and running the sample projects, you also need to compile cudart.dll. See this post for directions (for VS2008):

http://forums.nvidia.com/index.php?s=&…st&p=513354

I imagine that they should work about the same using the older solution files and VS2005.

I’ve followed your directions, initially tried with VS2008, builds went OK, but same errors occured in EmuDebug and EmuRelease when running SDK projects (MatrixMul for instance).
I’ve then followed the directions with VS2005 and the same errors again. It seems that for me there is no way to run any CUDA 2.1 projects.

Very odd.

Thank you for your time.

Hi,

I am experiencing exactly the same problem. It seems a lot of users in this forum observed the same problem in emulation mode.

I tried CUDA in Emulation mode on

  • 32bit Windows XP + SP3

  • CUDA Toolkit 2.1

  • CUDA SDK 2.1

  • Visual Studio 2008

My computer has a single ATI PCI-E graphical card and no nvida card.

I compiled the template project and traced into the code to find that, in emulation mode, cudaGetDeviceCount() successfully returns a device count of one, but cudaGetDeviceProperties() returns uninitialized device properties. Visual studio’s debug output window shows

First-chance exception at 0x7c812a6b in template.exe: Microsoft C++ exception: cudaError_enum at memory location 0x0012fc5c

Like what you found out, someone also told me that he feels CUDA Toolkit 2.1 has some problem and suggest me to switch to CUDA 2.0.

If anyone get CUDA2.1 work in emulation mode, I would be very interested.

Thanks,

Lin

I’ve also encountered the same error using CUDA 2.2