You can test thrust tutorial source code easily.
More information : Thrust tutorial Web page
-
CUDA 12.0 or higher
If Cuda version is less than 12.0, code for older thrust versions is executed. -
gcc 10
(g++ 10)
Check it out with the command below.
$ gcc --version
If you can't build this source code and gcc version is not 10, please install gcc 10.
$ sudo apt-get update
$ sudo apt install gcc-10
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
$ sudo update-alternatives --config gcc
# Choose the selection number that corresponds to gcc10.
$ gcc --version
Make sure your gcc version is 10.
If the build fails even after changing the gcc version, please change g++ version to 10 also.
- nvidia driver check
$ nvidia-smi
- cuda check
$ nvcc -V
$ cd thrust_tutorial/
$ mkdir build && cd build/
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ make
Move to build directory.
$ cd thrust_tutorial/build/
$ ./hello
$ sudo apt install ./Download/(file_name.deb)
nsys profile ~/thrust_tutorial/build/sync
nsys profile ~/thrust_tutorial/build/nosync