Building for x86 using CUDA x64

Hi y’all.

I recently started playing with CUDA 3.1 on Windows 7 Ultimate x64, and have built a couple of small 64-bit console applications and 64-bit DLLs. This was achieved using the 64-bit downloads of the 3 required components; driver, toolkit, sdk.

I now need to build a 32-bit DLL, and am wondering how to proceed. I figured that the 64-bit tools must allow me to create 32-bit binaries, so I had a quick look. The x64 toolkit seems to include 32-bit versions of the runtime, and while no 32-bit flavour of nvcc.exe was installed, the x64 version accepts a -m switch to specify the machine target. So that seems ok. However, the x64 SDK seems to deliver only a debug version of the cutil library in 32-bit, but not a 32-bit release version. In the common\lib sub-folder of the SDK, we have cutil64.dll, cutil64D.dll, and cutil32D.dll, but no cutil32.dll - odd, no?

Apart from that one file, can anyone advise as to whether it is actually necessary to install both the x86 and x64 versions of the SDK in order to build both 64-bit and 32-bit binaries under 64-bit Windows. I’m using VS 2008 btw, and would like to have a build configuration for each target. If I knew that the 64-bit installations had also delivered the 32-bit versions somewhere, and that I already have all the necessary files, then I’d start creating some extra environmental variables that an x86 build configuration could use in its paths and cuda rules, etc. But I’d rather not find out the hard way that I’m missing far more than cutil32.dll.

Is anyone set-up with Win x86 and x64 build configurations of their projects? How did you achieve it? Is there a recommended best-practice to set up such a dev environment? I’d really appreciate any pointers you can give me.

  • owenm.

At one time, I used CUDA 3.0 to build x86 executables on an x86_64 windows. All I installed was the x86_64 toolkit and used the -m32 option. as you pointed out. Actually, CMake set the -m32 option and everything else for me: All I had to do was select the correct compile environment at config time.

As for mentioning a lacking cutil32.dll, you are just asking for trouble from tmurray! cutil exists for the sole purpose of providing cross-platform functions to the SDK samples with just enough duct tape to get them to run. One should never use it in their own projects, NVIDIA offers absolutely no support and may change the cutil API and behavior at any time.

At one time, I used CUDA 3.0 to build x86 executables on an x86_64 windows. All I installed was the x86_64 toolkit and used the -m32 option. as you pointed out. Actually, CMake set the -m32 option and everything else for me: All I had to do was select the correct compile environment at config time.

As for mentioning a lacking cutil32.dll, you are just asking for trouble from tmurray! cutil exists for the sole purpose of providing cross-platform functions to the SDK samples with just enough duct tape to get them to run. One should never use it in their own projects, NVIDIA offers absolutely no support and may change the cutil API and behavior at any time.

I did all the same, beginning with 64 bit and trying to get a 32-bit dll after. It is not complicated.

You have to declare a new configuration in VS in win32.

To get the correct version of cutil library you must go to the repertory where there is the VS project of cutil and compile it with win32 configuration (debug & release). For nvcc, when you have downloaded and installed the 64 bit toolkit, it has also installed the 32 bit nvcc. To change the path in VS, go to Cuda Build Rules in the projects configuration and in cuda build rules, set the alternative nvcc path.

It worked for me !

I did all the same, beginning with 64 bit and trying to get a 32-bit dll after. It is not complicated.

You have to declare a new configuration in VS in win32.

To get the correct version of cutil library you must go to the repertory where there is the VS project of cutil and compile it with win32 configuration (debug & release). For nvcc, when you have downloaded and installed the 64 bit toolkit, it has also installed the 32 bit nvcc. To change the path in VS, go to Cuda Build Rules in the projects configuration and in cuda build rules, set the alternative nvcc path.

It worked for me !