Help for a beginner. (compiling the sample sdk projects) Need help compiling the examples providided

I am a CUDA beginner, absolute beginner and now I must conquer CUDA to gain my degree. I am using the guidelines provided by Nvidia and information I’ve found on the forum and from a member of this site too, but having some issues.

I am on Vista x64 and using the GeForce 560ti card. I have experience with basic Java coding and some very basic (absolute beginners stuff with C). So I am trying to follow the Nvidial starter guide word for word, all I want to be able to do is, just compile and run their example “bandwidthTest”. Of course if I can get this one example out the way I can start to look at the others.

Here are the key things I’ve done.

  1. Installed all the CUDA stuff, toolkit, sdk (4.0 beta versions) and updated my gpu driver.

2a. Installed Visual Studio Basic and C++ Express 2008.

2b. Installed Visual Studio Basic and C++ Express 2010 (not sure which to use, 2008 or 2010?).

  1. Installed the CUDA VS Wizard 2.2, which worked after visual studio c++ 2008 was installed.

  2. In VS C++ 2008, I added the “bin”, “lib” and “include” folders to the VC++ Directories, (through options -> projects and solutions).

  3. Tried to open the bandwidthTest example (in the folder ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\src), using open project and the file bandwidthTest_vs2008.sln. But I get the error “Project Load Failure”.

The error goes on to say give this statement:

Custom build rules file ‘C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\NvCudaRuntimeApi.rules’ was not found or failed to load.

I have read online that I need to change the build rules, but the method they use required the project to be loaded, so I can’t do that unless the project loads up.

Could anyone help me?

There are 2 other questions which spring to mind reading comments on the forum, is VS 2008 Express (free version)comptaible with CUDA SDK 62bit?

Last but not least, if I use Visual studio and am able to build the example, say bandwidthTest, will the results pop up in the command prompt or in VS?

Thank you very much.

Hi!

I looks like you are missing the cuda build rules. At least for CUDA 3.2 there is a catalog in $(CUDA_PATH_V3_2)\extras\visual_studio_integration.

There is a ReadMe file on where to move the CUDA build rule files. You should copy the Cuda build rule files into the \VCProjectDefaults.

The error you are getting is that the project uses the CUDA build rules but it couldn’t find them inside the specified folder.

The problem of using Visual Studio Express with 64-bit CUDA is that the Express edition does not include a 64-bit compiler, and you need a 64-bit compiler if you want to dev. 64-bit CUDA application.

You could install the Express edition and use 32-bit toolkit and SDK.

When you run the example, it will open a Console window and display the result.

Firstly I’d like to say thank you very much for the response.

Secondly having read what you;ve said and some more stuff on here and online, it seems that I should get VS 2008 Professional. I also have been advised to use CUDA 3.2.

I’m still trying to find out if I can have CUDA versions 4.0 and 3.2 installed on my system or if I should uninstall 4.0 and then try 3.2

The reason I ask this is because apparently CUDA VS Wizard 2.2 has only been fully tested and designed for 3.2, not 4.0.

As for the build rules, I’ll try to resolve that issue again once I’ve installed 2008 VS Professional, which is 64 bit compatible.

Uninstalling CUDA 4.0 and just having 3.2 is giving me better results, at least I can open projects, maybe not build them yet, but can at least open them.

Having some probs with the operating system, cuda vs wizard and the rules I’m guessing. I’m going to try and build a basic cuda file that just returns 0 or something in the main method, will see if that gives me progress.

I suspect you may just have to reboot, and then it’ll pick up the right paths.

The CUDA installer uses some environment variables that get set during boot up. But if you uninstall CUDA 3.2 and then install CUDA 4.0, the environment variable for CUDA 4.0 doesn’t get picked up until either a reboot, or if the user logs out and logs back in again.