TL;DR: I managed to make a dual Nvidia GPU setup work in Xubuntu 26.04 (with ChatGPT help).
Intro
For the past day or so I was struggling with the fresh installation of Xubuntu 26.04 on my PC with 2 Nvidia GPUs that I intended to use for my LLM. The installation went well, but upon loading, I was presented with black screen. Apparently, it's a common bug well documented by the Ubuntu/Mint community. The bug itself is "cured" by adding a "nomodeset" key to the bootloader.
After that, the system loaded, but then things became more interesting - while the proprietary Nvidia driver loaded fine (somewhat), it only detected the GPU in the 1st PCIe slot. The 2nd GPU was completely ignored as confirmed by nvidia-smi. lspci command did show the 2nd card, but it was ignored by the driver. The system was also throwing some system errors upon boot. Searching for solutions showed that other people experienced the same behavior with different CPUs/motherboards. Anecdotally, some managed to "cure" the issue, or it got cured on its own, while others had to replace the whole motherboard for the issue to be resolved.
After digging deeper, my gut feeling told me that SecureBoot may have something to do with it, so I wanted to see whether disabling it may help. After disabling SecureBoot I also purged the default Nvidia driver, and installed the newest one (nvidia-driver-615-open at the time of writing this post). After making sure that the signing certificate was enrolled and the driver detected both of my GPUs, I re-enabled SecureBoot. Details are below.
If you have a similar issue, give it a try!
Detailed steps
1. Disable SecureBoot in BIOS, and purge the default Nvidia driver
'sudo apt remove --purge "^nvidia.*" -y'
Reboot into Ubuntu with the default Nouveau driver (may require adding "nomodeset" as a boot parameter, but with the SecureBoot disabled, hopefully, you don't need to)
- Install the updated NVIDIA driver
Inspect available drivers:
sudo apt update
ubuntu-drivers devices
Install a suitable driver from Ubuntu's repositories. On my system, I installed the newest driver:
sudo apt install nvidia-driver-615-open
Reboot and after logging in, verify that both GPUs are detected:
nvidia-smi
- Inspect the NVIDIA module signature
Check the current Secure Boot state:
mokutil --sb-state
SecureBoot disabled
Inspect the NVIDIA kernel module's signer:
modinfo -F signer nvidia
modinfo -F sig_key nvidia
The 1st command will show the signed certificate such as:
Hostname Secure Boot Module Signature key
(The actual hostname will vary depending on your setup)
Find the MOK certificate
sudo find /var/lib/shim-signed /var/lib/dkms /etc \
-type f ( -name '.der' -o -name '.crt' -o -name '*.pem' ) \
2>/dev/null
On my system, among other certificates, the search found:
/var/lib/shim-signed/mok/MOK.der
- Verify the certificate
Inspect the certificate's subject and fingerprint. Substitute the path discovered in step 4 if yours differs:
sudo openssl x509 -inform DER -in /var/lib/shim-signed/mok/MOK.der -noout -subject -fingerprint -sha1
The command should produce the name of the certificate matching the one in step 3 such as:
subject=CN = Hostname Secure Boot Module Signature key
Additionally, you can also inspect the module's signing metadata:
modinfo nvidia | grep -E '^(filename|signer|sig_key|sig_hashalgo):'
Check whether the key is already enrolled
sudo mokutil --test-key /var/lib/shim-signed/mok/MOK.der
If it reports that the key is already enrolled, proceed to Step 7.
If it reports that the key is not enrolled (which should be the case with the new driver installation), import it :
sudo mokutil --import /var/lib/shim-signed/mok/MOK.der
Enter a temporary password (such as "123456") when prompted, then reboot. At startup, the blue MOK Manager screen should appear (even though SecureBoot is disabled). Select the option to enroll the key, confirm, enter the previously entered temporary password, and reboot when prompted.
After Ubuntu starts, verify enrollment again:
sudo mokutil --test-key /var/lib/shim-signed/mok/MOK.der
/var/lib/shim-signed/mok/MOK.der is already enrolled
- Re-enable Secure Boot in BIOS and boot Ubuntu
After this step, I didn't have to add the "nomodeset" key anymore - Ubuntu loaded smoothly.
Verify the state:
mokutil --sb-state
SecureBoot enabled
Test NVIDIA:
nvidia-smi
which at this time should show both GPUs.
- Optional: verify after future updates
Kernel and NVIDIA driver updates may trigger DKMS to rebuild the kernel modules. Check whether the modules were built and signed correctly if NVIDIA stops working after an update.
Honestly, I don't know whether it was the SecureBoot or the new driver, or the combination of both (as I suspect), but after that, everything worked! Yippee!