First check if nvcc is installed :
nvcc --version
If its Not Installed then you can install it (Nvidia CUDA ToolKit) using this guide :- https://developer.nvidia.com/cuda-downloads
1. Compile the CUDA (.cu) program:
nvcc my_cuda_program.cu -o my_cuda_program
2. Run the executable:
./my_cuda_program