Make the CUDA usage safe. In case the machine runs out of CUDA memory, move everything to CPU, throw and alert and continue.