[font=“Comic Sans MS”]Dear all,
Today I try a simple Cuda program to compile by nvcc command but following error occurs :
[root@cuda1 ~]# nvcc mygpu.cu
sh: nvopencc: command not found
[root@cuda1 ~]# nv
nvcc nvcc.profile_test nvidia-installer nvidia-smi nvidia-xconfig
nvcc.profile nvidia-bug-report.sh nvidia-settings nvidia-uninstall
[root@cuda1 ~]# nv
Below is my simple code that I’m trying . Please guide me how to resolve this.
#include <stdio.h>
#include<stdlib.h>
#include “/usr/local/cuda/include/cuda.h”
#include “/usr/local/cuda/include/cuda_runtime.h”
int main( void ) {
cudaDeviceProp prop;
int count;
cudaGetDeviceCount( &count);
for (int i=0; i< count; i++) {
cudaGetDeviceProperties( ?, i);
printf( " — General Information for device %d —\n", i );
printf( “Name: %s\n”, prop.name );
printf( “Compute capability: %d.%d\n”, prop.major, prop.minor );
printf( “Clock rate: %d\n”, prop.clockRate );
printf( "Device copy overlap: " );
if (prop.deviceOverlap)
printf( “Enabled\n” );
else
printf( “Disabled\n” );
printf( "Kernel execition timeout : " );
if (prop.kernelExecTimeoutEnabled)
printf( “Enabled\n” );
else
printf( “Disabled\n” );
printf( " — Memory Information for device %d —\n", i );
printf( “Total global mem: %ld\n”, prop.totalGlobalMem );
printf( “Total constant Mem: %ld\n”, prop.totalConstMem );
printf( “Max mem pitch: %ld\n”, prop.memPitch );
printf( “Texture Alignment: %ld\n”, prop.textureAlignment );
printf( " — MP Information for device %d —\n", i );
printf( “Multiprocessor count: %d\n”,
prop.multiProcessorCount );
printf( “Shared mem per mp: %ld\n”, prop.sharedMemPerBlock );
printf( “Registers per mp: %d\n”, prop.regsPerBlock );
printf( “Threads in warp: %d\n”, prop.warpSize );
printf( “Max threads per block: %d\n”,
prop.maxThreadsPerBlock );
printf( “Max thread dimensions: (%d, %d, %d)\n”,
prop.maxThreadsDim[0], prop.maxThreadsDim[1],
prop.maxThreadsDim[2] );
printf( “Max grid dimensions: (%d, %d, %d)\n”,
prop.maxGridSize[0], prop.maxGridSize[1],
prop.maxGridSize[2] );
printf( “\n” );
}
}
I think I need to install OpenCl library. Can someone Please guide me how to make this library up and running with Cuda.
Thanks & best Regards,
Adarsh Sharma
[/font]