how to know if cuda is installed code example

Example 1: cuda version check

nvcc --version

Example 2: check for cuda version

nvidia-smi
nvcc --version

Example 3: how to tell if i have cuda installed

C:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.1

Example 4: check cuda version

cat /usr/local/cuda/version.txt

Example 5: check if cuda installed

# nvcc -V
 nvcc: NVIDIA (R) Cuda compiler driver
 Copyright (c) 2005-2015 NVIDIA Corporation
 Built on Tue_Aug_11_14:31:50_CDT_2015
 Cuda compilation tools, release 7.5, V7.5.17

Example 6: how to tell if i have cuda installed

C:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.1\<category>\<sample_name>