Fixing in-process-gpu on Windows

697 views
Skip to first unread message

Marshall Greenblatt

unread,
Aug 3, 2015, 5:31:54 PM8/3/15
to graphics-dev
Hi All,

I'm attempting to get --in-process-gpu working on Windows in my Content API-based application (Windows 8.1, Chromium master revision 12bfc336 (#338390)) [1]. I expect to run into multiple issues since this code path is not tested with Chrome on Windows due to the multi-DLL design disabling use of this flag [2].

Here's my first issue:

I'm currently hitting the NOTREACHED() in SamplerTypeFromTextureTarget [3]. I believe this is because the ResourceProvider::Resource does not have a |target| due to |is_software| being true for the associated TransferableResource [4]. Should the GLRenderer::DrawContentQuadNoAA code path be triggered when |is_software| is true? How should I go about further debugging this issue?

Thanks,
Marshall

[1] For the curious, the eventual goal is to implement a custom OutputSurface that renders into a GL/D3D texture provided by the embedder. The untested theory is that using in-process-gpu will provide better performance then disabling the GPU completely and using the software code path.


[3] Call stack for NOTREACHED:

  libcef.dll!logging::LogMessage::~LogMessage() Line 642 C++
  libcef.dll!cc::`anonymous namespace'::SamplerTypeFromTextureTarget(unsigned int target) Line 102 C++
  libcef.dll!cc::GLRenderer::DrawContentQuadNoAA(const cc::DirectRenderer::DrawingFrame * frame, const cc::ContentDrawQuadBase * quad, unsigned int resource_id, const gfx::QuadF * clip_region) Line 1879 C++
  libcef.dll!cc::GLRenderer::DrawContentQuad(const cc::DirectRenderer::DrawingFrame * frame, const cc::ContentDrawQuadBase * quad, unsigned int resource_id, const gfx::QuadF * clip_region) Line 1735 C++
  libcef.dll!cc::GLRenderer::DrawTileQuad(const cc::DirectRenderer::DrawingFrame * frame, const cc::TileDrawQuad * quad, const gfx::QuadF * clip_region) Line 1704 C++
  libcef.dll!cc::GLRenderer::DoDrawQuad(cc::DirectRenderer::DrawingFrame * frame, const cc::DrawQuad * quad, const gfx::QuadF * clip_region) Line 559 C++
  libcef.dll!cc::DirectRenderer::DrawRenderPass(cc::DirectRenderer::DrawingFrame * frame, const cc::RenderPass * render_pass) Line 477 C++
  libcef.dll!cc::DirectRenderer::DrawFrame(cc::ScopedPtrVector<cc::RenderPass> * render_passes_in_draw_order, float device_scale_factor, const gfx::Rect & device_viewport_rect, const gfx::Rect & device_clip_rect, bool disable_picture_quad_image_filtering) Line 235 C++
  libcef.dll!cc::Display::DrawAndSwap() Line 199 C++
  libcef.dll!cc::DisplayScheduler::DrawAndSwap() Line 104 C++
  libcef.dll!cc::DisplayScheduler::AttemptDrawAndSwap() Line 254 C++
  libcef.dll!cc::DisplayScheduler::OnBeginFrameDeadline() Line 270 C++

[4] Call stack for ResourceProvider::Resource creation:

  libcef.dll!cc::ResourceProvider::Resource::Resource(const gpu::Mailbox & bitmap_id, const gfx::Size & size, cc::ResourceProvider::Resource::Origin origin, unsigned int filter, int wrap_mode) Line 379 C++
> libcef.dll!cc::ResourceProvider::ReceiveFromChild(int child, const std::vector<cc::TransferableResource,std::allocator<cc::TransferableResource> > & resources) Line 1265 C++
  libcef.dll!cc::SurfaceAggregator::ValidateAndCalculateDamageRect(cc::SurfaceId surface_id) Line 443 C++
  libcef.dll!cc::SurfaceAggregator::ValidateAndCalculateDamageRect(cc::SurfaceId surface_id) Line 510 C++
  libcef.dll!cc::SurfaceAggregator::Aggregate(cc::SurfaceId surface_id) Line 536 C++
  libcef.dll!cc::Display::DrawAndSwap() Line 156 C++
  libcef.dll!cc::DisplayScheduler::DrawAndSwap() Line 104 C++
  libcef.dll!cc::DisplayScheduler::AttemptDrawAndSwap() Line 254 C++
  libcef.dll!cc::DisplayScheduler::OnBeginFrameDeadline() Line 270 C++

John Bauman

unread,
Aug 3, 2015, 5:51:59 PM8/3/15
to Marshall Greenblatt, graphics-dev
The issue here is that the renderer was unable to create a GPU context and fell back to software mode, while the browser process is using the GPU; this is unsupported and will cause the renderer contents not to be displayed onscreen. This is most likely caused by https://code.google.com/p/chromium/issues/detail?id=422638

Marshall Greenblatt

unread,
Aug 3, 2015, 6:11:05 PM8/3/15
to John Bauman, graphics-dev, ccam...@chromium.org
On Mon, Aug 3, 2015 at 5:51 PM, John Bauman <jba...@chromium.org> wrote:
The issue here is that the renderer was unable to create a GPU context and fell back to software mode, while the browser process is using the GPU; this is unsupported and will cause the renderer contents not to be displayed onscreen. This is most likely caused by https://code.google.com/p/chromium/issues/detail?id=422638

Thanks, adding --no-sandbox fixed the crash and --in-process-gpu now seems to work on Windows (with only limited testing so far).  I've also verified that in-process-gpu works on Linux (Ubuntu 14.04 64-bit) at the same Chromium revision but crashes on OS X (9.5) with the below call stack. It appears to crash while loading images (for example, the logo image on google.com) and seems related to http://crbug.com/506508 and http://crbug.com/488495.

0   Chromium Embedded Framework         0x000000010a4e5eff base::debug::StackTrace::StackTrace() + 47
1   Chromium Embedded Framework         0x000000010a4e5f53 base::debug::StackTrace::StackTrace() + 35
2   Chromium Embedded Framework         0x000000010a533973 logging::LogMessage::~LogMessage() + 67
3   Chromium Embedded Framework         0x000000010a532a03 logging::LogMessage::~LogMessage() + 35
4   Chromium Embedded Framework         0x000000010a55d4c2 base::internal::WeakReference::Flag::IsValid() const + 258
5   Chromium Embedded Framework         0x000000010a55d7ec base::internal::WeakReference::is_valid() const + 76
6   Chromium Embedded Framework         0x0000000110fd809a base::WeakPtr<content::GpuCommandBufferStub>::get() const + 42
7   Chromium Embedded Framework         0x0000000110fc2290 base::WeakPtr<content::GpuCommandBufferStub>::operator->() const + 80
8   Chromium Embedded Framework         0x0000000110fc0c17 content::ImageTransportHelper::SendAcceleratedSurfaceBuffersSwapped(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) + 295
9   Chromium Embedded Framework         0x0000000110fd60d9 content::ImageTransportSurfaceFBO::SendSwapBuffers(unsigned long long, gfx::Size, float) + 505
10  Chromium Embedded Framework         0x0000000110fcb9d2 content::CALayerStorageProvider::UnblockBrowserIfNeeded() + 162
11  Chromium Embedded Framework         0x0000000110fc7e83 content::CALayerStorageProvider::LayerUnblockBrowserIfNeeded() + 35
12  Chromium Embedded Framework         0x0000000110fc6951 -[ImageTransportCAOpenGLLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:] + 225
13  QuartzCore                          0x00007fff8a901286 CAOpenGLLayerDraw(CAOpenGLLayer*, double, CVTimeStamp const*, unsigned int) + 733
14  QuartzCore                          0x00007fff8a903827 CAOpenGLLayer_timer_callback(__CFRunLoopTimer*, void*) + 888
Reply all
Reply to author
Forward
0 new messages