I have a multithreaded program, and only one thread is working with GPU (Cuda, C++). How to resume normal GPU processing after "sticky" error in cuda code in Linux?
I tried cudaDeviceReset():
__global__ void tKernel() {return; }
// it is a part of my code
cudaDeviceSynchronize();
cudaGetLastError();
cudaGetLastError();
cudaDeviceReset();
tKernel<<<1, 1>>>();
cudaDeviceSynchronize();
cudaError_t err = cudaGetLastError();
if (err != cudaSuccess) {
std::cout << cudaGetErrorString(err);
}
But every time there is an error: "all CUDA-capable devices are busy or unavailable". The only way is to stop my program and then to run it again. But how to reset GPU without restarting program?