4

I just installed Linux on my 2010 MacBookPro (triple boot using refind) and get the infamous black screen after installing the nvidia drivers.

I tried applying the solution metioned here:https://askubuntu.com/a/613573/488420 without success.

I wonder if I got the IDs for setpci right. Anyone can confirm?

I'm pasting below the lshw display output and my /etc/grub.d/01_enable_vga.conf file.

Thanks!

mint@mint-MacBookPro ~ $ sudo lshw -businfo -class bridge -class display
información del Bus  Dispositivo  Clase       Descripción
===========================================================
pci@0000:00:00.0                   bridge      Core Processor DRAM Controller
pci@0000:00:01.0                   bridge      Core Processor PCI Express x16 Root Port
pci@0000:01:00.0                   display     GT216M [GeForce GT 330M]
pci@0000:00:02.0                   display     Core Processor Integrated Graphics Controller
pci@0000:00:1c.0                   bridge      5 Series/3400 Series Chipset PCI Express Root Port 1
pci@0000:00:1c.1                   bridge      5 Series/3400 Series Chipset PCI Express Root Port 2
pci@0000:00:1c.2                   bridge      5 Series/3400 Series Chipset PCI Express Root Port 3
pci@0000:00:1c.3                   bridge      5 Series/3400 Series Chipset PCI Express Root Port 4
pci@0000:00:1e.0                   bridge      82801 Mobile PCI Bridge
pci@0000:00:1f.0                   bridge      Mobile 5 Series Chipset LPC Interface Controller
pci@0000:ff:00.0                   bridge      Core Processor QuickPath Architecture Generic Non-core Registers
pci@0000:ff:00.1                   bridge      Core Processor QuickPath Architecture System Address Decoder
pci@0000:ff:02.0                   bridge      Core Processor QPI Link 0
pci@0000:ff:02.1                   bridge      Core Processor QPI Physical 0
pci@0000:ff:02.2                   bridge      Core Processor Reserved
pci@0000:ff:02.3                   bridge      Core Processor Reserved

mint@mint-MacBookPro ~  sudo cat /etc/grub.d/01_enable_vga.conf
cat << EOF
setpci -s "00:01.0" 3e.b=8
setpci -s "01:00.0" 04.b=7
EOF
1
  • I have the exact same machine as yours, and am running into the exact same issue. Have you found a solution since your initial question?
    – Antony
    Aug 4, 2021 at 19:42

3 Answers 3

1

I finally solved the problem when setpci doesn't change the value of PCI-E bridge.

If you are unable to set the value of PCI-E brigde registers using setpci command in order to get nVidia GeForce drivers working on your Apple MacBook machine try these steps:

1. Find your PCI-E bus identifiers

lshw -businfo -class bridge -class display

[root@kernelLinux]# lshw -businfo -class bridge -class display
Bus info          Device      Class          Description
========================================================
pci@0000:00:00.0              bridge         MCP89 HOST Bridge
pci@0000:00:03.0              bridge         MCP89 LPC Bridge
pci@0000:00:15.0              bridge         NVIDIA Corporation
pci@0000:00:17.0              bridge         MCP89 PCI Express Bridge
pci@0000:02:00.0              display        MCP89 [GeForce 320M]

You will need the ID's of PCI Express Bridge and your display in format XX:XX.X

Your ID's can be different.

In this example our ID's are 00:17.0 for PCI-E brige and 02:00.0 for display [GPU].

2. Create a GRUB script

Our script will be slightly different than in mentioned post above.

I have noticed of two things. Grub2 installed using distro (mine is Centos) installation process doesn't contain setpci grub module. It's the reason why grub do not change registers while boot. Then It is necessary to load setpci module into grub before we run commands to change registers.

Download grub2-efi-modules

Ubuntu Linux

sudo apt-get install grub-efi-amd64-bin

Fedora Linux

sudo dnf install grub2-efi-modules

CentOS Linux

sudo yum install grub2-efi-modules

Modules will be installed in /usr/lib/grub/x86_64-efi/ but the setpci module files needs to be present in /boot/efi/EFI/centos/x86_64-efi/

Create x86_64-efi folder

sudo mkdir /boot/EFI/centos/x86_64-efi

Copy setpci module files into grub2 folder

sudo cp /usr/lib/grub/x86_64-efi/setpci.* /boot/EFI/centos/x86_64-efi

Create the 01_enable_vga.conf file.

The file should contain these lines of code:

Do not forget replace 00:17.0 for PCI-bridge and 02:00.0 for display [GPU] with your values.

sudo nano /etc/grub.d/01_enable_vga.conf

cat << EOF
insmod setpci
setpci -s "00:17.0" 3e.b=8
setpci -s "02:00.0" 04.b=7
EOF

Then repair permissions

sudo chmod 755 /etc/grub.d/01_enable_vga.conf

and update the /boot/efi/EFI/centos/grub.cfg

Ubuntu Linux

sudo update-grub

Do this command only on other distributions (not necessary on Ubuntu after update-grub):

grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg

3. Reboot your system and check registers

Reboot your machine and check if it's working. Replace ID's with yours again. Your terminal should finally show 08 (PCI-E bridge) and 07 (GPU).

sudo setpci -s "00:17.0" 3e.b
08

sudo setpci -s "02:00.0" 04.b
07

4. Install nVidia drivers

Screenshot: http://imgur.com/a/YiBXi

1
  • followed all the steps but when I run 'sudo setpci -s "00:17.0" 3e.b ' I get "0a" instead 08. Not sure why?
    – enjoy
    Apr 5, 2021 at 20:27
0

Comparing your lshw output with my original approach, it appears you're using a different Macbook Pro - yours is more recent and has one integrated and one discrete graphics card (NVIDIA GT 330M). I doubt that my solution for the Macbook Pro 7,1 (mid-2010, with only NVIDIA 320M) is applicable for your hardware.

Actually, I suspect that the root cause of your black screen is that the discrete NVIDIA 330 GT is disabled during EFI Linux boot. Hence, you would rather have to explicitly enable the discrete NVIDIA card using a different GRUB script. Initial pointers on how to achieve this would be https://discussions.apple.com/message/19065782#19065782 and https://help.ubuntu.com/community/UEFIBooting.

Due to the fact that I don't own that particular hardware, I am not sure whether these are the right settings.

0

You might try uncommenting the spoof_osx_version option in refind.conf. This might get the video working for your system, but I can't promise it will work. See the comments in refind.conf or in the rEFInd documentation for details on how this option works.

Note that this option might work differently depending on how you launch Linux -- that is, via BIOS-mode GRUB, EFI-mode GRUB, launching a kernel directly, etc. Also, note that the GRUB changes you're making will work only if you're booting Linux via GRUB. It's not clear if you're doing that. Please see the Methods of Booting Linux section of the rEFInd documentation to learn more about different ways of launching Linux from rEFInd.

1
  • Hi, I can confirm that spoof_osx_version hack is working for Macbookpro 11,3 with Geforce 750M model (Late 2013). I have no black screen after I enabled setting with 10.9 suggested value. Before that none of the nvidia prorietary drivers was working even though kernel was successfully loads the nvidia modules. I was getting black screen. Thank you for the tip and rEFInd.
    – risyasin
    Mar 13, 2020 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.