dglt1 / optimus-switch

*installer finished* installs nvidia prime and makes switching to intel only and back again easy as one command. intel mode fully disables the nvidia gpu to extend battery life.
71 stars 9 forks source link

Failed to insert module 'nvidia': Operation not permitted #11

Closed clementpoiret closed 4 years ago

clementpoiret commented 4 years ago

Hi,

I'm still investigating the strange suspend issue I have. While in intel-only mode, my kernel still wants to load nvidia and nvidia-drm:

Nvidia mode, suspend working:

● systemd-modules-load.service - Load Kernel Modules
   Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static; vendor preset: disabled)
   Active: active (exited) since Sun 2019-11-10 13:34:04 CET; 55s ago
     Docs: man:systemd-modules-load.service(8)
           man:modules-load.d(5)
  Process: 345 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=0/SUCCESS)
 Main PID: 345 (code=exited, status=0/SUCCESS)

nov. 10 13:34:03 Lenovo-Y530 systemd-modules-load[345]: Inserted module 'nvidia'
nov. 10 13:34:04 Lenovo-Y530 systemd-modules-load[345]: Inserted module 'nvidia_drm'
nov. 10 13:34:04 Lenovo-Y530 systemd-modules-load[345]: Inserted module 'crypto_user'
nov. 10 13:34:04 Lenovo-Y530 systemd-modules-load[345]: Inserted module 'acpi_call'
nov. 10 13:34:04 Lenovo-Y530 systemd-modules-load[345]: Inserted module 'uinput'
nov. 10 13:34:04 Lenovo-Y530 systemd[1]: Started Load Kernel Modules.
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

Intel-mode, suspend not working:

● systemd-modules-load.service - Load Kernel Modules
   Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2019-11-10 13:18:57 CET; 1min 4s ago
     Docs: man:systemd-modules-load.service(8)
           man:modules-load.d(5)
  Process: 752 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=1/FAILURE)
 Main PID: 752 (code=exited, status=1/FAILURE)

nov. 10 13:18:57 Lenovo-Y530 systemd[1]: Starting Load Kernel Modules...
nov. 10 13:18:57 Lenovo-Y530 systemd-modules-load[752]: Error running install command for nvidia
nov. 10 13:18:57 Lenovo-Y530 systemd-modules-load[752]: Failed to insert module 'nvidia': Operation not permitted
nov. 10 13:18:57 Lenovo-Y530 systemd-modules-load[752]: Error running install command for nvidia
nov. 10 13:18:57 Lenovo-Y530 systemd-modules-load[752]: Failed to insert module 'nvidia_drm': Operation not permitted
nov. 10 13:18:57 Lenovo-Y530 systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE
nov. 10 13:18:57 Lenovo-Y530 systemd[1]: systemd-modules-load.service: Failed with result 'exit-code'.
nov. 10 13:18:57 Lenovo-Y530 systemd[1]: Failed to start Load Kernel Modules.

Do you have any idea?

A copy of journalctl -b-1: https://pastebin.com/tmsqfT49 Lid closed: going to sleep, Lid opened: resuming from sleep but black screen. Journalctl is referring to an error related to nvidia-suspend.sh

dglt1 commented 4 years ago

i noticed lately that the install commands that render the nvidia module useless were throwing errors and i've been testing with /bin/true rather than /bin/false and the errors seem to be gone and function remains the same as it was before.

edit these 4 lines to match in /etc/switch/intel/intel-modprobe.conf

install nvidia /bin/true
install nvidia-modeset /bin/true
install nvidia-drm /bin/true
install nvidia-uvm /bin/true

save/exit and set intel mode again to apply the changes. let me know how it goes.

also, do you have the bottom 2 lines of /etc/switch/intel/no-optimus.sh uncommented?

clementpoiret commented 4 years ago

I changed false by true, still have a blackscreen after wake up. nvidia-suspend.sh is still in the logs: https://pastebin.com/fG0RipUk And yes, no-optimus.sh has its two lines uncommented

clementpoiret commented 4 years ago

For those having the same problem verify that updates made by mhwd aren't loading modules in modules-load.d, and as suggested by @dglt1, commenting this line in /etc/switch/intel/no-optimus.sh is solving the issue of black screen after suspend.

#echo -n 1 > '/sys/bus/pci/devices/0000:01:00.0/remove'