“Unable to determine the device handle for GPU 0000:01:00.0: Not Found” Debian trixie 535.183.06-1

Hello,

This message explains how I solved this message under Debian trixie. It is highly related to [this thread](https://“Unable to determine the device handle for GPU 0000:01:00.0: Not Found”-Ubuntu20.04-Nvidia Driver 515-open) so thanks to @ rienheuver.

Hardware :

lspci | grep -i nvidia
01:00.0 3D controller: NVIDIA Corporation GP108M [GeForce MX150] (rev a1)
  1. Edit /etc/apt/sources.list to add contrib, non-free, and non-free-firmware repositories. Once fixed, you should get something like:
$ grep -v ^# /etc/apt/sources.list | grep -v ^$
deb http://deb.debian.org/debian/ testing main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security testing-security main contrib non-free non-free-firmware
deb http://deb.debian.org/debian/ testing-updates main contrib non-free non-free-firmware
  1. Install xserver-xorg-video-nvidia (it’ll install nvidia-kernel-dkms). As root:
sudo apt update
sudo apt install xserver-xorg-video-nvidia
  1. Check whether secure boot is enabled.
mokutil --sb-state
SecureBoot enabled

I so, enroll the Debian system key by following these steps to auto-sign future kernel module made using DKMS. As root :

mokutil --import /var/lib/dkms/mok.pub
mokutil --list-new

Reboot and enroll the key.
Then, boot Debian.

  1. Try running:
nvidia-smi

I got the error:

Unable to determine the device handle for GPU 0000:01:00.0: Not Found
  1. Install nvidia-open-kernel-dkms instead and purge nvidia-kernel-dkms
sudo apt purge nvidia-kernel-dkms
sudo apt install nvidia-open-kernel-dkms
sudo reboot

The open kernel module won’t load! Now do the converse

sudo apt purge nvidia-open-kernel-dkms
sudo apt install nvidia-kernel-dkms
sudo modprobe nvidia-current
nvidia-smi 

It works!