Option to launch application using dedicated graphics card in Ubuntu 20.02 missing again (GeForce 940MX)


TL;DR: I previously fixed an issue in which the option to launch an application using the dedicated graphics card had disappeared. Recently, the issue has returned and I have no idea how to proceed this time.

On September 28th 2020, I noticed that the option to ‘launch application using dedicated graphics card’ disappeared, which is odd because I had used that option several times before. I looked into it and ran a few commands.

nvidia-smi gave me:
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

sudo lshw -c video listed my integrated graphics and my GeForce 940MX card, and showed my GeForce card as ‘UNCLAIMED’.

I then solved the issue by installing the nvidia-driver-450 (proprietary, tested) through the Software & Updates menu. In the process though, I remember being shown a dialog box that told me to configure UEFI Secure Boot, and that a new Machine-Owner Key had been generated. Here is a picture of that dialog box. So I went through with the process, chose a password, and rebooted my computer. A menu showed up that asked me to load a new MOK or something like that? I just remember being shown a menu and clicking around to see what the menu options were. At some point, I wanted to exit a sub-menu and hit the esc button, but I was prompted to enter the password and I couldn’t do anything else besides enter the password. I remember that particular sub-menu had two options: to load the new MOK or not (or something like that, I can’t remember exactly). I had been hovering over the ‘No’ option when I hit the esc button, so I fear that after I entered the password, that option was selected, when I didn’t intend to select it. Anyways, the system rebooted and everything was fine. The GeForce driver seemed to have installed just fine and the option to launch applications using the dedicated graphics card came back. The nvidia-smi command gave me satisfactory output, and the sudo lshw -c video command no longer displayed my graphics card as unclaimed. So everything seemed to be okay, despite my worries that I botched the whole process by choosing the wrong option.

Now about a week later, on October 7th 2020, I booted into Ubuntu to test out some audio issues that I was having (probably unrelated to this). Offhandedly, I right-clicked on an app and sure enough, the option to launch applications with my dedicated graphics card had disappeared again. I checked my Software & Updates menu and the driver is still there. I then ran some commands that I saw others had recommended to run from other forum posts:

Yet again, nvidia-smi gave me:
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

sudo lshw -c video gave me:
*-display description: VGA compatible controller product: HD Graphics 620 vendor: Intel Corporation physical id: 2 bus info: pci@0000:00:02.0 version: 02 width: 64 bits clock: 33MHz capabilities: pciexpress msi pm vga_controller bus_master cap_list rom configuration: driver=i915 latency=0 resources: irq:147 memory:db000000-dbffffff memory:70000000-7fffffff ioport:f000(size=64) memory:c0000-dffff *-display UNCLAIMED description: 3D controller product: GM108M [GeForce 940MX] vendor: NVIDIA Corporation physical id: 0 bus info: pci@0000:01:00.0 version: a2 width: 64 bits clock: 33MHz capabilities: pm msi pciexpress bus_master cap_list configuration: latency=0 resources: memory:dc000000-dcffffff memory:b0000000-bfffffff memory:c0000000-c1ffffff ioport:e000(size=128) memory:dd000000-dd07ffff

nvidia-settings gave me:
ERROR: NVIDIA driver is not loaded ERROR: Unable to load info from any available system (nvidia-settings:5703): GLib-GObject-CRITICAL **: 02:42:54.483: g_object_unref: assertion 'G_IS_OBJECT (object)' failed ** Message: 02:42:54.486: PRIME: Requires offloading ** Message: 02:42:54.486: PRIME: is it supported? yes ** Message: 02:42:54.518: PRIME: Usage: /usr/bin/prime-select nvidia|intel|on-demand|query ** Message: 02:42:54.518: PRIME: on-demand mode: "1" ** Message: 02:42:54.518: PRIME: is "on-demand" mode supported? yes

cat /proc/version_signature gave me:
Ubuntu 5.4.0-48.52-generic 5.4.60

dkms status gave me:
nvidia, 450.66, 5.4.0-48-generic, x86_64: installed

I just decided to generate a bug report. I looked through several other posts on the forum that described similar issues, but at this point, I’m wary of messing around with my drivers. I recently messed up my drivers on Windows (I dual-boot Windows and Ubuntu) pretty badly and I have yet to figure out how to fix that, so my time to troubleshoot this issue in Ubuntu is limited. That being said, if there are other posts that deal with this exact issue, I would very much appreciate it if you could point me in the right direction. Otherwise, I would really appreciate it if anyone could help me with my specific issue as detailed in this post.

The bug report is attached.
Additional information that could possibly be helpful:

  • PC: HP Spectre x360 2017 model 15t-bl000

Thank you so much in advance!
nvidia-bug-report.log.gz (140.6 KB)