Hello,
I am trying to run a small test on my graphics card using cuda, though it seems I dont get any data returned from a kernel.
Here is the code of “test.cu”:
#include <iostream>
__global__ void cudaTest (int* C)
{
*C = 20;
}
int main ()
{
int C = 12;
cudaTest<<<1, 1>>>(&C);
std::cout << C << "\n";
}
I expect the last line to print “20” on my screen, but i just get the declared “12”;
Compiling with “nvcc test.cu” doesnt show any error (Doesnt give any output at all - but thats good for a compiler i guess :D).
I am running an Ubuntu 9.04 with nvidia cuda drivers installed succesfully and a 9600 GT. I got those lines in my “~/.bashrc” as mentioned in the programmers guide:
PATH=$PATH:/usr/local/cuda/bin
export PATH
LD_LIBRARY_PATH=/usr/local/cuda/lib
export LD_LIBRARY_PATH
Checking dmesg after executing the compiled code i get:
NVRM: Xid (0004:00): 13, 0004 00000000 000050c0 00000368 00000000 00000100
Can anyone explain what I am doing wrong?
Thanks and greetings.