nvcc errors in every line
hi everyone, im noob in cuda .i've installed cuda driver, toolkit and sdk according manual in http://developer.download.nvidia.com/. But when im trying to use nvcc like nvcc p1.cu, where .cu file contains code of simple program:
#include <stdio.h>

__global__ void helloCUDA(float f)
{
  printf("Thread %d, f=%f\n", threadIdx.x, f);
}

int main()
{
  helloCUDA<<<1, 8>>>(1.2345f);
  cudaDeviceReset();
  return 0;
}

i've got a lot of error:

p1.cu:13:2: warning: missing terminating ' character
p1.cu:17:21: warning: backslash-newline at end of file
p1.cu:19:2: warning: missing terminating ' character
p1.cu(1): error: expected a declaration

p1.cu(1): error: unrecognized token

p1.cu(1): error: unrecognized token

p1.cu(1): error: unrecognized token

p1.cu(1): error: unrecognized token

p1.cu(1): error: unrecognized token

p1.cu(2): error: unrecognized token

p1.cu(2): error: unrecognized token

p1.cu(2): error: unrecognized token

p1.cu(2): error: unrecognized token

p1.cu(3): error: unrecognized token

p1.cu(3): error: unrecognized token

p1.cu(3): error: unrecognized token

p1.cu(3): error: unrecognized token

p1.cu(3): error: unrecognized token

p1.cu(3): error: unrecognized token

p1.cu(3): error: unrecognized token

p1.cu(3): error: unrecognized token

p1.cu(3): error: unrecognized token

p1.cu(3): error: unrecognized token

p1.cu(3): error: unrecognized token

p1.cu(3): error: unrecognized token

p1.cu(3): error: unrecognized token

p1.cu(4): error: unrecognized token

p1.cu(4): error: unrecognized token

p1.cu(4): error: unrecognized token

p1.cu(4): error: unrecognized token

p1.cu(4): error: unrecognized token

p1.cu(4): error: unrecognized token

p1.cu(5): error: unrecognized token

p1.cu(5): error: unrecognized token

p1.cu(5): error: unrecognized token

p1.cu(5): error: unrecognized token

p1.cu(5): error: unrecognized token

p1.cu(5): error: unrecognized token

p1.cu(5): error: unrecognized token

p1.cu(6): error: unrecognized token

p1.cu(7): error: unrecognized token

p1.cu(7): error: unrecognized token

p1.cu(7): error: unrecognized token

p1.cu(9): error: unrecognized token

p1.cu(9): error: unrecognized token

p1.cu(9): error: unrecognized token

p1.cu(9): error: unrecognized token

p1.cu(9): error: "#" not expected here

p1.cu(9): error: unrecognized token

p1.cu(9): error: unrecognized token

p1.cu(9): error: unrecognized token

p1.cu(9): error: unrecognized token

p1.cu(9): error: unrecognized token

etc.

what's wrong with nvcc? please help
Thank you
hi everyone, im noob in cuda .i've installed cuda driver, toolkit and sdk according manual in http://developer.download.nvidia.com/. But when im trying to use nvcc like nvcc p1.cu, where .cu file contains code of simple program:

#include <stdio.h>



__global__ void helloCUDA(float f)

{

  printf("Thread %d, f=%f\n", threadIdx.x, f);

}



int main()

{

  helloCUDA<<<1, 8>>>(1.2345f);

  cudaDeviceReset();

  return 0;

}



i've got a lot of error:



p1.cu:13:2: warning: missing terminating ' character

p1.cu:17:21: warning: backslash-newline at end of file

p1.cu:19:2: warning: missing terminating ' character

p1.cu(1): error: expected a declaration



p1.cu(1): error: unrecognized token



p1.cu(1): error: unrecognized token



p1.cu(1): error: unrecognized token



p1.cu(1): error: unrecognized token



p1.cu(1): error: unrecognized token



p1.cu(2): error: unrecognized token



p1.cu(2): error: unrecognized token



p1.cu(2): error: unrecognized token



p1.cu(2): error: unrecognized token



p1.cu(3): error: unrecognized token



p1.cu(3): error: unrecognized token



p1.cu(3): error: unrecognized token



p1.cu(3): error: unrecognized token



p1.cu(3): error: unrecognized token



p1.cu(3): error: unrecognized token



p1.cu(3): error: unrecognized token



p1.cu(3): error: unrecognized token



p1.cu(3): error: unrecognized token



p1.cu(3): error: unrecognized token



p1.cu(3): error: unrecognized token



p1.cu(3): error: unrecognized token



p1.cu(3): error: unrecognized token



p1.cu(4): error: unrecognized token



p1.cu(4): error: unrecognized token



p1.cu(4): error: unrecognized token



p1.cu(4): error: unrecognized token



p1.cu(4): error: unrecognized token



p1.cu(4): error: unrecognized token



p1.cu(5): error: unrecognized token



p1.cu(5): error: unrecognized token



p1.cu(5): error: unrecognized token



p1.cu(5): error: unrecognized token



p1.cu(5): error: unrecognized token



p1.cu(5): error: unrecognized token



p1.cu(5): error: unrecognized token



p1.cu(6): error: unrecognized token



p1.cu(7): error: unrecognized token



p1.cu(7): error: unrecognized token



p1.cu(7): error: unrecognized token



p1.cu(9): error: unrecognized token



p1.cu(9): error: unrecognized token



p1.cu(9): error: unrecognized token



p1.cu(9): error: unrecognized token



p1.cu(9): error: "#" not expected here



p1.cu(9): error: unrecognized token



p1.cu(9): error: unrecognized token



p1.cu(9): error: unrecognized token



p1.cu(9): error: unrecognized token



p1.cu(9): error: unrecognized token



etc.



what's wrong with nvcc? please help

Thank you

#1
Posted 01/26/2012 03:28 PM   
How do you enter the program into the computer and save it to p1.cu?
How do you enter the program into the computer and save it to p1.cu?

Always check return codes of CUDA calls for errors. Do not use __syncthreads() in conditional code unless the condition is guaranteed to evaluate identically for all threads of each block. Run your program under cuda-memcheck to detect stray memory accesses. If your kernel dies for larger problem sizes, it might exceed the runtime limit and trigger the watchdog timer.

#2
Posted 01/26/2012 03:53 PM   
using terminal: touch 1.cu, and then put my code in it, i think that i'm stupid noob ^^
using terminal: touch 1.cu, and then put my code in it, i think that i'm stupid noob ^^

#3
Posted 01/26/2012 04:21 PM   
How do you "put your code int it"?
How do you "put your code int it"?

Always check return codes of CUDA calls for errors. Do not use __syncthreads() in conditional code unless the condition is guaranteed to evaluate identically for all threads of each block. Run your program under cuda-memcheck to detect stray memory accesses. If your kernel dies for larger problem sizes, it might exceed the runtime limit and trigger the watchdog timer.

#4
Posted 01/26/2012 05:42 PM   
And please post here the output of "[font="Courier New"]hexdump -C p1.cu[/font]".
And please post here the output of "hexdump -C p1.cu".

Always check return codes of CUDA calls for errors. Do not use __syncthreads() in conditional code unless the condition is guaranteed to evaluate identically for all threads of each block. Run your program under cuda-memcheck to detect stray memory accesses. If your kernel dies for larger problem sizes, it might exceed the runtime limit and trigger the watchdog timer.

#5
Posted 01/26/2012 05:45 PM   
ohhh thanks, there was a lot of symbols for font color etc. Thank you /smile.gif' class='bbc_emoticon' alt=':smile:' /> but now how i can add paths for include files, because i get error that include files arent found?
ohhh thanks, there was a lot of symbols for font color etc. Thank you /smile.gif' class='bbc_emoticon' alt=':smile:' /> but now how i can add paths for include files, because i get error that include files arent found?

#6
Posted 01/26/2012 06:00 PM   
everything is ok, i just edit nvcc.profile adding there include paths. Thank you.
everything is ok, i just edit nvcc.profile adding there include paths. Thank you.

#7
Posted 01/27/2012 05:20 AM   
Scroll To Top