my system is this
CUDA 8.0
UBUNTU 16.04 LTS
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:22:03_CST_2017
Cuda compilation tools, release 8.0, V8.0.61
in bash.rc
export CUDA_HOME=/usr/local/cuda-8.0
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
i spend time about cuda tutorial
first i write ex1.cu
#include
#include <stdio.h>
#include “common/book.h”
global void add(int a, int b, int *c){
*c=a+b;
}
int main(){
int c;
int *dev_c;
HANDLE_ERROR(cudaMalloc( (void**)&dev_c, sizeof(int) ) );
add<<<1,1>>>(2,7, dev_c);
HANDLE_ERROR( cudaMemcpy( &c, dev_c, sizeof(int),cudaMemcpyDeviceToHost));
printf("2+7 = %d",c);
cudaFree(dev_c);
return 0;
}
and i compiled then it occured
won@won-desktop:~/cuda_example$ nvcc ex1.cu
nvcc warning : The ‘compute_20’, ‘sm_20’, and ‘sm_21’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
won@won-desktop:~/cuda_example$ ./a.out
CUDA driver version is insufficient for CUDA runtime version in ex1.cu at line 14