Add better CUDA error handling