2

I've recently set up my Macbook Air (late 2010) to dual-boot OS 10.10 with Ubuntu 16.04, and of course along the way I've run into the black screen problem when using the proprietary NVIDIA drivers. I've just tried Andreas' fix here. It all seems to go swimmingly, except that when I get to step #4 to reboot and check, I don't get the correct result for the PCI-E register for the bridge device. This is what I get for step #2:

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]

I've created the grub script /etc/grub.d/01_enable_vga.conf as described:

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

...and also changed the permissions and updated grub...

~> sudo chmod 755 /etc/grub.d/01_enable_vga.conf
~> sudo update-grub

...but when I reboot the machine and check, the value for the bridge device is incorrect:

~> sudo setpci -s "00:17.0" 3e.b
00
~> sudo setpci -s "02:00.0" 04.b
07

Any suggestions on what I can do to get this set correctly before I install the NVIDIA drivers? Am I changing the wrong bridge device? Is there a better way to do this?

Thanks in advance!

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/ubuntu/x86_64-efi/

Create x86_64-efi folder.

Ubuntu folder in /boot/EFI/ can be different on your machine depends how you named it in OS installation process, do not paste it. Replace it with correct path.

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

Copy setpci module files into grub2 folder

sudo cp /usr/lib/grub/x86_64-efi/setpci.* /boot/EFI/ubuntu/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/ubuntu/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

  • screenshots up.. – ylwghst Aug 4 '17 at 18:56
0

I had the same problem and got here because of google. It seems both you and I were confused by the file /etc/grub.d/01_enable_vga.conf

You want to have the file contain the cat command, you don't want to create it with cat (well, you can create it with nested cat). So try this:

sudo bash -c "cat > /etc/grub.d/01_enable_vga.conf" << END
cat << EOF
setpci -s "00:17.0" 3e.b=8
setpci -s "02:00.0" 04.b=7
EOF
END

I got the answer here: MacBook Pro 7,1 + Ubuntu 16.04 LTS + nVidia drivers

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.