andrebrait / prime-indicator

PRIME Indicator Plus - enhanced indicator applet for NVIDIA Optimus laptops
GNU General Public License v3.0
69 stars 12 forks source link

reboot required to switch on Ubuntu 17.10 #34

Open Motherboard opened 6 years ago

Motherboard commented 6 years ago

Using Ubuntu 17.10 with nvidia-390, Switching (either from intel to nvidia, or from nvidia to intel) no longer happens on logout, but requires fool restart.

The indicator asks to confirm logout, but does nothing. And manual logout results in a login loop.

After a restart the gpu is switched.. I wonder if that's an Ubuntu thing? Will switching to Mint 18.3 solve this problem?

andrebrait commented 6 years ago

As far as I can tell, that's a side effect of newer kernels alongside newer Nvidia drivers. Mint is the equivalent of goint back to Ubuntu 16.04 and using the default 4.4 kernel, so that might work for you.

Motherboard commented 6 years ago

Oh, I have to use the 4.13 kernel... So I guess I'm doomed :(

By the way, I read on nvidia dev talks that using systemctl restart display-manager after logout from the vterm resolves the restart issue.. Maybe you could add that to prime-indicator, if it detects the kernel\drivers are too new to just logout\login.

Edit: Maybe a better way would be to ditch prime-select altogether and use nvidia-xrun instead.

andrebrait commented 6 years ago

Wow, pretty cool. Thanks a lot. I haven't been having a lot of time to mess with this indicator.

I'll see if I can pinpoint to yoh the location to insert the systemctl restart command in the scripts to see if it works for you.

Motherboard commented 6 years ago

I've got an update - the restart of the display manager is only needed for GDM (maybe also Gnome) - moved to Cinnamon and LightDM, and now it works fine!

andrebrait commented 6 years ago

I remember this whole scheme needed LightDM when I was researching how to enable it for other distros.

On Thu, May 17, 2018, 4:24 PM Guy Brand notifications@github.com wrote:

I've got an update - the restart of the display manager is only needed for GDM (maybe also Gnome) - moved to Cinnamon and LightDM, and now it works fine!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/andrebrait/prime-indicator/issues/34#issuecomment-389980340, or mute the thread https://github.com/notifications/unsubscribe-auth/AFd-utuP_xSCvivGrhvPzJL0_cJKw9NXks5tzc5pgaJpZM4T9lpC .

mmhobi7 commented 6 years ago

nvidia-xrun hasn't seen an update in awhile, and it seems to be the successor to bumblebee not nvidia-prime. I see a future for it where nvidia works like it does on windows with optimus.

We could replace logout with sudo reboot or sudo systemctl restart display-manager

mmhobi7 commented 6 years ago

ok so sudo systemctl restart display-manager is slower then a reboot and didn't switch the graphics.

Motherboard commented 6 years ago

@Aaahh restart display-manager was much faster than reboot on my machine, and it did switch the graphics.... And when I switched to lightDM, even this restart is not needed anymore.

My nvidia-prime version is 0.8.5, perhaps 0.8.8 in bionic beaver is the problem?

andrebrait commented 6 years ago

I have to take a proper look into this, but until September I can't promise anything...

What I would do to try and pinpoint the problem is to switch graphics using the NVIDIA's control panel and seeing what it takes to do so properly. Is it a reboot? Log out and then in? Restarting the display-manager? A combination of some of these?

My Indicator is basically a fancy icon in the tray + a script to run the switching without needing to sudo manually.

mmhobi7 commented 6 years ago

I am on 0.8.8, https://github.com/tseliot/nvidia-prime/commit/d68b6cdea96b619e3d1c7bbb5c8956fd5cec225d so can someone do cat /proc/acpi/bbswitch for me

also you were right on lighdm dependency, https://github.com/tseliot/nvidia-prime/commit/675b307bbace000d252ec2a0a50d881a041a3d71 https://launchpadlibrarian.net/366530048/nvidia-prime_0.8.7_0.8.8.diff.gz

the power of Nvidia is found at /etc/prime-discrete

everywhere I'm reading a reboot is required for 390. I remember reading somewhere that the alternative is basically to restart everything which is effectively a soft-reboot

Motherboard commented 6 years ago

so can someone do cat /proc/acpi/bbswitch for me

I get cat: /proc/acpi/bbswitch: No such file or directory

everywhere I'm reading a reboot is required for 390

I got nvidia 390.59-0ubuntu0~gpu17.10.1 with kernel 4.13.0-41-generic, and it work just fine with just login\logout with lightDM...

Using the nvidia-settings control panel to switch, as @andrebrait suggested also works for me with a simple login/logout.

mmhobi7 commented 6 years ago

Nvidia-settings tells me to "Please restart your computer to apply the changes"

It's the kernel, 4.15.0-21-generic The change was in the kernel I think, I think 4.14 also works with just a logout and login could you do a sudo cat /sys/kernel/debug/vgaswitcheroo/switch

Motherboard commented 6 years ago

cat: /sys/kernel/debug/vgaswitcheroo/switch: No such file or directory

mmhobi7 commented 6 years ago

Make sure you have intel switched on

Motherboard commented 6 years ago

Yes, I'm on the iGPU right now.

mmhobi7 commented 6 years ago

Well nvidia prime uses either vgaswicheroo or bbswitch, so I have no idea what is being used on your system, either way 0.8.8 and 4.15 brings switcheroo and requires reboot

Motherboard commented 6 years ago

bbswitch has a problem loading on my system:

dmesg | grep bbswitch


[    4.205189] bbswitch: No suitable _DSM call found.
[30881.017388] bbswitch: version 0.8
[30881.017398] bbswitch: Found integrated VGA device 0000:00:02.0: \_SB_.PCI0.GFX0
[30881.017408] bbswitch: Found discrete VGA device 0000:01:00.0: \_SB_.PCI0.PEG0.PEGP
[30881.017436] bbswitch: failed to evaluate \_SB_.PCI0.PEG0.PEGP._DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x0 {0x00,0x00,0x00,0x00}: AE_NOT_FOUND
[30881.017454] bbswitch: failed to evaluate \_SB_.PCI0.PEG0.PEGP._DSM {0xA0,0xA0,0x95,0x9D,0x60,0x00,0x48,0x4D,0xB3,0x4D,0x7E,0x5F,0xEA,0x12,0x9F,0xD4} 0x102 0x0 {0x00,0x00,0x00,0x00}: AE_NOT_FOUND
[30881.017536] bbswitch: No suitable _DSM call found.
[30881.090336] bbswitch: version 0.8
[30881.090353] bbswitch: Found integrated VGA device 0000:00:02.0: \_SB_.PCI0.GFX0
[30881.090370] bbswitch: Found discrete VGA device 0000:01:00.0: \_SB_.PCI0.PEG0.PEGP
[30881.090407] bbswitch: failed to evaluate \_SB_.PCI0.PEG0.PEGP._DSM {0xA0,0xA0,0x95,0x9D,0x60,0x00,0x48,0x4D,0xB3,0x4D,0x7E,0x5F,0xEA,0x12,0x9F,0xD4} 0x102 0x0 {0x00,0x00,0x00,0x00}: AE_NOT_FOUND
[30881.090512] bbswitch: No suitable _DSM call found.

But I still switch with no problem...

mmhobi7 commented 6 years ago

Can you tell if your nvidia is on? Like extra heat? I’m guessing your graphics card is never turned off cat /etc/prime-discrete

Motherboard commented 6 years ago

sudo cat /etc/prime-discrete off