[SOLVED] Ubuntu 20.04 on MacBook Pro 5,4: Screen flickering with Nvidia-340 driver

[SOLVED] Ubuntu 20.04 on MacBook Pro 5,4: Screen flickering with Nvidia-340 driver

Posting this here in the hopes that it might prove useful to someone, e.g. if you stumble over this via a Google search.

So I have an old MacBook Pro 5,4 that is in perfect shape hardware-wise (e.g. I upgraded it to 8 GB RAM and I replaced the disk with an 1 TB SSD; the laptop feels and performs as if it were fresh from the factory) … and Apple does no longer support it, it is not possible to install “vanilla” macOS on this machine. I’ve used Ubuntu on this laptop in the past (e.g. Ubuntu 16.04 and 18.04) so I assumed that Ubuntu 20.04 would also work without problems…

But no, it does not ūüôĀ

The open source “nouveau” graphics driver does select the correct refresh rate, frequency and the correct resolution … but the performance is rather “meh”. ūüė° … So I decided to use the “Software” settings and install the proprietary Nvidia-340 driver that is suggested for my ancient graphics card (Nvidia GeForce 9400M).

The installation works without problems but upon reboot I can see that the bottom ~20 pixels flicker like mad. It’s as if it’s 1982 again and you’re sitting in front of a Commodore C64 that is connected over a flaky cable to a bad old TV. ūüėĮ

I’ve found threads from other Linux distributions that describe the same problem there, but nothing specific to Ubuntu 20.04 and my exact setup. ūüôĀ

What helped me in the end was this thread from “Elementary OS”:

If you have the same issue with your ancient Nvidia-based graphics card in your old Mac, try setting the “Underscan” option to 1 or 2. This causes the Nvidia driver to switch into a meta-mode of 1438 x 898 instead of the 1440 x 900 the screen actually has. Whatever this really does … the flickering stops and everything looks clean again like it did with previous Ubuntu versions. \:D/


My /etc/X11/xorg.conf file thus looks like this:


# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 440.82

Section "ServerLayout"
    Identifier    "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option        "Xinerama" "0"

Section "Files"

Section "InputDevice"
    # generated from default
    Identifier    "Mouse0"
    Driver        "mouse"
    Option        "Protocol" "auto"
    Option        "Device" "/dev/psaux"
    Option        "Emulate3Buttons" "no"
    Option        "ZAxisMapping" "4 5"

Section "InputDevice"
    # generated from default
    Identifier    "Keyboard0"
    Driver        "kbd"

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier    "Monitor0"
    VendorName    "Unknown"
    ModelName      "Apple"
    HorizSync      30.0 - 75.0
    VertRefresh    59.9
    Option        "DPMS"

Section "Device"
    Identifier    "Device0"
    Driver        "nvidia"
    VendorName    "NVIDIA Corporation"
    BoardName      "GeForce 9400M"

Section "Screen"
    Identifier    "Screen0"
    Device        "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option        "Stereo" "0"
    Option        "metamodes" "nvidia-auto-select +0+0 {viewportout=1438x898+1+0}"
    Option        "SLI" "Off"
    Option        "MultiGPU" "Off"
    Option        "BaseMosaic" "off"
    SubSection    "Display"
        Depth      24

I hope that whoever runs into the same issue and is forced to google for a solution to this may find this useful.

Good luck ):P


Previous [kubuntu] Dolphin displaying to little free disk space
Next apt-get update not working in AWS EC2 Ubuntu 16.04

About author

You might also like

Ubuntu Dsicussions 0 Comments

Linux Ubuntu Live / newbie

I have a sony notebook vpcm111E running extremly slowly sometimes crashing on user start up. Is there a way to find and install apps as well as drivers? Im so

Ubuntu Dsicussions 0 Comments

[ubuntu] Printer compatibility – epson EXPRESSION PREMIUM XP-7100

Hello everyone, I would like to buy a new printer, but I wonder if it will work with Ubutu 20.04 LTS: I’m orienting myself on : Epson EXPRESSION PREMIUM XP-7100

Ubuntu Dsicussions 0 Comments

[ubuntu] Howto handle unresponsive lock screen

From time to time I’m confronted with an unresponsive lock screen, making it impossible to unlock my system after it went to sleep. The problem comes in two different flavours:


No Comments Yet!

You can be first to comment this post!

Leave a Reply