Ah I finally figured out the issue. It had nothing to do with the version of CUDA or Ubuntu. I was getting a segfault because I was massing in a cuda tensor and then try and access the memory with a CPU OpenCV Mat. Converting the tensor to CPU before passing it to opencv fixed the issue.