Disabling GPU kernel modules on startup?

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Telvee32

Disabling GPU kernel modules on startup?

Post by Telvee32 »

I'm on the cusp of FINALLY having a working Mint installation on my Optimus laptop, having had my functioning Fedora installation ruined by a screen repair (somehow).
I have a script that disables the nouveau module, loads i915 and bbswitch and uses bbswitch to turn off the NVIDIA GPU. Essentially, the same setup that I had in Fedora. This script works when called manually from the terminal. However, the systemd service that I created in Fedora to run this script on startup just causes Mint to hang just before the login screen. Interestingly, Fedora would also hang if I logged in with Xorg instead of Wayland.

Installation steps (adapted from this guide):
1) Add these kernel parameters to Live USB

Code: Select all

idle=nomwait nouveau.blacklist=1 nomodeset
2) Install as normal
3) Boot Mint 18.3 MATE (or Cinnamon) with the same parameters
4) Install all updates (including 4.13 kernel)
5) Reboot with same kernel parameters
6) Clone https://github.com/Bumblebee-Project/bbswitch
7) Enter directory and run

Code: Select all

make -f Makefile.dkms
8 ) Add these kernel parameters to /boot/grub/grub.cfg and reboot

Code: Select all

idle=nomwait nouveau.modeset=0
9) Create file /usr/local/bin/Switcher.sh and set perms to 755 (removed sudos from original as original uses autostart and passwordless sudo, which I disagree with)

Code: Select all

#!/bin/bash

/sbin/modprobe bbswitch
/sbin/rmmod nouveau
/sbin/modprobe i915
tee /proc/acpi/bbswitch <<< OFF
10) Create file /etc/systemd/system/nvidia-disable.service

Code: Select all

[Unit]
Description=NVIDIA disable

[Service]
Type=oneshot
ExecStart=/usr/local/bin/Switcher.sh

[Install]
WantedBy=multi-user.target
At this point, executing the Switcher.sh file with root permissions works fine. However, if I enable the nvidia-disable service and reboot, the machine will hang just before login. This same systemd service works fine in Fedora. Evidently I'm missing something here.

Honestly, I'd much rather use Mint than Fedora as the latter tended to be a bit of a pain in the neck more often than not, whereas Mint being based on Ubuntu has tended to be much smoother for me.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Locked

Return to “Graphics Cards & Monitors”