A multi-GPU rendering system, method, device and storage medium for images

By mounting multiple GPUs on the rendering node and dividing rendering tasks on the CPU, the problem of low throughput of a stand-alone GPU rendering engine is solved, and efficient processing and high-quality image generation of large-scale rendering tasks are achieved.

CN117649474BActive Publication Date: 2025-04-29INST OF WAR STUDIES ACAD OF MILITARY SCI OF THE CHINESE PEOPLES LIBERATION ARMY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311669899.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-06
Publication Date
2025-04-29
Estimated Expiration
2043-12-06

AI Technical Summary

Technical Problem

The existing stand-alone GPU rendering engines have low throughput when handling large-scale, high-resolution image rendering tasks and cannot meet the training needs of intelligent learning algorithms.

Method used

Using a multi-GPU rendering system, by mounting multiple GPUs on each rendering node and using CPU to divide the rendering task into multiple subtasks and execute on multiple GPUs respectively, thereby improving the throughput and execution efficiency of rendering tasks.

Benefits of technology

Through the multi-GPU rendering system, the throughput and execution efficiency of large-scale rendering tasks are significantly improved, and high-quality image samples can be quickly generated to meet the training needs of intelligent learning algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117649474B_ABST
    Figure CN117649474B_ABST
Patent Text Reader

Abstract

The present application relates to a multi-GPU rendering system, method, device and storage medium for images, which are used to improve the throughput and execution efficiency of large-scale rendering tasks. The system includes several rendering nodes, each rendering node includes at least one CPU, each CPU is equipped with several GPUs, and inside the rendering node, the CPU and each GPU are interconnected through a communication bus, and the CPUs between the rendering nodes are interconnected through a communication network; wherein: the CPU is used to receive the rendering task assigned to the rendering node where it is located, divide the rendering task into several rendering subtasks, create a rendering process for each rendering subtask, and in each rendering process, generate rendering instructions based on the rendering subtask and submit them to the GPU of the rendering node where it is located; after receiving the rendering result returned by the GPU, copy the rendering result; and after all rendering subtasks are executed, synchronize the rendering results of each rendering process; the GPU is used to execute the received rendering instruction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a multi-GPU rendering system, method, device and storage medium for images. Background Art

[0002] In recent years, artificial intelligence such as machine learning, reinforcement learning and transfer learning has developed rapidly. These intelligent algorithms usually require a large number of learning samples and a large number of repeated experiments during training. Experiments in the real world have disadvantages such as high cost, non-reproducibility, and high risk. Therefore, using computer simulation technology to construct a detailed and realistic virtual environment, and then provide learning samples and training environments for intelligent algorithms such as reinforcement learning, has become a current research hotspot. In particular, related intelligent algorithms in the fields of image recognition and robot control require a large number of realistic image samples. How to quickly render and generate high-quality images is one of the challenges of constructing a virtual training environment.

[0003] The current mainstream rendering engine operating environment is mainly based on a single machine. When running on a single machine, the rendering capabilities of a single GPU are very limited. When faced with large-scale rendering tasks (such as multiple optical sensors needing to image simultaneously), the throughput is low, and it is impossible to quickly render and generate large-scale, high-resolution image samples, nor can it meet the training requirements of intelligent learning algorithms. Summary of the invention

[0004] Based on this, it is necessary to provide a multi-GPU rendering method, device and storage medium for images that can improve the throughput and execution efficiency of large-scale rendering tasks in response to the above technical problems.

[0005] A multi-GPU rendering system for images, the system comprising a plurality of rendering nodes, each rendering node comprising at least one central processing unit (CPU), each CPU carrying a plurality of graphics processing units (GPUs), within the rendering node, the CPU and each GPU are interconnected via a communication bus, and the CPUs between the rendering nodes are interconnected via a communication network; wherein:

[0006] The CPU is configured to receive a rendering task assigned to the rendering node where the CPU is located, divide the rendering task into a plurality of rendering subtasks, create a rendering process for each rendering subtask, generate rendering instructions based on the rendering subtask in each rendering process, and submit the rendering instructions to the GPU of the rendering node where the CPU is located; copy the rendering result after receiving the rendering result returned by the GPU; and synchronize the rendering results of each rendering process after all rendering subtasks are executed;

[0007] The GPU is used to execute the received rendering instructions.

[0008] In one of the embodiments, the CPU is further used to establish, for each rendering process, a mapping relationship between the rendering process and the GPU, wherein one GPU corresponds to at least one rendering process.

[0009] In one of the embodiments, the CPU is specifically configured to establish a mapping relationship between a rendering process and a GPU according to the number of GPUs included in the rendering node where the CPU is located and the logical number of the rendering process.

[0010] In one of the embodiments, the CPU is specifically used to determine the GPU identifier corresponding to the rendering process according to the number of GPUs included in the rendering node where the CPU is located and the logical number of the rendering process; for each rendering process, a mapping relationship between the rendering process and its corresponding GPU identifier is established.

[0011] In one of the embodiments, the CPU is specifically used to determine, for each rendering process, a GPU identifier corresponding to the rendering process according to the following formula: Index = (p / m)% GpuCount, wherein Index represents the GPU identifier; m represents the number of rendering nodes; p represents the logical number of the rendering process; and GpuCount represents the number of GPUs contained in a single rendering node.

[0012] A multi-GPU rendering method for images, the method is applied to the above system, the method comprising:

[0013] The CPU node receives a rendering task, and divides the rendering task into a plurality of rendering subtasks;

[0014] In each rendering process, generating rendering instructions for the rendering subtask;

[0015] Submitting the rendering instructions to each GPU, and the GPU executes the received rendering instructions to obtain a rendering result;

[0016] After receiving the rendering result returned by the GPU, the rendering results of each rendering process are synchronized.

[0017] In one of the embodiments, before submitting the rendering instructions to each GPU, the method further includes:

[0018] For each rendering process, a mapping relationship between the rendering process and the GPU is established, wherein one GPU corresponds to at least one rendering process;

[0019] Submitting the rendering instructions to each GPU specifically includes:

[0020] For each rendering process, the rendering instruction is submitted to the GPU corresponding to the rendering process according to the mapping relationship.

[0021] In one embodiment, for each rendering process, a mapping relationship between the rendering process and the GPU is established, specifically including:

[0022] For each rendering process, determine the GPU identifier corresponding to the rendering process according to the number of GPUs included in the rendering node where the rendering process is running and the logical number of the rendering process;

[0023] A mapping relationship between the rendering process and its corresponding GPU identifier is established.

[0024] A computing device includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described in any one of the above embodiments when executing the computer program.

[0025] A computer-readable storage medium stores a computer program, which implements the steps of the method described in any of the above embodiments when executed by a processor.

[0026] The above-mentioned multi-GPU rendering system, method, device and storage medium for pictures, the system is composed of a plurality of rendering nodes, the CPU in a single rendering node can be equipped with multiple GPUs, in each rendering node, the rendering task is first divided into tasks, after the division is completed, corresponding rendering processes are created for the divided rendering subtasks, each rendering process is executed according to the rendering process of a single node and a single GPU, because the system has multiple rendering nodes, each rendering node contains multiple GPU resources, therefore, the throughput of large-scale rendering tasks will be improved, and because the rendering tasks executed on a single GPU will be reduced, the execution efficiency of large-scale rendering tasks will also be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 A schematic diagram of the structure of a multi-GPU rendering system for images in one embodiment;

[0028] Figure 2 A schematic diagram of an implementation process of a multi-GPU rendering system for images processing large-scale image tasks in one embodiment;

[0029] Figure 3 A schematic diagram of a process of a single CPU and a single GPU performing a rendering subtask in one embodiment;

[0030] Figure 4 A schematic diagram of a process for establishing a mapping relationship between a rendering process and a GPU in another embodiment;

[0031] Figure 5 Schematic diagram of the mapping relationship between the rendering process and the GPU when the parallelism is 2n in one embodiment

[0032] Figure 6 is a schematic diagram of a process of a multi-GPU rendering method for an image in one embodiment;

[0033] Figure 7 FIG. 4 is a diagram showing the internal structure of a computing device in one embodiment. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0035] When using a rendering engine to build a virtual training environment for intelligent algorithms, especially when facing large-scale rendering tasks, the rendering capability of a single GPU cannot quickly render and generate large-scale high-resolution image samples. Therefore, an embodiment of the present invention proposes a multi-GPU rendering system for images, such as Figure 1 As shown, it is a schematic diagram of the structure of a multi-GPU rendering system for images provided by an embodiment of the present invention. The multi-GPU rendering system for images provided by an embodiment of the present invention comprises a plurality of rendering nodes, each rendering node comprises at least one CPU (central processing unit), each CPU can carry multiple GPUs (graphics processing units), the CPUs and GPUs inside the rendering nodes are interconnected through a communication bus inside the node, and the CPUs between the rendering nodes are interconnected through a high-speed communication network (such as an InfiniBand switch).

[0036] In specific implementation, inside each rendering node, the CPU is used to receive the rendering tasks assigned to the rendering node where it is located, divide the rendering tasks into several rendering subtasks, create a rendering process for each rendering subtask, and within each rendering process, generate rendering instructions based on the rendering subtasks and submit them to the GPU of the rendering node where it is located, and the GPU executes the received rendering instructions; after receiving the rendering results returned by the GPU, the rendering results are copied; after all rendering subtasks are executed, the rendering results of each rendering process are synchronized.

[0037] like Figure 2 As shown in FIG. 1 , it is a schematic diagram of the implementation process of the multi-GPU rendering system for images provided by an embodiment of the present invention for processing large-scale image tasks. In each rendering node, the multi-GPU rendering system for images first divides the rendering task by the CPU to obtain a number of rendering subtasks, and creates a rendering process for each rendering subtask. Each rendering process is assigned to a corresponding GPU for execution. Figure 3As shown in Figure 1, it is a flowchart of a single CPU and a single GPU executing a rendering subtask. The rendering subtask consists of a series of graphics rendering instructions, which are assembled and generated by a specific application on the CPU side through a specific graphics API. After the assembly is completed, it is submitted to the corresponding GPU side for execution through the graphics API. After the execution is completed, the rendering result is copied from the GPU side to the CPU side memory.

[0038] In one embodiment, the CPU in each rendering node is used to establish a mapping relationship between each rendering process and the GPU, wherein one GPU corresponds to at least one rendering process. In a specific implementation, the CPU can establish a mapping relationship between the rendering process and the GPU according to the number of GPUs contained in the rendering node where it is located and the logical number of the rendering process. Specifically, the CPU can be used to determine the GPU identifier corresponding to each rendering process according to the number of GPUs contained in the rendering node where it is located and the logical number of the rendering process; for each rendering process, a mapping relationship is established between the rendering process and its corresponding GPU identifier. Figure 4 As shown, it is a schematic diagram of the process of establishing a mapping relationship between the rendering process and the GPU. It should be noted that: Figure 4 The logical process shown is the rendering process in the embodiment of the present invention.

[0039] In one implementation, the CPU may determine the GPU identifier corresponding to each rendering process according to the following formula: Index = (p / m)% GpuCount, where Index represents the GPU identifier; m represents the number of rendering nodes; p is the logical number of the rendering process; and GpuCount represents the number of GPUs contained in a single rendering node.

[0040] by Figure 1 Take the case where the CPU on each rendering node is equipped with 2 GPUs as an example. At this time, each rendering process can obtain GpuCount = 2 after enumerating the GPU devices; assuming that all nodes are homogeneous, when the degree of parallelism is 2n, n rendering nodes are used to perform large-scale rendering tasks. At this time, 2 rendering processes are running on each rendering node. The physical device number Index corresponding to the rendering process p = (p / n)% 2. In specific implementation, the rendering processes are uniformly numbered and uniformly allocated. Generally speaking, the numbering rules for the rendering processes of parallel programs are as follows. Assuming that 2n processes are running on n nodes, (0, n) are on the first node, 1 and n+1 are on the second node, and so on. Figure 5 As shown, it is a schematic diagram of the mapping relationship between the rendering process and the GPU when the parallelism is 2n in an embodiment of the present invention.

[0041] The GPU rendering system for images provided by the embodiment of the present invention has multiple rendering nodes, each of which has multiple GPU resources. Therefore, the rendering tasks performed on a single GPU will be reduced. Therefore, the rendering scalability of the entire system will be improved, and the execution efficiency of large-scale rendering tasks will also be improved.

[0042] Based on the same technical concept, such as Figure 6 As shown, the embodiment of the present invention also provides a multi-GPU rendering method for images, which is applied to Figure 1 The following steps are taken as an example to illustrate the rendering node in the system:

[0043] S61. The CPU node receives a rendering task and divides the rendering task into a plurality of rendering subtasks.

[0044] S62: In each rendering process, generate rendering instructions for the rendering subtask.

[0045] S63: Submit rendering instructions to each GPU, and the GPU executes the received rendering instructions to obtain a rendering result.

[0046] In specific implementation, before each GPU submits a rendering instruction, it also includes:

[0047] For each rendering process, a mapping relationship between the rendering process and the GPU is established, wherein one GPU corresponds to at least one rendering process; accordingly, in this step, the rendering instructions can be submitted to each GPU in the following manner: for each rendering process, according to the established mapping relationship, the rendering instructions are submitted to the GPU corresponding to each rendering process.

[0048] Specifically, for each rendering process, a mapping relationship between the rendering process and the GPU is established, specifically including:

[0049] For each rendering process, the GPU identifier corresponding to the rendering process is determined according to the number of GPUs included in the rendering node where the rendering process is running and the logical number of the rendering process; and a mapping relationship between the rendering process and its corresponding GPU identifier is established. In this embodiment, for each rendering process, the CPU can determine the GPU identifier corresponding to the rendering process according to the following formula: Index = (p / m)% GpuCount, where Index represents the GPU identifier; m represents the number of rendering nodes; p is the rendering process number; and GpuCount represents the number of GPUs included in a single rendering node.

[0050] S64. After receiving the rendering result returned by the GPU, synchronize the rendering results of each rendering process.

[0051] It should be understood that although Figure 6 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 6 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0052] For the specific definition of the multi-GPU rendering device for pictures, please refer to the definition of the multi-GPU rendering method for pictures above, which will not be repeated here. Each module in the above-mentioned multi-GPU rendering device for pictures can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0053] In one embodiment, a computing device is provided. The computing device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a multi-GPU rendering method for images is implemented.

[0054] In one embodiment, a computer device is provided, which may be a terminal. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a multi-GPU rendering method for images is implemented. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball, or touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0055] Those skilled in the art will appreciate that the structure of the above-mentioned computer device is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0056] In one embodiment, a computing device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the method described in any of the above embodiments when executing the computer program.

[0057] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in any of the above embodiments are implemented.

[0058] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0059] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0060] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A multi-GPU rendering system for images, characterized in that: The system includes a plurality of rendering nodes, each of which includes at least one central processing unit (CPU), and each CPU carries a plurality of graphics processing units (GPU). Inside the rendering node, the CPU and each GPU are interconnected via a communication bus, and the CPUs between the rendering nodes are interconnected via a communication network; wherein: The CPU is used to receive a rendering task assigned to the rendering node where the CPU is located, divide the rendering task into a plurality of rendering subtasks, create a rendering process for each rendering subtask, generate rendering instructions based on the rendering subtask in each rendering process and submit them to the GPU of the rendering node where the CPU is located; copy the rendering result after receiving the rendering result returned by the GPU; and synchronize the rendering results of each rendering process after all rendering subtasks are executed; the CPU is also used to establish a mapping relationship between the rendering process and the GPU for each rendering process, wherein one GPU corresponds to at least one rendering process; the CPU is specifically used to establish a mapping relationship between the rendering process and the GPU according to the number of GPUs included in the rendering node where the CPU is located and the logical number of the rendering process; the CPU is specifically used to establish a mapping relationship between the rendering process and the GPU according to the number of GPUs included in the rendering node where the CPU is located The number of GPUs contained in the node and the logical number of the rendering process are used to determine the GPU identifier corresponding to the rendering process; for each rendering process, a mapping relationship between the rendering process and its corresponding GPU identifier is established; the CPU is specifically used to determine the GPU identifier corresponding to each rendering process according to the following formula: Index = (p / m)% GpuCount, where Index represents the GPU identifier; m represents the number of rendering nodes; p is the logical number of the rendering process; GpuCount represents the number of GPUs contained in a single rendering node; the rendering processes are uniformly numbered and uniformly allocated, and the numbering rules of the parallel program rendering processes are as follows: 2n processes are run on n nodes, then (0, n) are on the first node, and No. 1 and No. n+1 are on the second node, until all rendering processes are allocated; The GPU is used to execute the received rendering instructions.

2. A multi-GPU rendering method for images, characterized in that: The method is applied to the system according to claim 1; the method comprises: The CPU node receives a rendering task, and divides the rendering task into a plurality of rendering subtasks; In each rendering process, generating rendering instructions for the rendering subtask; For each rendering process, a mapping relationship between the rendering process and the GPU is established, wherein one GPU corresponds to at least one rendering process, specifically including: for each rendering process, according to the number of GPUs included in the rendering node where the rendering process is running and the logical number of the rendering process, determining the GPU identifier corresponding to the rendering process; establishing a mapping relationship between the rendering process and its corresponding GPU identifier, including: according to the number of GPUs included in the rendering node where the rendering process is located and the logical number of the rendering process, determining the GPU identifier corresponding to the rendering process; for each rendering process, a mapping relationship between the rendering process and its corresponding GPU identifier is established; wherein, for each rendering process, the GPU identifier corresponding to the rendering process is determined according to the following formula: Index = (p / m)% GpuCount, wherein Index represents the GPU identifier; m represents the number of rendering nodes; p is the logical number of the rendering process; GpuCount represents the number of GPUs included in a single rendering node; the rendering processes are uniformly numbered and uniformly allocated, and the numbering rule of the parallel program rendering processes is as follows: if 2n processes are run on n nodes, then (0, n) are on the first node, and 1 and n+1 are on the second node, until all rendering processes are allocated; For each rendering process, according to the mapping relationship, the rendering instruction is submitted to the GPU corresponding to the rendering process, and the GPU executes the received rendering instruction to obtain a rendering result; After receiving the rendering result returned by the GPU, the rendering results of each rendering process are synchronized.

3. A computing device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to claim 2 are implemented.

4. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to claim 2 are implemented.

Citation Information

Patent Citations

  • Real-time ray tracing and rendering method based on GPU (Graphics Processing Unit) aggregate

    CN103049927A

  • Method and device for running high-performance GPU application and computer storage medium

    CN112037117A