Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iMac12,1 does not show graphics on screen [with workaround] #147

Open
probonopd opened this issue Feb 15, 2021 · 30 comments
Open

iMac12,1 does not show graphics on screen [with workaround] #147

probonopd opened this issue Feb 15, 2021 · 30 comments
Labels
bug Something isn't working

Comments

@probonopd
Copy link
Member

probonopd commented Feb 15, 2021

iMac12,1 (the sort of hardware we'd really like to support well out of the box) with Radeon GPU plays the welcome sound but does not show graphics on the screen.

Thanks - CRYPTiCEXiLE - on YouTube.

Workaround:
At bootloader prompt, need to type:

load radeonkms
load drm
boot

It would be interesting to know whether it works out-of-the-box in NomadBSD.

In the installed system:

edit the /etc/rc.conf where it has the .ko of the intel drivers at the end of the list just take that out and replace it with radeonkms.ko instead it should work

@probonopd probonopd added the bug Something isn't working label Feb 15, 2021
@probonopd probonopd changed the title Mac12,1 plays welcome sound but does not show graphics on screen iMac12,1 plays welcome sound but does not show graphics on screen Feb 15, 2021
@probonopd probonopd changed the title iMac12,1 plays welcome sound but does not show graphics on screen iMac12,1 does not show graphics on screen [with workaround] Feb 15, 2021
@probonopd
Copy link
Member Author

probonopd commented Feb 15, 2021

If you don't mind then please consider using the Hardware Probe utility to upload a probe for the iMac12,1 with Radeon GPU, this would help. Thank you.

Possibly it's just a missing hardware ID in https://github.com/helloSystem/ISO/blob/experimental/overlays/uzip/initgfx/files/etc/initgfx_device.db

@grahamperrin

This comment has been minimized.

@probonopd
Copy link
Member Author

According to https://pci-ids.ucw.cz/read/PC/1002/6741 the code name of the VGA chip is Turks, the model name is Whistler, and the PCI ID is 0x6741.

It seems that this family is used in multiple ~2011 Mac models, including

  • iMac12,1 (Mid-2011)
  • MacBookPro8,2 (Core i7, 15", Late 2011)

Can we support support the AMD Radeon HD 6630M/6650M/6750M/7670M/7690M (Whistler/Turks) family by adding 0x6741 to initgfx_device.db?

Caution: Turns out that Apple devices with this GPU seem to suffer from a well-known hardware flaw that can potentially damage the GPU by overheating:
https://apple.stackexchange.com/questions/267581/gpu-problem-boot-hangs-on-grey-screen/295805#295805
So proceed with caution. (I have lost a 2007 McaBookPro3,1 to similar issues with a NVidia GPU.) Definitely watch GPU temperature if you have an affected device. Maybe this is the reason why the ID has not been listed in initgfx_device.db so far?

@probonopd
Copy link
Member Author

probonopd commented Feb 17, 2021

Everyone with one of those GPUs, please comment here if build 0E6 or later fixes this for you.
Thanks!

@probonopd
Copy link
Member Author

Confirmed working in https://www.youtube.com/watch?v=sjCSuhv0ghU.
Thanks very much everyone who helped fix this.

@probonopd
Copy link
Member Author

Issue may be not really fixed as pointed out by @mrclksr in nomadbsd/NomadBSD#80, hence reopening.

Anyone with an affected device, please post the outut of

cat /.url
pciconf -lv | grep -B3 display
sysctl hw.pci.default_vgapci_unit

Thanks!

@lfom
Copy link

lfom commented Feb 21, 2021

experimental-12.2 booted normally here (with USB keyboard/mouse, of course). Even WiFi connected. Sound seems fine, without headphone detection (it is a normal issue on Linux as well). The only thing I missed was some GUI tools for configuring date/time/timezone. Other than this, system seems stable.

iMac12,1 i5-2500S AMD 6770M 512MB

https://github.com/helloSystem/ISO/commit/d292d58

vgapci1@pci0:0:2:0:     class=0x038000 card=0x20108086 chip=0x01028086 rev=0x09 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '2nd Generation Core Processor Family Integrated Graphics Controller'
    class      = display
--
vgapci0@pci0:1:0:0:     class=0x030000 card=0x6740106b chip=0x67401002 rev=0x00 hdr=0x00
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'Whistler [Radeon HD 6730M/6770M/7690M XT]'
    class      = display

hw.pci.default_vgapci_unit: 1

Regards

@mrclksr
Copy link

mrclksr commented Feb 21, 2021

Hi everybody,

this confirms that the Mac indeed is using the Intel IGP, not the Radeon. Question is, why drm-kmod fails with the well supported Intel HD Graphics 2000 IGP. Do you install drm-kmod via pkg or ports for helloSystem? It might be worth a try to test the NomadBSD 1.4-RC1 mac image (we are building the drm-kmod from ports to prevent any ABI compatibility issues) to see if it behaves the same.

@lfom
Copy link

lfom commented Feb 21, 2021

AFAIK iGPU is not wired to any display (internal or external) on iMac's, it is basically used for QuickSync/AirPlay only. Due to tearing, I am almost sure the live boot uses some source of generic VESA framebuffer driver.

@mrclksr
Copy link

mrclksr commented Feb 21, 2021

AFAIK iGPU is not wired to any display (internal or external) on iMac's, it is basically used for QuickSync/AirPlay only

This is consistent with the drm messages in your first video. On the other hand, the pciconfoutput and the default unit show that the IGP is used. And its PCI bus ID is used in the config file for the fallback SCFB driver.

Try

set hw.pci.default_vgapci_unit=0
boot

at the loader prompt.

@lfom
Copy link

lfom commented Feb 21, 2021

Try

set hw.pci.default_vgapci_unit=0
boot

It got stuck after the FreeBSD splash screen: just a non blinking cursor at top left corner for some seconds, no music, then I powered off. I don't know why pciconf shows that iGPU was default (maybe not active tho?), but I am sure that the iMac will not display anything or refuse to boot without a dGPU.

By the other hand, performance seems to be the same with load radeonkms && load drm && boot:

FreeBSD# sysctl hw.pci.default_vgapci_unit 
hw.pci.default_vgapci_unit: 0

Xorg.0.log shows it still loaded SCFB.

As a side notes:

  1. Simple Browser can be easily set as the default browser in the live media, it works pretty well while Falkon requires installation
  2. The fade in effect when displaying windows is a bit too slow, I do not know if a different profile can be used so the content is fully readable sooner.

@mrclksr
Copy link

mrclksr commented Feb 22, 2021

What happens if you set up the graphics manually as follows?:
Boot into single-user mode, and from the single-user shell:

# mount -a
# sysrc initgfx_enable=NO
# kldload radeonkms

Then create /usr/local/etc/X11/xorg.conf.d/00-radeon.conf:

Section "Device"
    Identifier    "ATI"
    Driver        "radeon"
EndSection

Finally, exit from the single-user shell with exit or Ctrl-D to boot into multi-user mode.

@lfom
Copy link

lfom commented Feb 23, 2021

@grahamperrin I don't think it is available in ports, it is probably a custom built app for helloSystem. Its abour/document page links to here IIRIC:
https://github.com/learnpyqt/15-minute-apps/tree/master/browser_tabbed

@mrclksr I will burn the ISO again and test soon.

@lfom
Copy link

lfom commented Feb 23, 2021

@mrclksr I was not able to follow the instructions... I used the info here to boot into single user mode, then pressed ENTER to use the default shell (/rescue/sh IIRIC), mount -a was OK but sysrc command was not found, nor radeonkms. Root was not mounted, I guess, so neither I could find X11 folder. Then, typing exit simply shutdown the computer. Did I miss something?

@grahamperrin
Copy link
Contributor

https://hellosystem.github.io/docs/developer/boot.html#boot-into-verbose-single-user-mode there's a note about single user mode in live mode.

#147 (comment) thanks.

@lfom
Copy link

lfom commented Feb 23, 2021

@grahamperrin I see, I probably missed that part. I will try again what @mrclksr suggested ASAP. Thanks.

And about Simple Browser, maybe I was not clear: I meant that Browser in the Dock should open Simple Browser directly instead of Falkon. Simple Browser is already installed and is probably enough for simple tasks in the live environment, but it is buried inside a folder.

@lfom
Copy link

lfom commented Feb 23, 2021

No deal... It seems that Xorg now loads the radeon driver, but it got stuck in the terminal. What I did:

  1. boot -s -v
  2. sed to remove the lines from init.sh until "exit 0" due to single user mode
  3. run new script
  4. chroot /livecd
  5. run furybsd init helper script
  6. followed instructions from iMac12,1 does not show graphics on screen [with workaround] #147 (comment)

@probonopd
Copy link
Member Author

Apple devices with this GPU seem to suffer from a well-known hardware flaw that can potentially damage the GPU by overheating. Many macOS users suffering from this have hence modified macOS to use the built-in Intel graphics instead.

So maybe we should just give preference to the Intel graphics if we can, to proactively prevent hardware failue. (Hence I'd not be all too unhappy if helloSystem works on the affected Apple machines but using Intel graphics.)

@lfom
Copy link

lfom commented Feb 24, 2021

Apple devices with this GPU seem to suffer from a well-known hardware flaw that can potentially damage the GPU by overheating. Many macOS users suffering from this have hence modified macOS to use the built-in Intel graphics instead.

So maybe we should just give preference to the Intel graphics if we can, to proactively prevent hardware failue. (Hence I'd not be all too unhappy if helloSystem works on the affected Apple machines but using Intel graphics.)

I does not work with iMac's, only MacBooks Pro. Please see Known Issues:
http://dosdude1.com/mojave/

@latenightly
Copy link

iMac12,1 (the sort of hardware we'd really like to support well out of the box) with Radeon GPU plays the welcome sound but does not show graphics on the screen.

Thanks - CRYPTiCEXiLE - on YouTube.

Workaround:
At bootloader prompt, need to type:

load radeonkms
load drm
boot

It would be interesting to know whether it works out-of-the-box in NomadBSD.

In the installed system:

edit the /etc/rc.conf where it has the .ko of the intel drivers at the end of the list just take that out and replace it with radeonkms.ko instead it should work

@probonopd when I try to boot hello on my iMac 21,5" mid 2010 from a USB stick (tried 2 different USB sticks) I can boot until the music plays but the screen stays black. Just like in the first video (CRYPTiCEXiLE - on YouTube).
However, the output of the boot process is different. I have attached a screenshot of the last output, just before the screen goes black and the music starts playing.

The GPU should be supported in the current version (which I tried to boot). The GPU ID is 0x9488 - an ATI Radeon HD 4670

Here is my output attached:
IMG_3728

Any idea on how to tackle this?

just in case: I tried to load radeonkms and drm at the bootloader prompt, but both could not be found. I guess now that initgfx is used it is supposed to be obsolete anways, right?

P.S: I was unsure if i should open a new ticket. As this seemed quite similar of an issue and people in the future might come here through google, I went for it here.

@lfom
Copy link

lfom commented Aug 7, 2021

I have tried again and both versions do not load AMD drivers (radeonkms), the screen goes black after the FreeBSD logo with just a solid block cursor at the top left.

experimental-12.2 023ec2d
r0.5.0 b6811af

kldstat shows only i915kms is loaded, no errors or messages related to 'radeon' in dmesg, what seems weird.
iMac12,1 - AMD 6770M

@latenightly
Copy link

@lfom was there a build that worked on your iMac 12,1 that correctly loaded the AMD drivers before?

@lfom
Copy link

lfom commented Aug 7, 2021

@latenightly experimental-12.2 d292d58 as shown in #147 (comment)

I do not know why AMD is completely disabled. I will try to explain it again: iMacs cannot show any graphics without AMD, the iGPU is not wired to the display. This workaround only works for MacBooks Pro.

@kettle-7
Copy link
Contributor

kettle-7 commented Aug 7, 2021

experimental-12.2

12.2 might be the game here.

I had the same problem, sans music, where on 12.2-based ISOs the screen would go black. Using the FreeBSD 13-based ISO fixes this.

@probonopd
Copy link
Member Author

@lfom: Does it work for you on NomadBSD?

@lfom
Copy link

lfom commented Aug 10, 2021

@probonopd Nope. I tried nomadbsd-130R-20210508.amd64 and it was extremely laggy for some reason. It loaded XOrg, I could see and move the mouse pointer over the tty screens, but nothing else (no desktop). Changing to other tty I could see some error that I think may be related to one of my disks: I have two internal disks, one SDD and one HDD, with High Sierra installed using Core Storage (homemade Fusion drive) and Pop!_OS 21.04 installed using BTRFS that is my daily driver. kldstat showed i915kms loaded only also.
Please feel free to ask for any other info or tests.

@kettle-7
Copy link
Contributor

Strange...

@probonopd
Copy link
Member Author

Maybe we should start asking for donations of old Macs to build up a hardware compatibility lab ;-/

@lfom
Copy link

lfom commented Aug 17, 2021

OK, I got NomadBSD working, and maybe this info will help fixing the problem with Hello. As NomadBSD has persistence by default, it is much easier to troubleshoot. I noticed there is Mac version of NomadBSD but it did not make any difference for me. I am still using nomadbsd-130R-20210508.amd64.

  1. Simply adding a conf file that loads the radeon driver (xf86-video-ati) seems to be enough, just add the file as shown in iMac12,1 does not show graphics on screen [with workaround] #147 (comment) (the screen may blink a couple of times, but then it will load the desktop and run fine). I have even added the TearFree option and it worked great, no lag nor tearing. I did not had to change anything else, initgfx and i915kms still loaded (maybe that's why the screen goes black before loading the desktop?).

  2. It is also possible to use modesetting (initgfx?), if radeonkms.ko is loaded in /etc/rc.conf and this option is added to /boot/loader.conf to disable framebuffer until radeonkms is loaded:

hw.syscons.disable=1

I tried removing the line and system froze after displaying the desktop (no icon, mouse pointer, nothing). I could see a bunch of drm errors in the console. I did not use this driver because it does not have a TearFree option, so scrolling looks bad with lots of tearing.

This thread may help if still there is any doubt:
https://forums.freebsd.org/threads/problems-with-radeon.79189/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants