Cuda win32 toolkit on x64 machine Installation bug

Hello All,

I’ve found a bug in 32-bit toolkit installer: it puts incorrect directories in PATH, CUDA_BIN_PATH and CUDA_LIB_PATH environment variables when run on a machine with x64 OS (Windows 7 in my case). They point to bin64 and lib64 folders, which do not exist in this version of toolkit. I’m not sure where should I report this, so let it just be here for the records.

My understanding was that you need to run the 64-bit toolkit on x64?

My application is 32-bit, it’s just the machine I’m building it on is x64. I tried the 64-bit version, but it produced x64 code, which is incompatible with the rest of my application.

I believe nowadays cuda installs both 32 and 64 bit libraries on 64bit platforms. You can compile and link 32bit code on a 64bit platform after installing the 64bit toolkit. I know my colleague is doing just that on 64bit linux.

Having a similar problem…

I looked in the CUDA\bin directory and there does not seem to be an nvcc.exe compiler there…there is one in the CUDA\bin64, though…

does this mean that one uses the nvcc from bin64 even when compiling to 32 bit targets?

yes, compile with -m32

thanks! adding the -m32 to the nvcc line fixed the compile problem…now the link fails with missing symbols: : error LNK2019: unresolved external symbol _cudaGetDeviceProperties@8 referenced in function “void __cdecl runTest(int,char const * *)” (?runTest@@YAXHPAPBD@Z) : error LNK2019: unresolved external symbol _cudaGetDeviceCount@4 referenced in function “void __cdecl runTest(int,char const * *)” (?runTest@@YAXHPAPBD@Z)

more errors than this, but all similar…I figure I need to change it to ref a different library as well but not sure exactly where…

well it is obvious now that these are from the main CUDA library … so when I change it to ref the 32 bit library it then build an executable, but the exe does not run (gives a system error message)…

(this is when the compile nvcc flag of -m32 is used)

so with the -m32 flag, i can get it to compile and build but not run, and without the -m32 flag, it does not compile. this is the bandwidthTest example.

You are right but where and how I can change these environment variables (PATH, CUDA_BIN_PATH and CUDA_LIB_PATH )? I’ve changed folder’s name:

C:\CUDA\bin64 --> C:\CUDA\bin64_org

C:\CUDA\lib64 --> C:\CUDA\lib64_org

and then

C:\CUDA\bin --> C:\CUDA\bin64

C:\CUDA\lib --> C:\CUDA\lib64

Now, I can compile a project but there are some messages:


NVAPI: bLhThunkInit: failed assert: lhThunk.pfnGetDisplayConfigBufferSizes

NVAPI: bLhThunkInit: failed assert: lhThunk.pfnQueryDisplayConfig

NVAPI: bLhThunkInit: failed assert: lhThunk.pfnSetDisplayConfig

NVAPI: bLhThunkInit: failed assert: lhThunk.pfnDisplayConfigGetDeviceInfo

NVAPI: bLhThunkInit: failed assert: lhThunk.pfnDisplayConfigSetDeviceInfo



I didn’t yet confirm the solution with -m32 flag suggested above, but the following works:

Uninstall 64-bit toolkit, then install 32-bit one, and change the paths in the environment variables PATH, CUDA_BIN_PATH and CUDA_LIB_PATH:

change CUDA\bin64 to CUDA\bin and CUDA\lib64 to CUDA\lib. Those are system variables, not user ones.

You should then be able to compile 32-bit projects as usual. Mine worked, at least.