VS2017(cuda9 ) can not compile 32bit cuda project.. but can successfully compile 64bit cuda project.

i add the same .cu file to project under VS2017(cuda9) . when i choose the project compile in 64bit, it can successfully compile and run. but when i choose 32bit, it shows error and fail.

anyone know the reason and solution?

the error shows:

严重性 代码 说明 项目 文件 行 禁止显示状态
错误 MSB3721 命令

““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc.exe” -ccbin "
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX86\x86" -x cu -I

“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include" --keep-dir Release -maxrregcount=0 --machine 32 --compile -DWIN32 -DNDEBUG -D_CONSOLE -Xcompiler "/EHsc /W3 logo /O2 /FS /Zi /MD " -o Release\kernel.cu.obj "

F:\GPU!算法\Test01\Test01\kernel.cu" -clean”已退出,返回代码为 1。

Test01 C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 9.0.targets 883
错误(活动) E0029 应输入表达式 Test01 f:\GPU!算法\Test01\Test01\kernel.cu 383

From the CUDA 9.0 Windows Installation Guide:

http://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html

The table above the cited paragraph shows that cross-development is supported for MSVS 2012 and MSVS 2013, but is not supported for MSVS 2015 and MSVS 2017.

hi njuffa,

thanks.

that means i must change to MSVS2013 and cuda 9…(My GPU is Geforce GTX960)…but still i can only use the below limited resource:

  1. CUDA Driver.
  2. CUDA Runtime (cudart)
  3. CUDA Math Library (math.h)
  4. CUDA C++ Compiler (nvcc)
  5. CUDA Development Tools

also means i can not use the other lib resource for example: cuSPARSE, OpenACC…CuRAND…

am i right?

I can only point you to the documentation regarding 64-bit -> 32-bit cross development, I have no personal experience with that. I have worked exclusively with 64-bit code for the past five years.

NVIDIA has been gradually reducing 32-bit support over the past three years or so. I think with CUDA 9 it is now completely gone on Linux. I would strongly suggest moving all CUDA development to 64-bit at your earliest convenience.

Hi njuffa,

thanks a lot.

i have one 32 bit dll that is developed several years ago. that’s why i want to use 32bit as development environment.

We are at the tail end of things moving from 32-bit to 64-bit (even Firefox is now a 64-bit app). So you might want to think about transitioning away from that 32-bit DLL before 32-bit support in CUDA disappears completely.

Note that with a 32-bit CUDA application, you will be able to use only 3+ GB of the GPU memory.

Hi njuffa,

thanks a lot. actually we use Geforece GTX960 only have 2GB GPU memory in total.