Open xonq opened 4 years ago
Sounds like a typical back of the GPU turning off and not turning back on. I see you're using the bbswitch method here, but does it work with the default optimus-manager config ? (i.e, with all power management features turned off)
It has the same effects with the default config
I think I have found the solution. Under the [Optimus] section of /etc/optimus-manager/optimus-manager.conf I selected switching=none, pci_power_control=yes, pci_remove=yes and pci_reset=no. I am then able to switch both ways (though I have noticed that it complains about the Nvidia device being missing from the PCI bus and then it rescans and finds it).
I think I have found the solution. Under the [Optimus] section of /etc/optimus-manager/optimus-manager.conf I selected switching=none, pci_power_control=yes, pci_remove=yes and pci_reset=no. I am then able to switch both ways (though I have noticed that it complains about the Nvidia device being missing from the PCI bus and then it rescans and finds it).
When you switch to intel with this mothed, does your nvidia gpu turn off correctly? When I make it with this mothed, I can switch to nvidia gpu. But when swtich to intel in nvidia, my nvidia is still on.
When you switch to intel with this mothed, does your nvidia gpu turn off correctly? When I make it with this mothed, I can switch to nvidia gpu. But when swtich to intel in nvidia, my nvidia is still on.
Mine switches just fine (I can tell because the battery is consumed much more slowly). Have you tried using the bbswitch option instead?
I tried the suggestion from @BushMan01 above.. it did not work for me. What did work was switching nvidia driver option from NVreg_DynamicPowerManagement=0x02 to NVreg_DynamicPowerManagement=0x01. Now I can switch modes successfully in optimus-manager again. 02 is the recommended option in the nvidia guide, linked to from the wiki for this project.. and it used to work fine for me for a long time. Some change in kernel or nvidia driver seems to have broken it.
same problem, it doesn't switch with the switch command back and forth, only with --set-startup
then restart
I notice that the /etc/X11/xorg.conf.d/10-optimus-manager.conf file doesn't contents change from intel
$ optimus-manager --switch nvidia
ERROR : cannot get current display manager name : No display-manager.service file found You are about to switch GPUs. This will forcibly close all graphical sessions and all your applications WILL CLOSE. (you can pass the --no-confirm option to disable this warning) Continue ? (y/N)
Figured out the problem as per the FAQ you have to
I do not use a display manager (I use startx or xinit) Just like above, you must make sure to run /usr/bin/prime-offload (as normal user) just after the X > server is started, and /usr/bin/prime-switch (as root) after it has stopped.
so prime-switch
needed to run as root after every Xserver exit, without display manager you have to make it run manually to make the switch,
~/.xinitrc
you run your window manager for example exec i3
replace it with only i3
/etc/sudoers
adding this line YourUserName ALL = NOPASSWD: /usr/bin/prime-switch
to prevent it from requiring a password when writing sudo /usr/bin/prine-switch
sudo /usr/bin/prime-switch
Then end of the .xinitrc will be
i3
sudo /usr/bin/prime-switch
-that's it
prime-switch
before the xserver is fully killed so this error is produced
Setting up base state Unloading modules ['nvidia_drm', 'nvidia_modeset', 'nvidia'] (if loaded) Cannot setup GPU : kernel setup error : Cannot unload modules ['nvidia_drm', 'nvidia_modeset', 'nvidia'] : Failed to execute 'modprobe -r nvidia_drm nvidia_modeset nvidia' : modprobe: FATAL: Module nvidia_drm is in use.
.bash_profile
having the startx
command sudo /usr/bin/prine-switch
.bash_profile
is
#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc
if systemctl -q is-active graphical.target && [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then sudo /usr/bin/prime-switch exec startx fi
## Manually
- add this [option](https://github.com/Askannz/optimus-manager/wiki/FAQ,-common-issues,-troubleshooting#i-do-not-want-optimus-manager-to-log-me-out-automatically) to `optimus-manager.conf`
`auto_logout=no`
- this prevents auto logout when switching, so after the switch command, run `/usr/bin/prime-switch` as root
Thanks @ahegazy, your solution works great!
Also if anyone using sudo with password like me, you can add this line to /etc/sudoers
with visudo
to allow the sudo /usr/bin/prime-switch
command to run without a password:
%wheel ALL=(ALL) NOPASSWD: /usr/bin/prime-switch
Thank you @ahegazy :)
@ahegazy thanks but I'm still unable to switch out of Intel and into nvidia (Dell 15" 9550).
I don't have a .bash_profile since I'm mainly using fish now. Although I haven't seen the problem you describe of switching to intel (I'm only wanting to go in the opposite direction).
Under your Manually section, when I do "locate optimus-manager.conf", I get a lot of them.(?):
locate optimus-manager.conf
/etc/X11/xorg.conf.d/10-optimus-manager.conf
/etc/lightdm/lightdm.conf.d/20-optimus-manager.conf
/etc/sddm.conf.d/20-optimus-manager.conf
/usr/lib/modprobe.d/optimus-manager.conf
/usr/lib/systemd/logind.conf.d/10-optimus-manager.conf
/usr/share/optimus-manager.conf
I never take the laptop out of the house. It is always plugged in. I only want to run nvidia and not intel to see if it helps with screen tearing.
I am not a gamer. I bought a cheapo 43" Insignia TV, just to see a 4K for the first time.
So right now I'm using that as my main monitor, and a Toshiba 40" 1080p TV as a second monitor.
Also, I'm not sure now which string of commands got me there but at one point I was getting just the same thing on both monitors (except the 4k was only taking up half the tv screen).
Any ideas? Thanks!
Describe the bug Can switch to nvidia driver if I set it as startup. Can switch back to intel and relogin to apply. Cannot switch to nvidia unless a full restart is applied. No error trying to switch to nvidia in session, but it just doesn't switch. Modprobe error in the
gpu_setup.log
below.System info
Logs boot_setup.log gpu_setup.log prime_setup.log