CUDA 3.1 device printf? ...does not work at all...

micha@tesla01:~/lcs/bioinf/test$ cat test.cu
#include <stdio.h>
//#include <cutil.h>

global void helloCUDA(float f) {
printf(“Hello thread %d, f=%f\n”, threadIdx.x, f) ;
}

int main() {
helloCUDA<<<1, 5>>>(1.2345f);
cudaThreadExit();

return 0;	

}

micha@tesla01:~/lcs/bioinf/test$ nvcc test.cu -o test.bin
test.cu(6): error: calling a host function from a device/global function is not allowed

1 error detected in the compilation of “/tmp/tmpxft_00006390_00000000-4_test.cpp1.ii”.
micha@tesla01:~/lcs/bioinf/test$ nvcc -V
nvcc: NVIDIA ® Cuda compiler driver
Copyright © 2005-2010 NVIDIA Corporation
Built on Mon_Jun__7_18:56:31_PDT_2010
Cuda compilation tools, release 3.1, V0.2.1221

:unsure:

whats wrong?

printf is only supported on sm_20 I believe. Add “-arch=sm_20” to your nvcc invocation.

printf is only supported on sm_20 I believe. Add “-arch=sm_20” to your nvcc invocation.

oh ok thank you that might be the trick…
i guess our tesla c1060 system is only a v1.3 device…

oh men debugging is a messy **** since the device emulation
mode is not fully supported anymore…

think we need to buy a new tesla ;D
(yeah thats how it works nvidia…)

Thank You for the hint

EDIT:

ehm btw. where did you read that v2.0 devices are necessary to do the trick?
i didn’t found any word on this…
THX

EDIT EDIT:

seems like im blind…
“Formatted output is only supported by devices of compute capability 2.0.”
just focused on the example code…

oh ok thank you that might be the trick…
i guess our tesla c1060 system is only a v1.3 device…

oh men debugging is a messy **** since the device emulation
mode is not fully supported anymore…

think we need to buy a new tesla ;D
(yeah thats how it works nvidia…)

Thank You for the hint

EDIT:

ehm btw. where did you read that v2.0 devices are necessary to do the trick?
i didn’t found any word on this…
THX

EDIT EDIT:

seems like im blind…
“Formatted output is only supported by devices of compute capability 2.0.”
just focused on the example code…

you could always go for cuprintf though. It’s not perfect but it’s a good compromise.

you could always go for cuprintf though. It’s not perfect but it’s a good compromise.

thanks… ill have a look for it!

thanks… ill have a look for it!