How to compile CUDA SDK Sample?

2019-08-06 14:22发布

问题:

I failed to compile conjugate gradient solver. I downloaded the whole archieve that contains libraries, makefile and other stuff but the compiler lacks some header files. How to include all files I downloaded? Maybe I need to add some path or copy folder "common" to /usr/local/cuda/include/

回答1:

To download and build a cuda sample directly, the following steps worked for me:

wget http://developer.download.nvidia.com/compute/DevZone/CUDALibraries/Projects/x64/conjugateGradient.tar.gz
tar -xzvf conjugateGradient.tar.gz
cd 7_CUDALibraries/conjugateGradient
make
# to execute the program:
./conjugateGradient

This assumes a standard cuda 5 install is available at /usr/local/cuda. It does not assume that any samples are previously installed. I tested this on a machine with CUDA 5 and RHEL 5.5

If this does not work, please post details of the error output you received.

If you want to use some other sample than the example given here, the download links can be obtained here.



标签: sdk cuda