New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

PDF does not display or is cut-off on OSX with GPU acceleration enabled

Reported by adman....@gmail.com, Mar 12 2016

Issue description

Chrome Version       : 49.0.2623.87
OS Version: OS X 10.9.5
URLs (if applicable) : http://www.pdf995.com/samples/pdf.pdf (any PDF that displays in the built-in PDF viewer will behave the same)
Other browsers tested:
  Add OK or FAIL after other browsers where you have tested this issue:
     Safari 5: OK
  Firefox 4.x: N/A
     IE 7/8/9: N/A

UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36

Graphics Feature Status
Canvas: Hardware accelerated
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Rasterization: Software only. Hardware acceleration disabled
Video Decode: Hardware accelerated
Video Encode: Hardware accelerated
WebGL: Hardware accelerated

Hardware is a MacBookPro11,1 with Intel Iris 1536 MB.

PDFs do not appear or appear garbled or cut-off in the built-in PDF viewer with GPU acceleration enabled. Scrolling the page makes the PDF flash and occasionally appear. Regression appears to have started with the Chrome 49 update, was working fine in Chrome 48.

Potentially similar to #591956 (Windows)
 
Screen Shot 2016-03-13 at 1.04.35 am.png
68.7 KB View Download
Cc: msrchandra@chromium.org
Labels: Needs-Feedback
Navigated to the URL "http://www.pdf995.com/samples/pdf.pdf" on Chrome Stable# 49.0.2623.87 and Chrome Canary# 51.0.2676.0 on Mac OS X 10.10.2 and could not reproduce the issue. 
Able to see the pdf without any abnormal behavior.
@adman.com -- Could you please let us know if there is anything else to do to reproduce the issue.
Thanks in Advance.

Comment 2 by adman....@gmail.com, Mar 14 2016

@msrchandra:
Verified issue still remains on Chrome stable# 49.0.2623.87 and Chrome Canary#  51.0.2673.0. on OSX 10.9.5. Testing on a different system with OS X 10.11.3 does not show the issue. Could also be related to the specific GPU (Intel Iris) in use on this device if not the operating system version.

Comment 3 by rsesek@chromium.org, Mar 14 2016

Cc: ccameron@chromium.org
Components: Internals>Plugins>PDF Internals>GPU
Labels: -Needs-Feedback
Labels: Needs-Feedback
I could not reproduce this error on a OS X 10.9 machine, with NVIDIA GeForce GT 750M 2048 MB graphics card.

Please clarify, why do you think this is a GPU-acceleration related issue? Does it go away when you turn off GPU acceleration?

Comment 5 by adman....@gmail.com, Mar 15 2016

Yep, passing --disable-gpu resolves the issue.
Project Member

Comment 6 by sheriffbot@chromium.org, Mar 15 2016

Labels: -Needs-Feedback Needs-Review
Owner: erikc...@chromium.org
Status: Assigned (was: Unconfirmed)
Thank you for providing more feedback. Assigning to requester "erikchen@chromium.org" for another review.

For more details visit https://sites.google.com/a/chromium.org/dev/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: -ccameron@chromium.org erikc...@chromium.org
Owner: ccameron@chromium.org
Cc: anan...@chromium.org tinazh@chromium.org lafo...@chromium.org
Labels: -Type-Bug Hotlist-ConOps Type-Bug-Regression
Users on Product Forums are reporting this issue after M49
Cc: ashej...@chromium.org
 Issue 591956  has been merged into this issue.
Labels: Needs-Bisect
Could you go to about:gpu, print the page to a PDF, and attach it? We'll probably have to find an exactly-matching machine to reproduce this.

Also, could you run from the command line with the flag --show-mac-overlay-borders, and attach a screenshot?

If this isn't in overlay mode (is green/red, not pink/grey) then I suspect this will be similar to the partial swap  issue 543324 . If that's the case, then I think we should just kill off partial swap on Mac -- CALayer overlays get us more power benefits, most of the time.
I'm affected by this issue on Chrome Version 49.0.2623.87 (64-bit). Attached is about:gpu

OSX 10.9.5 on late 2013 15-inch retina MacBook Pro

Here is a video with --show-mac-overlay-borders

https://youtu.be/oStEjaiCnTQ
chromegpu.pdf
266 KB Download
Labels: Needs-TestConfirmation
Okay, this is not the partial swap  issue 543324 .

We need to get a local repro. The test machine is
 Late 2013 15-inch retina MacBook Pro
 Intel Iris Pro GPU (VENDOR=0x8086, DEVICE=0x0d26)


I'm also seeing this issue:

Mid 2014 Retina 15-inch MBP
OSX 10.9.5
Chrome 50.0.2661.37 beta (64-bit)

chrome___gpu.pdf
126 KB Download
Labels: TE-NeedsTriageFromMTV
Unable to reproduce the issue on Mac 10.11.3 using chrome version 49.0.2623.87 and canary 51.0.2680.0.Able to view and scroll the PDF without any issues

Adding TE-NeedsTriageFromMTV as we don't have Mac 10.9.5 here.

Could any one from MTV team please look into this issue.

Thanks,

Comment 16 by gchrist...@d64.org, Mar 18 2016

Seeing this across our district - but only on machines still on 10.9 (every 10.9 machine I've tested in fact). It's a variety of hardware but here is an example. Issue persists with Canary build and a clean install of OS.

13-inch, Mid 2012 Macbook Pro
Version 49.0.2623.87 (64-bit)


chrome___gpu.pdf
138 KB Download
Screen Shot 2016-03-18 at 10.34.53 AM.png
128 KB View Download

Comment 17 by tin...@google.com, Mar 18 2016

Cc: sshruthi@chromium.org gov...@chromium.org
+M49 TPM and TE
Cc: ligim...@chromium.org
Cc: pbomm...@chromium.org
I am able to reproduce the bug on MacBook Pro 2012 with OSX 10.9.5 with Chrome 49.0.2623.87.
Labels: -Needs-TestConfirmation
I'm setting up a 10.9 machine to debug.
Labels: -Pri-2 Pri-1
Cc: raymes@chromium.org ccameron@chromium.org
 Issue 592263  has been merged into this issue.
My test machine doesn't support running 10.9 (it's too new of a machine). I'll drop by MTV on Wednesday to get a new one.

That said, I'm pretty sure I know what the fix will be for this (disabling CoreAnimation renderer on 10.9 -- it'll hurt battery some, but not upgrading your OS is also bad for battery, contrary to popular belief).
Labels: -Needs-Bisect
Removing from bisect queue, seems Chris is aware of the root cause.

Comment 26 by sits...@gmail.com, Mar 21 2016

 ccameron: Was CoreAnimation not enabled in pre Chrome 48 and earlier wrt to PDFs?
Labels: M-49 ReleaseBlock-Stable
It was not enabled in Chrome 48.
 Issue 596550  has been merged into this issue.
I can't reproduce this on my 10.9 machine, which I guess I already knew, since I tried in Comment 4.
Project Member

Comment 32 by bugdroid1@chromium.org, Mar 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/52dd784270ee9386ceba4e29c198c86dea9912dc

commit 52dd784270ee9386ceba4e29c198c86dea9912dc
Author: ccameron <ccameron@chromium.org>
Date: Tue Mar 22 03:29:03 2016

Disable CALayer overlays on 10.9

This is causing issues with PDF and print-preview for yet-unknown
reasons. Hopefully we can re-enable CALayer overlays when we find the
fix.

BUG= 594343 

Review URL: https://codereview.chromium.org/1819193002

Cr-Commit-Position: refs/heads/master@{#382498}

[modify] https://crrev.com/52dd784270ee9386ceba4e29c198c86dea9912dc/content/browser/compositor/browser_compositor_overlay_candidate_validator_mac.mm

I'm experiencing this issue as well. 

MBP Retina, 15-inch, Mid 2014
OSX 10.9.5
Version 49.0.2623.87 (64-bit)
The CL in Comment #32 does not fix the problem.
Also try --disable-remote-core-animation to see if that makes the issue go away.
Issue persists.
Next idea: make IsGpuMemoryBufferCompositorResourcesEnabled() return false.

After that I'm out of ideas.
Cc: piman@chromium.org vmi...@chromium.org
Are we only seeing this on some GPUs on 10.9? Are any of these GPUs blacklisted?
You are probably looking for a change made after 376015 (known good), but no later than 376065 (first known bad).
CHANGELOG URL:
  https://chromium.googlesource.com/chromium/src/+log/4967b70a63b618a6e508db88c2fa9c5dbef206f4..7723a589545f0d5b59ad792f6285fe9cb5a46c7a

Given that the base revision for M49 is good, the culprit CL was probably merged to M49.
Most suspicious:
c789639 Clear IOSurfaces immediately after creating them. by erikchen · 5 weeks ago

Testing now.
Cc: weili@chromium.org
I've confirmed that that CL is responsible, though I have no idea why. I asked weili@, and she said that on Mac, pdfium uses a custom backend which uses native apis to do drawing. They want to switch to Skia, but that hasn't happened yet.
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/pdfium/core/fxge/apple/

Nothing immediately jumps out as a problem point. I checked the return values on IOSurfaceLock/Unlock, and those are always 0. My best guess is that when we clear the IOSurface, somehow, we also end up clearing some, or all of the context that pdfium is trying to draw into.
This is a change we made 5 weeks back. What is the impact of that change? Is it reasonable to revert it (seems like it would be a clean revert?) till we can figure out what the problem is?
All the users who have posted problems have Intel GPUs.
When I turn off Automatic Graphics Switching (forcing NVIDIA GPU), problem also goes away.

I tried CPU clearing the IOSurface to (0, 255, 0, 255) within the IOSurfaceLock/Unlock combination, but that had no effect on the nature of the PDF rendering problems.
Cc: rsesek@chromium.org
This CL: https://codereview.chromium.org/1826613002/
turns off IOSurface clearing on OS X 10.9

rsesek: Can you comment on whether this security tradeoff is acceptable?
Given that this is a significant regression and we're only going to affect 10.9, I think it's an acceptable tradeoff. But it seems like this is a bug in PDFium that should be filed and chased down separately, so that we can revert that CL later.
Any idea when the switch to Skia is coming, so we have a worst-case scenario of how long we might need this workaround? 
When I correctly clear the newly minted IOSurface to green [CPU clear], it also clears much of the rendered PDF. 
Screen Shot 2016-03-22 at 3.15.53 PM.png
1.8 MB View Download
 Issue 597008  has been merged into this issue.
Cc: tsepez@chromium.org
+tsepez

Can you respond to Comment 48?
Cc: reed@chromium.org thestig@chromium.org
+thestig +reed
Cc: caryclark@chromium.org
+cary to address comment 48: "How long til skia?"
Cc: patricia@chromium.org
+patricia
Owner: erikc...@chromium.org
Project Member

Comment 56 by bugdroid1@chromium.org, Mar 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f38d1ce51f77c495dffb59d9c8d557881f3df448

commit f38d1ce51f77c495dffb59d9c8d557881f3df448
Author: erikchen <erikchen@chromium.org>
Date: Wed Mar 23 00:07:58 2016

Disable IOSurface clearing on OS X 10.9.

Doing so triggers PDF rendering problems on some GPUs.

BUG= 594343 
TBR=avi@chromium.org

Review URL: https://codereview.chromium.org/1826613002

Cr-Commit-Position: refs/heads/master@{#382739}

[modify] https://crrev.com/f38d1ce51f77c495dffb59d9c8d557881f3df448/ui/gfx/mac/io_surface.cc
[modify] https://crrev.com/f38d1ce51f77c495dffb59d9c8d557881f3df448/ui/gl/test/gl_image_test_template.h

Labels: Merge-Request-49
Status: Fixed (was: Assigned)
Labels: -Merge-Request-49 Merge-Approved-49
Per chat with sshruthi@, approving merge to M49 (branch 2623). The plan is to have merge in, cut a build of M49, and then verify on tomorrow's canary. If something goes wrong, we can cut another Stable build later on.
Project Member

Comment 59 by bugdroid1@chromium.org, Mar 23 2016

Labels: -merge-approved-49 merge-merged-2623
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a0ecd929bf77adc013f3caaf244b36fe630c5a80

commit a0ecd929bf77adc013f3caaf244b36fe630c5a80
Author: erikchen <erikchen@chromium.org>
Date: Wed Mar 23 00:25:43 2016

[Merge to 2623] Disable IOSurface clearing on OS X 10.9.

Doing so triggers PDF rendering problems on some GPUs.

BUG= 594343 
TBR=avi@chromium.org

Review URL: https://codereview.chromium.org/1826613002

Cr-Commit-Position: refs/heads/master@{#382739}
(cherry picked from commit f38d1ce51f77c495dffb59d9c8d557881f3df448)

Review URL: https://codereview.chromium.org/1825283003 .

Cr-Commit-Position: refs/branch-heads/2623@{#650}
Cr-Branched-From: 92d77538a86529ca35f9220bd3cd512cbea1f086-refs/heads/master@{#369907}

[modify] https://crrev.com/a0ecd929bf77adc013f3caaf244b36fe630c5a80/ui/gfx/mac/io_surface.cc
[modify] https://crrev.com/a0ecd929bf77adc013f3caaf244b36fe630c5a80/ui/gl/test/gl_image_test_template.h

Labels: Merge-Request-50
Re #48: PDFium's Mac graphics backend is a mixture of calls to CoreGraphics and agg aka Antigrain. Additionally, PDFium draws some primitives by allocating a bitmap and setting the pixel values directly.

Replacing all this with Skia is an ongoing investigation. Some PDFium features may require further development of Skia to fully implement. No ETA.
Verified the issue is fixed on Mac OSX 10.9.5(Machine I where I was able to repro) with Chrome Canary i.e., 51.0.2688.0.

Note : Also cross checked on Mac OSX 10.10.5 and 10.11.3 machines and not marking the bug as fixed since the CL need's to be verified on M50 and M49 as well.
Project Member

Comment 63 by bugdroid1@chromium.org, Mar 23 2016

Labels: merge-merged-2661
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/87c0cfd98a88e8bde7f83ad18de32a87664d388b

commit 87c0cfd98a88e8bde7f83ad18de32a87664d388b
Author: erikchen <erikchen@chromium.org>
Date: Wed Mar 23 17:54:04 2016

Disable IOSurface clearing on OS X 10.9.

Doing so triggers PDF rendering problems on some GPUs.

BUG= 594343 
TBR=avi@chromium.org

Review URL: https://codereview.chromium.org/1826613002

Cr-Commit-Position: refs/heads/master@{#382739}
(cherry picked from commit f38d1ce51f77c495dffb59d9c8d557881f3df448)

Review URL: https://codereview.chromium.org/1829843002 .

Cr-Commit-Position: refs/branch-heads/2661@{#361}
Cr-Branched-From: ef6f6ae5e4c96622286b563658d5cd62a6cf1197-refs/heads/master@{#378081}

[modify] https://crrev.com/87c0cfd98a88e8bde7f83ad18de32a87664d388b/ui/gfx/mac/io_surface.cc
[modify] https://crrev.com/87c0cfd98a88e8bde7f83ad18de32a87664d388b/ui/gl/test/gl_image_test_template.h

Comment 64 by tin...@google.com, Mar 23 2016

Labels: -Merge-Request-50 M-50
hey erikchen@, pls wait for merge approval in the future before you merge into a release branch. Thanks.
Project Member

Comment 65 by bugdroid1@chromium.org, Mar 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/09b6b31bbf4dc3de1ac5f8e31de9fabdd2e9f427

commit 09b6b31bbf4dc3de1ac5f8e31de9fabdd2e9f427
Author: ccameron <ccameron@chromium.org>
Date: Wed Mar 23 22:20:08 2016

Revert of Disable CALayer overlays on 10.9 (patchset #2 id:20001 of https://codereview.chromium.org/1819193002/ )

Reason for revert:
Wasn't helpful.

Original issue's description:
> Disable CALayer overlays on 10.9
>
> This is causing issues with PDF and print-preview for yet-unknown
> reasons. Hopefully we can re-enable CALayer overlays when we find the
> fix.
>
> BUG= 594343 
>
> Committed: https://crrev.com/52dd784270ee9386ceba4e29c198c86dea9912dc
> Cr-Commit-Position: refs/heads/master@{#382498}

TBR=erikchen@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG= 594343 

Review URL: https://codereview.chromium.org/1830733003

Cr-Commit-Position: refs/heads/master@{#382943}

[modify] https://crrev.com/09b6b31bbf4dc3de1ac5f8e31de9fabdd2e9f427/content/browser/compositor/browser_compositor_overlay_candidate_validator_mac.mm

Verified that the issue is fixed on Mac OSX 10.9.5(Machine I where I was able to repro) with Chrome M49.

Note : Also cross checked on Mac OSX 10.10.5 and 10.11.3 machines and not marking the bug as fixed since the CL need to be verified on M50.
This patch is now pushing out to stable channel in version 49.0.2623.108.
Verified fixed on stable 49.0.2623.108. Thanks guys!

Comment 69 by sits...@gmail.com, Mar 27 2016

49.0.2623.108 resolves the issue for me too - thanks!
Status: Verified (was: Fixed)
Verified that the issue is now fixed on all Chrome Channels i.e.,Stable(49.0.2623.108 and .110), Beta(50.0.2661.57), Dev(51.0.2693.2) and Canary(51.0.2694.1)on Mac OSX 10.9.5,Marking the bug as verified.
I'm using Google Chrome 49.0.2623.110 m and this problem is still happening to me (white page from internet and from PC with PDF files. Interesting is that this happens occasionally). I use Microsoft Windows 10 64-bit. I have tried to allow/disable GPU acceleration, but problem continues. 

Comment 72 by sits...@gmail.com, Apr 3 2016

vapse...:
Since you're not on OS X the issue you are seeing is different to this one (even if the symptoms may be similar). I'd recommend that you search for a bug that matches your problem but on Windows or that you file a new bug report if you can't find anything.
sits...: 
I already made bug report about my problem but someone thought that it is best to merge my issue https://bugs.chromium.org/p/chromium/issues/detail?id=591956 with this (https://bugs.chromium.org/p/chromium/issues/detail?id=594343) bug. I don't think that OS X and Windows problem is duplicate, but he/she (https://bugs.chromium.org/u/1084958462/) thought that it is.
Has this issue reappeared? I'm on Chrome 57.0.2987.133 (64-bit) on macOS Sierra and am seeing the same issue (completely grey page for pdfs) unless I turn off hardware acceleration.

Comment 75 by sits...@gmail.com, Apr 9 2017

jni.s...@gmail.com:
I'm on Chrome 57.0.2987.133 macOS 10.12.4 using a machine that saw the original issue. I don't see this problem on PDFs that originally made it happen so I would strongly suggest that you open a new issue for the problem you're seeing and post reproduction steps inside (could be linked to exact PDFs, hardware etc).
I've experienced similar symptoms on my Mid 2015 15-ince MacBook Pro for at least a year (since April 2016). The PDF viewer seems to stop working on all tabs simultaneously. The problem does not seem to be triggered by any PDF in particular, just by leaving PDF viewer tabs open for a long time (days to weeks). It happens pretty consistently and I have to restart Chrome to fix it.
I would recommend filing a new bug report and reference this one. Though the symptoms are similar, the cause may be different this time.

Sign in to add a comment