is it possible to check if any CUDA devices are present before all cudaMalloc… commands are called?
im using C++ and i just want to print an error message before the program launches incase the user doesn’t support cuda tech.
EDIT: if i can check it from C#, it will be even better.
thanks!
You can use
cudaGetDeviceCountto get the number of cuda devices and use cuda device properties to retrieve your necessary compute capabilities.A rather old version of the API documentation for
cudaGetDeviceCountcan be found here.