Trying to get CUDA working better, but it's a pain in the ass.