Ha! Day 2 of struggling with cuda, and I think I have finally won! Turns out I actually didn't have to compile or hand-install anything on Ubuntu 18.04. Just follow these steps: https://askubuntu.com/posts/1036265/revisions
Revisions to How do I Install CUDA on Ubuntu 18.04?