I was wondering why none of simple Cuda code examples I found in Internet are working for me and I found that even this simplest code cause an error:
#include <stdio.h>
int main(int argc, char ** argv) {
size_t available, total;
cudaError_t err = cudaMemGetInfo(&available, &total);
if (err == cudaErrorMemoryAllocation) {
printf("cudaErrorMemoryAllocation");
} else {
printf("OK or not memory allocation error");
}
return 0;
}
The code above always prints out "cudaErrorMemoryAllocation".
Here is the output of cuda-memcheck test for this program:
cudaErrorMemoryAllocation
========= CUDA-MEMCHECK
========= Program hit error 2 on CUDA API call to cudaMemGetInfo
========= Saved host backtrace up to driver entry point at error
========= Host Frame:C:\Windows\SYSTEM32\nvcuda.dll (cuD3D11CtxCreate + 0x118a92) [0x137572]
========= Host Frame:D:\Cuda\a.exe [0x1223]
========= Host Frame:D:\Cuda\a.exe [0x101c]
========= Host Frame:D:\Cuda\a.exe [0x901f]
========= Host Frame:C:\Windows\system32\KERNEL32.DLL (BaseThreadInitThunk + 0x1a) [0x1832]
========= Host Frame:C:\Windows\SYSTEM32\ntdll.dll (RtlUserThreadStart + 0x21) [0x5d609]
=========
========= ERROR SUMMARY: 1 error
Platform Windows 8 64-bit
Compiler Visual Studio 2008
Compute capability 1.1 (GeForce 8800 GT)
CUDA version 5.5