Nvidia-smi can't find driver

I have a 2016ish (?) Mac Mini that I just booted Ubuntu 22.04 onto (not dual-booted). I’ve also got a Nvidia 3060 RTX Ti external GPU in a Razer enclosure that I’m hoping to get to play nicely with it so that I can do some medium-scale ML on my desktop.

So far:

  • I’ve managed to get the whole thing to boot up into Ubuntu while the eGPU is connected; lspci | grep -E 'VGA|3D brings up the eGPU okay, for example.
  • nvidia-smican’t pick up the NVIDIA drivers, which I figured I should get working before setting up cuda etc. (NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
  • I’ve reinstalled the drivers a bunch of times, using pretty much every deletion/installation/reboot sequence known to stackoverflow and these forums. No dice.
  • I don’t think the secure boot thing should be an issue; I a) am 80% sure it’s off and b) it /should/ be off because I was able to install Linux in the first place.
  • the Ubuntu Software & Drivers window says I am using the NVIDIA driver metapackage from nvidia-driver-510.

Basically, if you have any advice on getting nvidia-smi to find the drivers, it would be very very much appreciated! Please let me know if I need to post any more information; I’m at my wits’ end at this point.

Please set kernel parameter
if you’re lucky and have the right mac mini version, this will be sufficient. If not, please see this thread:

Thanks for the help! When I’m in the regular 5.15 kernel, with pci=realloc in /etc/default/grub, and I get to the terminal after stopping gdm3 (no Xserver on my machine, I think), I’m able to run the commands listed up to the part where I plug in the GPU. At that point it begins to type NVRM: This PCI I/O region assigned to your NVIDIA device is invalid without stopping; when I unplug the GPU, I get No NVIDIA device found scrolling so fast I can’t type anything in. Do you know what is going wrong?

Please read the linked thread.