Problems installing driver on laptop with an intel iGPU and nvidia card (with optimus technology)

I have tried to install Nvidia driver for my TUF Dash F15 laptop with RTX 3080 mobile gpu according to my previous thread.

I was instructed to start a new thread after it seems the issue is a compatibility between the intel iGPU and the nvidia RTX.

I just installed Ubuntu 21 by erasing the disk to install and sudo apt update and sudo apt upgrade and reboot. I then go the the ‘Additional Drivers’ tab in the ‘Software Update’ launcher and select "Using NVIDIA driver metapackage from nvidia-driver-460 (proprietary)’ and reboot. Upon booting, my laptop won’t load past the default ASUS screen and I cannot get to grub or any terminal using hot-keys. My only option at this point is to re-install Ubuntu.

Since I can’t get to a terminal, I don’t know how to get the nvidia-bug-report.log.gz or /var/log/nvidia-installer.log!

I’ve re-installed Ubuntu 21 and now I have not tried to install the driver. Below is the relevant information I could gather.

sudo lshw -c video

*-display
    VGA compatible controller
    product: Intel Corporation
    vendor: Intel Corporation
    physical id: 2
    bus info: pci@0000:00:02.0
    logical name: /dev/fb0
    version: 01
    width: 64 bits
    clock: 33Hz
    capabilities: pciexpress msi pm vga_controller bus_master cap_list rom fb
    configuration: depth=32 driver=i915 latency=0 mode=1920x1080 visual=truecolor xres=1920 yres=1080
    resources: iomemory:600-5ff iomemory:400-3ff irq:186 memory:6034000000-6034ffffff ioport:5000(size=64) memory:c0000-dffff memory:4010000000-4016ffffff memory:4020000000-40fffffff
*-display
    description: VGA compatible controller
    product: NVIDIA Corporation
    vendor: NVIDIA Corporation
    physical id: 0
    bus info: pci@0000:01:00.0
    version: a1
    width: 64 bits
    clock: 33mHz
    capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
    configuration: driver=nvidia latency=0
resouces: iomemory:600-5ff iomemory:600-5ff irq:16 memory:85000000-85ffffff memory:6020000000-602fffffff memory:6031fffff ioport:4000(size=128) memory:86000000-8607ffff

If you can’t get to even grub, it might be secure boot issue. Have you by chance signed (or dkms auto signed) installed nvidia kernel modules and added your MOK to shim boot loader? Recent shim version 15.4 have problems running grub after that. On my dell laptop I had to set secure boot to audit mode to prevent shim from hanging. Try setting secure boot to audit mode or disabling it. Alternatively you can set your EFI boot entry to grubx64.efi instead of shimx64.efi to avoid shim, but you’ll have to disable secure boot.

Alright, so I only understood half of what you said there. I already turned off secure boot, by disabling in bios.

How would I go about this?

You can either set it directly in bios boot settings or using efibootmgr utility (you need some live distro for that, I use gparted live: GParted -- Live CD/USB/PXE/HD).

efibootmgr example:
First, list your boot entries by invoking efibootmgr -v. Here’s what output looks like for me:

BootCurrent: 0009
Timeout: 0 seconds
BootOrder: 0009,0003,0000,0001,0002,0007
Boot0000* ONBOARD NIC (IPV4)
Boot0001* ONBOARD NIC (IPV6)
Boot0002* UEFI HTTPs Boot
Boot0003* Windows Boot Manager
Boot0007* UEFI IR-SSDPR-P34B-02T-80 GY5168865 1
Boot0009* Fedora
[thesource@MAXG155510 ~]$ sudo efibootmgr -v
BootCurrent: 0009
Timeout: 0 seconds
BootOrder: 0009,0003,0000,0001,0002,0007
Boot0000* ONBOARD NIC (IPV4)    PciRoot(0x0)/Pci(0x1d,0x5)/Pci(0x0,0x0)/MAC(60189529e740,0)/IPv4(0.0.0.00.0.0.0,0,0)N.....YM....R,Y.
Boot0001* ONBOARD NIC (IPV6)    PciRoot(0x0)/Pci(0x1d,0x5)/Pci(0x0,0x0)/MAC(60189529e740,0)/IPv6([::]:<->[::]:,0,0)N.....YM....R,Y.
Boot0002* UEFI HTTPs Boot       PciRoot(0x0)/Pci(0x1d,0x5)/Pci(0x0,0x0)/MAC(60189529e740,0)/IPv4(0.0.0.00.0.0.0,0,0)/Uri()N.....YM....R,Y.
Boot0003* Windows Boot Manager  HD(1,GPT,20786662-27e6-4d42-bd05-5ab648ab3727,0x800,0x64000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.
2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}... ................
Boot0007* UEFI IR-SSDPR-P34B-02T-80 GY5168865 1 PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,64-79-A7-4B-B0-D0-0A-44)/HD(1,GPT,20786662-27e6-4d42-bd05-5ab648ab3727,0x800,0x64000)/Fi
le(\EFI\Boot\BootX64.efi)N.....YM....R,Y.
Boot0009* Fedora        HD(1,GPT,20786662-27e6-4d42-bd05-5ab648ab3727,0x800,0x64000)/File(\EFI\fedora\shimx64.efi)

Now if I want to change my Fedora boot loader entry (number 0009) I can run efibootmgr like this:

efibootmgr -b 0009 -d /dev/nvme0n1 -p 1 -l \\EFI\\fedora\\grubx64.efi

-b selects entry from the list above to modify
-d selects disk (set correct path to your hard drive device here, for example, /dev/sda or /dev/nvme0n1)
-p selects EFI partition that has your boot loader installed (numbers start from 1)
-l sets boot loader path from the root of selected partition. Use windows style separators here (they need to be escaped by \ thus double \ )

After that run efibootmgr -v again to check if modification was done correctly. Reboot and make sure secure boot is disabled

I have fresh Ubuntu install and ran this:

efibootmgr -v

BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000
Boot0000* Windows Boot Manager	VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...3................
Boot0001* ubuntu	HD(1,GPT,8d14fed6-6fff-4e5b-8c4e-330283fb6ca0,0x800,0x100000)/File(\EFI\UBUNTU\SHIMX64.EFI)

And then I did the following:

efibootmgr -b 0001 -d /dev/nvme0n1 -p 1 -l \\EFI\\ubuntu\\grubx64.efi
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000
Boot0000* Windows Boot Manager
Boot0001* ubuntu

And checked with:

efibootmgr -v
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000
Boot0000* Windows Boot Manager	VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...3................
Boot0001* ubuntu	HD(1,GPT,8d14fed6-6fff-4e5b-8c4e-330283fb6ca0,0x800,0x100000)/File(\EFI\UBUNTU\SHIMX64.EFI)

Looks like it didn’t work. I also tried with changing the spelling of ubuntu to UBUNTU and Ubuntu.

Let’s try creating new boot entry and deleting old one then:

efibootmgr -c -d /dev/nvme0n1 -p 1 -l \\EFI\\ubuntu\\grubx64.efi -L "UBUNTU"

List entries, then if new one is added, delete old one

efibootmgr -b 0001 -B

check number before deleting
You can also delete entries and change boot order from bios setup

sudo efibootmgr -c -d /dev/nvme0n1 -p 1 -l \EFI\ubuntu\grubx64.efi -L “UBUNTU”
[sudo] password for blu: 
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0002,0001,0000
Boot0000* Windows Boot Manager
Boot0001* ubuntu
Boot0002* ࠜUBUNTUࠝ
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0003,0002,0001,0000
Boot0000* Windows Boot Manager
Boot0001* ubuntu
Boot0002* ࠜUBUNTUࠝ
Boot0003* ࠜUBUNTUࠝ
[sudo]: command not found
BootCurrent:: command not found
Timeout:: command not found
BootOrder:: command not found
Boot0000*: command not found
Boot0001*: command not found
Boot0002*: command not found

and then

efibootmgr -v
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0003,0002,0001,0000
Boot0000* Windows Boot Manager	VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...3................
Boot0001* ubuntu	HD(1,GPT,8d14fed6-6fff-4e5b-8c4e-330283fb6ca0,0x800,0x100000)/File(\EFI\UBUNTU\SHIMX64.EFI)
Boot0002* ࠜUBUNTUࠝ	HD(1,GPT,8d14fed6-6fff-4e5b-8c4e-330283fb6ca0,0x800,0x100000)/File(EFIubuntugrubx64.efi)
Boot0003* ࠜUBUNTUࠝ	HD(1,GPT,8d14fed6-6fff-4e5b-8c4e-330283fb6ca0,0x800,0x100000)/File(EFIubuntugrubx64.efi)

So then

sudo efibootmgr -b 003 -B
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0002,0000
Boot0000* Windows Boot Manager
Boot0002* ࠜUBUNTUࠝ
blu@whale:~$ sudo efibootmgr -b 001 -B
Could not delete variable: No such file or directory
blu@whale:~$ efibootmgr -v
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0002,0000
Boot0000* Windows Boot Manager	VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...3................
Boot0002* ࠜUBUNTUࠝ	HD(1,GPT,8d14fed6-6fff-4e5b-8c4e-330283fb6ca0,0x800,0x100000)/File(EFIubuntugrubx64.efi)

And now?

Double slashes in the path, also weird quotes in title. I edited my previous message so it’s displayed correctly now. Remove 0002 and add new entry again.

It works now. What next?

efibootmgr -v
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000
Boot0000* Windows Boot Manager	VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...3................
Boot0001* UBUNTU	HD(1,GPT,8d14fed6-6fff-4e5b-8c4e-330283fb6ca0,0x800,0x100000)/File(\EFI\ubuntu\grubx64.efi)

Now reboot, make sure secure boot is disabled and try to boot to your system

it boots! should i try to install the driver now?

Yes. After installation and before reboot run efibootmgr -v from your Ubuntu to make sure the installer haven’t decided to make it’s own corrections to your boot entries. Unlikely but just to be safe here.

It seems that rebooting has reset it. I checked just before installing the driver.

BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000
Boot0000* Windows Boot Manager  VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)WINDO
WS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c
.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...3.............^...
Boot0001* ubuntu        HD(1,GPT,8d14fed6-6fff-4e5b-8c4e-330283fb6ca0,0x800,0x10
0000)/File(\EFI\UBUNTU\SHIMX64.EFI)

I guess some service in ubuntu checks for specific entry. I don’t use Ubuntu, you should ask on Ubuntu forums

I’m just confused here cause in bios is says secure boot is off, even when I first turn it on. Does that not matter?