RTX ADA PRO 6000 MAXQ : CUDA driver initialization failed

I built a new computer and installed an RTX Pro 6000 Blackwell in it.
I installed Ubuntu 24 and downloaded the nvidia-driver-580, but the system wouldn’t boot.
After some research online, I figured I might need to install the open-source drivers, so I did that. Then I ran nvidia-smi, and at first everything seemed fine — but when I tried running willic/gpu-burn, I got this error:

CUDA initialization: CUDA driver initialization failed, you might not have a CUDA GPU. (Triggered internally at /pytorch/c10/cuda/CUDAFunctions.cpp:119.)

Later, I found a Reddit post that suggested following these steps in order:

sudo apt-get purge '*nvidia*'
sudo apt autoremove
sudo apt update
sudo apt install linux-headers-$(uname -r) build-essential dkms
sudo apt install nvidia-driver-580-open
sudo reboot

Actually, the only command I hadn’t run before was:

sudo apt install linux-headers-$(uname -r) build-essential dkms

I’m not entirely sure what happened, but after running that command, the error disappeared — now the CUDA GPU is detected correctly.
Can someone please explain what exactly was going on here? Thanks in advance for any insights.