[CUDA]+[Visual C++ Express 2008]+[Win 7 x64] = Impossible?

I’ve wasted several hours trying to make this work. Installing the 64-bit CUDA stuff (SDK, Toolkit, Drivers) doesn’t work, I get this funny error when trying to build

nvcc fatal : Visual Studio configuration file ‘(null)’ could not be found for installation at ‘C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/…/…’

I searched about this error and it seems to be something with the Visual C++ 32-bit compiler which doesn’t work with 64-bit CUDA stuff (can’t I use 32-bit CUDA in a 64-bit installation?). So I tried to install 32-bit CUDA stuff. The driver just doesn’t install because I’m running Win 7 x64, the other stuff install but kinda incorrectly. So what I do now? Although I’m on a 64-bit OS I want to build 32-bit applications. Isn’t it possible with 64-bit CUDA?

Thanks

You should install the 32bit stuff, except the driver, that has to be 64bit.

That should make it possible to compile 32bit stuff.

It is btw. possible to compile 64bit code with VS2008 express, I have found a guide online (you have to install platform sdk and rename register entries and such).

Thanks for posting.

As I said in my first post, I installed the 32 bit stuff with the 64 bit driver, but it is installed kinda incorrectly and I couldn’t get to successfully compile that way. And this is what you’re talking about? I can’t find the registry keys he mentions there, like this [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Visual Studio\9.0\VC\VC_OBJECTS_PLATFORM_INFO].

I’m using the same combination you’re using - it is a pain to set up VC express for 64 bit compiling, and I had trouble getting CUDA to play well with VC express even with 64 bit compiling working. What I do is compile the CUDA kernels to PTX, and load the PTX through the CUDA driver API. This works for me, since it lets me treat the PTX code in a manner similar to how I treat GLSL shaders and (eventually) OpenCL programs.

Note that you need to look in HKEY_LM\SOFTWARE\Wow6432Node\Microsoft.…, not in HKEY_LM\SOFTWARE\Microsoft.… on a 64 bit system.

Oh thanks I finally got to setup VC++ Express for 64 bit compiling and its working. But I continue to get that same strange error when trying to compile CUDA applications =/ HALP

Now I got completely rid of that error after placing the file vcvarsamd64.bat at C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\ (got it from here ). But now the problem is that nvcc is generating 64 bit code. Isn’t it possible to instruct it to generate 32 bit code? I want to build 32 bit applications.

Thanks.

Oh now I finally got to build and run my CUDA application, but only in 64 bit (I had to build lots of libraries in 64 bit because I could only find 32 bit builds =/ im tired now…). Now the question remains: How to generate 32-bit code using the 64-bit nvcc compiler??

Thanks for any help.

Installing 64bit CUDA toolkit, which comes with 32 and 64 bit libs is the way to go.

  1. create a build configuration for 32 bit: Build=>Configuration Manager => Platform select Win32

  2. Project => Properties => CUDA build rule => extra options append --machine=32

  3. Tools => Options => Projects & Solutions => VC++ directories

set the appropriate libs for 32 bit (lib32 folder)

Thanks man, the --machine=32 is exactly what I was looking for. Thank you guyz