Is there any way to know that GPU has an application running already or it is processing something before I Launch my application on it? I goggled but couldn’t find any API for that. I need something for CUDA Framework using C/C++.
You are looking for the NVIDIA Management Library (NVML) https://developer.nvidia.com/nvidia-management-library-nvml
nvidia-smi uses it to query the gpu. So there must be a function in the api https://docs.nvidia.com/deploy/nvml-api/index.html
which is capable to list all currently running processes on the graphics card