This will be fairly long post because I'd like to provide a lot of detail and information on what I've already tried and hasn't worked
I've just installed Ubuntu 18.04.1 on a mid-2012 15" Macbook Pro (model 9,1).
I want to be able to switch between my integrated and discrete GPUs. Currently my system is locked to my discrete GPU, an nvidia 650m.
First off, I'm running an EFI boot so Ubuntu is indeed able to recognize both GPUs.
$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce GT 650M Mac Edition] (rev a1)
I am using the nvidia-driver-390
driver currently.
Alongside which I have the nvidia-prime
and nvidia-settings
packages installed. prime-select
lists profiles for both integrated and discrete graphics, and I am able to switch between them
$ sudo prime-select
Usage: /usr/bin/prime-select nvidia|intel|query
$ sudo prime-select nvidia
Info: selecting the nvidia profile
$ sudo prime-select intel
Info: selecting the intel profile
However, even after selecting the intel
profile and rebooting, my computer continues to render everything using the discrete graphics card. I know this because if I run glmark2
then I see that
glmark2
itself will report that the OpenGL renderer being used in my 650m$ glmark2 ....................................................... glmark2 2014.03+git20150611.fa71af2d ....................................................... OpenGL Information GL_VENDOR: NVIDIA Corporation GL_RENDERER: GeForce GT 650M/PCIe/SSE2 GL_VERSION: 4.6.0 NVIDIA 390.77 ....................................................... [build] use-vbo=false: FPS: 3846 FrameTime: 0.260 ms ....................................................... glmark2 Score: 3846 .......................................................
I can see in "Nvidia X Server Settings" that my GPU utilization spikes to 100%
There is also another issue with nvidia-settings, which is that it does not display a "PRIME profiles" tab, as shown in other guides
The lack of prime-select
not doing anything might be related to missing "prime profiles" tab, though I'm not sure.
In the meantime, there's a lot of "solutions" I've found online which haven't worked. I'll enumerate them here (all of these changes have since been reverted)
Using proprietary drivers (I'm already on proprietary drivers, just thought I'd mention this)
Tried installing Bumblebee using the instructions for 14.04+ from here. This just prevented the graphical display manager from starting up, then I had to uninstall. Furthermore, whatever configuration that it did actually made installing proprietary drivers trigger the same issue as well, essentially making proprietary drivers uninstallable (before attempting installation of Bumblebee, I was able to install them fine)
This source suggests that blacklisting Nouveau will fix this issue. I tried the solution given here, no result
I actually tried disabling the discrete card entirely using the instructions here but it just ended up disabling graphics entirely (I couldn't even get to GRUB, I had to use a live usb to revert the changes)
Anyways, I can provide more details if needed but I was hoping that someone might be able to help. This guide looked promising but I'm not sure quite how to translate it to Ubuntu.
Anyways I can provide more details as needed, but I was hoping that someone might be able to help with this.
EDIT 1:
As requested, I'm getting some info on what happens why I try an run without proprietary drivers.
If I run sudo apt-get purge nvidia*
and reboot, everything looks fine. Some diagnostics:
$ sudo lshw -c video
*-display
description: VGA compatible controller
product: GK107M [GeForce GT 650M Mac Edition]
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=nouveau latency=0
resources: irq:45 memory:c0000000-c0ffffff memory:90000000-9fffffff memory:a0000000-a1ffffff ioport:2000(size=128) memory:c1000000-c107ffff
*-display
description: VGA compatible controller
product: 3rd Gen Core processor Graphics Controller
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
version: 09
width: 64 bits
clock: 33MHz
capabilities: msi pm vga_controller bus_master cap_list
configuration: driver=i915 latency=0
resources: irq:47 memory:c1400000-c17fffff memory:b0000000-bfffffff ioport:3000(size=64)
Running glmark2
now gives me
$ glmark2
.......................................................
glmark2 2014.03+git20150611.fa71af2d
.......................................................
OpenGL Information
GL_VENDOR: nouveau
GL_RENDERER: NVE7
GL_VERSION: 3.0 Mesa 18.0.5
.......................................................
[build] use-vbo=false: FPS: 751 FrameTime: 1.332 ms
.......................................................
glmark2 Score: 751
.......................................................
I still don't think my integrated GPU is in use. The frame time is quadrupled but that could just be Nouveau being slow. In addition, the GL_VENDOR
string is nouveau
, which is only listed as the driver for my discrete card (if my integrated card were being used I'd expect to see i915
based on the output from lshw
.
For what it's worth, if I reinstall just the nvidia-settings
package then the "Nvidia X Server Settings" application becomes much simpler
sudo apt-get purge nvidia*
and reboot without any issues, however the system still uses the nvidia card under the nouveau driver (actually it might be i915, let me check quickly) – pipsqueaker Dec 19 '18 at 06:12