Thread: CUDA C Compilation & Object File Execution Error
hello everyone,
beginner in cuda - c , first post here. need in compiling c code cuda. wrote simple program given below , after compiling got few error messages mentioned below.
compilation 1: head executable , when tried run got error message - permission denied. unable understand this.code:#include<stdio.h> #include<cuda.h> __global__ void kernel(void) { } int main (void) { kernel<<<1,1>>>(); printf("hello world!\n"); return 0; }
compilation 2: in compilation files not found.code:[abc@xyz cuda_c]$ nvcc -c -o head hello_world.cu [abc@xyz cuda_c]$ ./head -bash: ./head: permission denied
could please explain doing wrong? please give me links compile c code cuda. confused here , appreciated. thanks!code:[abc@xyz cuda_c]$ nvcc hello_world.cu /usr/bin/ld: warning: libdl.so.2, needed /opt/cuda-toolkit/bin/../lib/libcudart.so, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libpthread.so.0, needed /opt/cuda-toolkit/bin/../lib/libcudart.so, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: librt.so.1, needed /opt/cuda-toolkit/bin/../lib/libcudart.so, not found (try using -rpath or -rpath-link) /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `pthread_create@glibc_2.1' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `pthread_join@glibc_2.0' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `sem_init@glibc_2.1' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `sem_wait@glibc_2.1' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `pthread_detach@glibc_2.0' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `pthread_getspecific@glibc_2.0' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `sem_post@glibc_2.1' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `sem_trywait@glibc_2.1' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `sem_timedwait@glibc_2.2' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `pthread_mutexattr_init@glibc_2.0' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `dlsym@glibc_2.0' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `dlopen@glibc_2.1' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `pthread_key_create@glibc_2.0' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `sem_destroy@glibc_2.1' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `pthread_setspecific@glibc_2.0' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `pthread_key_delete@glibc_2.0' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `dlclose@glibc_2.0' /opt/cuda-toolkit/bin/../lib/libcudart.so: undefined reference `pthread_mutexattr_settype@glibc_2.1' collect2: error: ld returned 1 exit status
regards
smith
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk CUDA C Compilation & Object File Execution Error
Ubuntu
Comments
Post a Comment