Linux Mint 22.3 on an old MacBook Pro Nvidia GPU

8 min read Original article ↗

Introduction

I have an old 15" MacBook Pro from late 2013. Physically, it’s perfectly fine and still a very nice machine. But Apple has decided to abandon it to e-waste; the latest macOS that will run on it is Big Sur, which hasn’t had an update in years, and increasingly software will just not run on it. Visual Studio Code will even auto-update itself to a version that won’t launch anymore if you let it.

I don’t really need a laptop very often anymore, but it’s nice to have one occasionally. And, I hate throwing away perfectly good hardware just because of forced obsolescence.

So, at the weekend I decided to wipe macOS and replace it with Linux Mint 22.3. I’d heard positive things from others about doing this, and I figured it was better than disposal or an increasingly unusable machine. This is an Intel based Mac so basically any Linux will run on it (and for Apple Silicon Macs, there’s Asahi), but Mint seemed a good bet because it’s designed to run well on older hardware. I had been advised to avoid anything that comes with Wayland because it depends on newer driver features that such an old GPU won’t have.

Linux Mint comes with a couple of lightweight desktop options, MATE or Xfce, but since this was a top tier model at the time I figured I might as well try the flagship Cinnamon desktop first, and switch if it was a problem.

Install Process

The install process was simple:

  1. Flash the Linux Mint Cinnamon ISO to a USB drive using Balena Etcher in macOS
  2. Reboot, holding Option to access the boot menu
  3. Select “EFI Boot” (weirdly I had 2 of these initially, but unplugging and re-plugging the USB resolved that)
  4. In the grub menu that appears, choose to run Mint (this is a Live disk)
  5. Once in the live USB install of Mint, double-click the Install Linux Mint icon on the desktop

After picking all the usual things like languages etc, and choosing to wipe the entire drive, it rebooted into my installed Mint just fine.

Fixing the WiFi

As expected, the WiFi didn’t work out of the box. Luckily, Linux Mint’s Driver Manager is quite happy to find & install the driver for you, provided you have an ethernet adapter to download it. I already had a USB ethernet adapter for this machine so it was easy - but worth noting that you do definitely need one for this to go smoothly.

Edit: I’m told you can alternatively just re-attach the install USB and Driver Manager will find the WiFi driver there! I haven’t tested that myself so can’t confirm but that’s convenient if you don’t have an Ethernet adapter. 👍

The Problem: Nvidia GT 750M

The thing I noticed immediately was that scrolling was a little jerky. Not terrible, but not great. But then I tried to do some web browsing, and found it to be quite jarring. Mouse pointer lag, jerky scrolling, slow page loading - it basically felt terrible compared to what Safari felt like under macOS on this machine.

By default, Linux Mint installs the nouveau open source driver for Nvidia cards. For some people this seems to work well enough, but on this GPU the performance is just terrible, even in such basic tasks as web browsing. Clearly, I needed a full-fat Nvidia driver.

At this point, of course I consulted the Internet, which gave me 2 bits of advice that didn’t work:

Advice 1: Use Driver Manager

Lots of people will tell you you can just open Driver Manager and it will pick up the native Nvidia driver. However, this only appears to work for newer GPUs which can use the newer “open” Nvidia driver. The GT 750M that is in this 2013 MacBook Pro is not supported by that driver, so this will never work.

Advice 2: Manually install the 470 driver

The latest driver that supports the Nvidia GT 750M is the v470 driver, which the Internet will tell you how to install manually using this command:

sudo apt install nvidia-driver-470

This would work out of the box, if you were on an older version of Linux Mint. Unfortunately it doesn’t work on Mint 22.3. Instead it fails and you will see this message:

dpkg: dependency problems prevent configuration of nvidia-driver-470:
 nvidia-driver-470 depends on nvidia-dkms-470 (<= 470.256.02-1); however:
  Package nvidia-dkms-470 is not configured yet.

🙁

The Culprit: Kernel v6.14

The underlying reason for this faiure is that the driver hasn’t been updated to work with the Linux Kernel v6.14, which is the default in Mint 22.3. Specifically it’s the nvidia-dkms-470 module which won’t build. To use it, we need to roll back to an earlier kernel.

Arch Linux has a patch which allows the driver to build under 6.14, but I haven’t tried adapting this to Mint yet.

Installing an earlier kernel

Mint does give you the option to install earlier kernels quite easily.

  1. Open Update Manager
  2. Open the View menu, and click Linux Kernels.
  3. From there you can select the 6.11 kernel and install it

6.11 isn’t an LTS kernel, so perhaps you’d want to install 6.12 or something instead. But that’s not offered by the Mint kernels GUI so I didn’t dig into that.

Once we have the 6.11 kernel installed, we can now install the Nvidia driver, because it will build against all installed kernels. So now we can run this:

sudo apt install nvidia-driver-470

You will still get an error, because the 6.14 kernel is still installed and that build will fail. But it will also build against the 6.11 kernel, which will work. To test it, we need to boot into the 6.11 kernel, which is not yet the default. To do that, we need to configure grub, the bootloader.

Grub config changes

In this section we need to tackle 2 things:

  • The Nvidia driver needs an extra kernel parameter added to the boot command, and
  • We need to force the grub boot menu to appear so we can pick the 6.11 kernel

All advice on the Internet will say that if you want to access the grub boot menu at startup, you hold Shift or Esc. This does not work on a Mac. I believe it’s because the UEFI boot process on a Mac is different, but the upshot is that you will never be able to use this method to access the boot menu. Instead, we have to change the grub config to always show the boot menu.

  1. Edit the grub config like this (or use the editor of your choice):
    • sudo nano /etc/default/grub
  2. Edit the following settings to force the grub menu to appear with no timeout:
    • GRUB_TIMEOUT_STYLE=false
    • GRUB_TIMEOUT=
    • GRUB_TERMINAL=console
    • Comment out the original settings so you can put them back later
  3. Find the boot line starting with linux /boot/vmlinuz and ending with quiet splash
    • Append nvidia_drm.modeset=1 to the end of that line (this is the nvidia kernel param)
  4. Save & exit
  5. Set the new config
    • sudo update-grub

Reboot & test

After you now reboot, you should see the grub boot menu. Pick the “Advanced Options for Linux Mint” option, and pick the entry for the 6.11 kernel.

Everything should be much snappier, especially web browsing which should now be smooth scrolling and a lot more responsive.

Making 6.11 the default kernel

The easiest way to now make the 6.11 kernel the default is simply to delete the 6.14 kernel, which is what I did. Alternatively, you could edit the grub config to select the correct option, but deleting it is simpler. You do that from Update Manager > View > Linux Kernels again.

After doing that, you can get rid of the grub menu at boot again by restoring the previous settings (which you hopefully commented out, as advised above). Remember to run sudo update-grub afterwards. Alternatively, you could leave the forced grub menu at boot, and just set GRUB_TIMEOUT so that you always have the option to get into grub for recovery. Otherwise the only way to do it on a Mac, if you can’t get into the system at all, is to use a boot USB.

Conclusion

There’s still more to do - right now the Nvidia GPU is being used all the time, rather than being battery-efficient and using the embedded Iris Pro when not under load. Apparently nvidia-prime is supposed to handle this but I ran out of time and haven’t been able to dig into it yet. That’s a job for another weekend.

Regardless, I hope this helps someone get better performance out of their old hardware!