Chromium GPU process Startup Process

Source: Internet
Author: User

Reprinted please indicate the source: http://www.cnblogs.com/fangkm/p/3960327.html

Hardware rendering depends on the GPU of the computer. There are many GPU types. It is compatible with so many types of hardware, and stability is a big problem. Although chromium maintains a GPU blacklist list internally, it limits which rendering features cannot be rendered on which GPUs, but it is not enough to solve the stability problem during GPU usage. In Chromium's multi-process architecture, unstable and uncontrollable factors generally adopt independent process rendering to ensure the stability of the main process, such as the render process and plug-in process, the same is true for GPUs. They run in the form of independent processes.

When the main process is started, it will call the initialize Initialization Method of gpudatamanagerimpl. In the initialize method, the preset GPU blacklist list will be loaded, the list information is located in the "src \ GPU \ config \ software_rendering_list_json.cc" file, which is described in JSON format. It is accessed through the ksoftwarerenderinglistjson variable in the program. By analyzing the GPU blacklist list, you can obtain the rendering features that the current GPU does not know in the current system. When initializing the rendering environment, the disabled rendering feature maintained by gpudatamanagerimpl is used to check whether the feature is disabled, so as to decide whether to adopt hardware rendering or software rendering. In addition, when the GPU process crashes more than three times, all rendering support for the current GPU is disabled in gpudatamanagerimpl, that is, all rendering features are added to the current GPU blacklist list, the subsequent rendering processes follow the software rendering logic. For more information about the logic, see the analysis method of gpuprocesshost.

The following describes the GPU process startup process:

Like creating a render process, the main process first creates a server that creates a named pipeline (see the createchannel method of childprocesshostimpl) and then starts the GPU process, pass the created pipeline name to the command line parameter (see the launchgpuprocess method of gpuprocesshost). After the GPU sub-process is started, the pipeline name is retrieved from the command line parameter, create the client of the MPs Queue (see the init method of childthread), and connect the MPs queue.

After establishing a connection with the GPU sub-process, the main process sends the gpumsg_initialize message to the GPU process. After receiving the message, the GPU process returns a gpuhostmsg_initialized message with the GPU information collected, in this case, the GPU creates the gpuchannelmanager object to manage the list of IPC connections dedicated for GPU rendering. When the main process initializes the hardware rendering context (see the initialize method of webgraphicscontext3dcommandbufferimpl, usually in the main thread), it will send the gpumsg_establishchannel message to the GPU sub-process (sent in the IO thread ), then the wait occupies the main thread. After receiving the message, the GPU process creates a server for rendering (see onestablishchannel processing of gpuchannelmanager ), after the creation is complete, a gpuhostmsg_channelestablished message will be sent to the main process, passing the name of the newly created rendering pipeline to the previous one. After the main process receives the reply message (processing in the IO thread ), the original wait signal is credited to the main thread for further processing, so as to complete the initialization process of the hardware rendering communication pipeline.

The render process also needs to use GPU for hardware rendering. the creation process of the render process GPU pipeline is delegated to the main process. When the render process initializes the 3D rendering environment, it sends the gpuhostmsg_establishgpuchannel synchronization message to the main process, then wait for the response message to be returned. The processing process after the main process receives the gpuhostmsg_establishgpuchannel message is the process of starting the GPU process as described above. The difference is that when the GPU process returns the name of the created IPC pipeline, this name is returned to the render process through the gpuhostmsg_establishgpuchannel reply message. The render process creates the corresponding IPC pipeline client.

 

Chromium GPU process Startup Process

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.