cuda 64 bit application not working? (cuda8 toolkit and MSVS)

My simple helloworld application when build using 32 bit visual studio application it is working fine, where as if I am changing it to 64 bit visual studio application it is not getting executed

Even there is no error message in output console.

#include “cuda_runtime.h”
#include “device_launch_parameters.h”
#include<stdio.h>
global void welcome() {
printf(“Hello world :)”);
}

int main() {
welcome << <1, 1 >> > ();
cudaDeviceSynchronize();
return 0;
}

I got stuck with this issue from last week, can any one please help on fixing this issue.

Thanks in advance.

try adding proper cuda error checking

Thanks @txbob for quick reply.

modified my code by adding error checks, still same issue. All print statements are executing till kernel launch. from there it is not getting executed a single line.

am I missing anything to change properties any where is visual studio 2015, while switching 32bit to 64 bit.?

#include “cuda_runtime.h”
#include “device_launch_parameters.h”
#include<stdio.h>
#define gpuErrchk(ans) { gpuAssert((ans), FILE, LINE); }
void gpuAssert(cudaError_t code, const char *file, int line, bool abort = true)
{
if (code != cudaSuccess)
{
fprintf(stderr, “GPUassert: %s %s %d\n”, cudaGetErrorString(code), file, line);
getchar();
if (abort) exit(code);
}
}
global void welcome() {
printf(“Hello world :)”);
}

int main() {
printf(“welcome :)”);
welcome << <1, 1 >> > ();
gpuErrchk(cudaPeekAtLastError());
gpuErrchk(cudaDeviceSynchronize());
getchar();
return 0;
}

Need help on this issue, badly

What happens if you run the vectorAdd sample project? Does it work correctly?

console shows only first line of cpu code “adding 5000 elements”, thats it. I think code might got stuck on cudaMalloc line.

if I run deviceQuery example it is working fine.

If the sample codes don’t work correctly, then you have a broken install of some sort.

I uninstalled and installed entire os and cuda for 3-4 times. If it is a broken install, can you please mention what are possible reasons or am I missing any libraries.

If I change vectorAdd to 32 bit application instead of 64 bit application it is working fine, whats the problem for running 64 bit applications.

Why does the posted code have explicit #includes for CUDA header files? Code in a .cu file, compiled using the nvcc compiler driver, shouldn’t need these.

You might want to try building from the command line instead of from the IDE. The IDE has some easy-to-overlook configuration settings that can trip up programmers. I’d say 90% of problems reported with MSVS IDE in these CUDA forums are PEBKAC errors facilitated by the use of the IDE.

For what it is worth, I have encountered no issues building 64-bit applications with CUDA 8 on 64-bit Windows 7 using MSVS 2010. What version of Windows are you running?

hmmm… works fine. such difficulty is not re-produced.

Windows7-64, Visual C++ 2015, CUDA 8.0

E:\work\nvcc>nvcc -Wno-deprecated-gpu-targets --machine 64 foo.cu
foo.cu
   ライブラリ a.lib とオブジェクト a.exp を作成中

E:\work\nvcc>a.exe
Hello world :)
E:\work\nvcc>

There does seem to be an issue particularly with x64, CUDA 8, Windows 10, and K40c.

The issue has been reproduced at NVIDIA. I’m not sure when it will be fixed.

In the meantime, changing any one of the above factors seems to rectify the issue. As a temporary workaround I would suggest using Windows 7 for this case, until the windows 10 issue is fixed.

I met with the same issue with

Windows7-64, Visual C++ 2015, CUDA 8.0

Is that fixed or any other suggestions?