Method and system for deferred command issuing in a computer system
A method and system are disclosed for employing deferred command issuing in a computer system with multiple peripheral processors operating with a peripheral device driver embedded in a multi-threaded central processor. After issuing a first command with a first event tag by the peripheral device driver, a second command is generated for a first peripheral processor by the peripheral device driver following the issuing of the first command. The second command is stored awaiting for the first event tag being returned, and the second command is issued when the first event tag is returned if the first and second commands need to be synchronized.
Latest Patents:
This application claims the benefits of U.S. Patent Application Ser. No. 60/727,668, which was filed on Oct. 18, 2005 and entitled “Smart CPU Sync Technology for MultiGPU Solution.”
CROSS REFERENCEThis application also relates to U.S. patent application entitled “TRANSPARENT MULTI-BUFFERING IN MULTI-GPU GRAPHICS SUBSYSTEM”, U.S. patent application entitled “EVENT MEMORY ASSISTED SYNCHRONIZATION IN MULTI-GPU GRAPHICS SUBSYSTEM” and U.S. patent application entitled “METHOD AND SYSTEM FOR SYNCHRONIZING PARALLEL ENGINES IN A GRAPHICS PROCESSING UNIT”, all of which are commonly filed on the same day, and which are incorporated by reference in their entirety.
BACKGROUNDThe present invention relates generally to the synchronization between a computer's central processing units (CPUs) and peripheral processing units, and, more particularly, to the timing of command issuing.
In a modern computer system, each peripheral functional module, such as audio or video, has its own dedicated processing subsystem, and the operations of these subsystems typically require direct control by computer's central processing unit (CPU). Besides, communication and synchronization among components of the subsystems are typically achieved through hardware connections. In an advanced graphics processing subsystem with two or more graphics processing units (GPUs), for instance, a CPU has to frequently evaluate the state of GPUs, and a next rendering command can only be issued when a previous or current command is finished. In other cases, when CPU(s) is calculating something for GPUs using multi-threaded technology, the GPUs may have to wait for the CPU to complete the calculation before executing commands that need the result from CPU(s). When one GPU requests data from another GPU, the transfer must be made through a direct hardware link or the bus, and controlled by the CPU, which then has to wait for the data transfer to complete before executing subsequent commands. Either CPU waiting for GPU or vice versa, the wait time is a waste and lowers the computer's overall performance.
It is therefore desirable for a computer system to be able to detach hard waiting as much as possible from CPU's operations.
SUMMARYIn view of the foregoing, this invention provides a method and system to remove some of the wait time by the CPU, as well as some idle time in peripheral processing units. In other words, it increases parallelism between processors.
A method and system are disclosed for employing deferred commands issuing in a computer system with multiple peripheral processors operating with a peripheral device driver embedded in one or more central processor(s). After issuing a first command with a first event tag by the peripheral device driver, a second command is generated for a first peripheral processor by the peripheral device driver following the issuing of the first command. The second command is stored awaiting for the first event tag to be returned, and the second command is issued when the first event tag is returned if the first and second commands need to be synchronized.
The construction and method of operation of the invention, however, together with additional objects and advantages thereof will be best understood from the following description of specific embodiments when read in connection with the accompanying drawings.
BRIEF DESCRIPTION OF THE DRAWINGS
Detailed information with regard to the operation of the GPU in the computer system is further described in U.S. patent application entitled “TRANSPARENT MULTI-BUFFERING IN MULTI-GPU GRAPHICS SUBSYSTEM”, U.S. patent application entitled “EVENT MEMORY ASSISTED SYNCHRONIZATION IN MULTI-GPU GRAPHICS SUBSYSTEM” and U.S. patent application entitled “METHOD AND SYSTEM FOR SYNCHRONIZING PARALLEL ENGINES IN A GRAPHICS PROCESSING UNIT”, all of which are commonly filed on the same day, and which are incorporated by reference in their entirety.
As an embodiment of present invention,
The computer system 200 also employs a command buffer 230, which stores immediate commands sent by the driver 210. The command buffer 230 can be just a memory space in a main memory 290 or another memory located anywhere, and can be dynamically allocated by the driver 210. With the processing power of the central processor(s) 220, the driver 210 directs command buffering in and subsequently issuing from the command buffer 230, as well as synchronization among special processors 240 and 250 and the central processor(s) 220. The special processors can be processors dedicated for graphics operations, known as graphics processing units (GPUs).
Within each command block, driver 320 executes certain subroutines, such as generating a new command and an associated event-tag if needed, checking on returned event-tags, buffering the new command and issuing a buffered command or directly issuing the new command if there is no outstanding event-tag. These subroutines can be executed in various sequences.
Referring to
On the other hand, if there is no returned event-tag in the buffer, driver 320 then checks for any outstanding event-tag in step 460B. In case there is an outstanding event-tag that the current command issue will depend on or is related to, driver 320 then buffers the current command (step 480B). In case there is no outstanding related event-tag, driver 320 directly issues the current command. Note that in all cases of command buffering or issuing, the associated event-tag if present, is also buffered or issued along with the command.
In both cases as shown in
Contrasting to
To quantify time saved by the deferred-command-issuing process employed, if it is assumed that the CPU command generating time is ‘t’, and the execution time of GPU1 and GPU2 are T1 and T2 (assume T1<T2, for easing the evaluation), respectively, as shown in
A comparison between
This invention provides many different embodiments, or examples, for implementing different features of the invention. Specific examples of components and methods are described to help clarify the disclosure. These are, of course, merely examples and are not intended to limit the disclosure from that described in the claims.
Claims
1. A method for deferred command issuing in a computer system with one or multi special purpose operating with a device driver running on one or multiple central processors, the method comprising:
- issuing a first command with a first event tag by the peripheral device driver;
- generating a second command for a first peripheral processor by the peripheral device driver following the issuing of the first command;
- storing the second command awaiting for the first event tag being returned;
- and issuing the second command when the first event tag is returned.
2. The method of claim 1, wherein storing the second command further includes storing the second command in a buffer associated with the first processor.
3. The method of claim 2, further comprising:
- generating a third command for a second processor; and
- storing the third command in a buffer associated there with.
4. The method of claim 3, wherein the buffers associated with the first and second processors are different.
5. The method of claim 1, further comprising checking whether the generated second command relates to the first command requiring the first event tag to return before the second command is being issued.
6. The method of claim 5, wherein checking further includes:
- checking whether the first event tag has returned; and
- checking whether the first event tag is outstanding if it is not yet returned and if it relates to the second command.
7. The method of claim 6, wherein checking whether the first event tag has returned is performed after the generating the second command.
8. The method of claim 6, wherein checking whether the first event tag has returned is performed prior to the generating the second command.
9. A method for deferred command issuing in a computer system with multiple graphics processors operating with a graphics driver embedded in a multi-threaded central processor, the method comprising:
- issuing a first command with a first event tag by the graphics driver;
- generating a second command to a first processor of the computer system by the graphics driver following the issuing of the first command;
- storing the second command awaiting for the first event tag is returned; and
- issuing the second command when the first event tag is returned.
10. The method of claim 9, wherein storing the second command further includes storing the second command in a buffer associated with the first processor.
11. The method of claim 10, further comprising:
- generating a third command to a second processor; and
- storing the third command in a buffer associated there with.
12. The method of claim 11, wherein the buffers associated with the first and second processors are different.
13. The method of claim 9, further comprises checking whether the generated second command needs to wait for the first event tag to return.
14. The method of claim 13, wherein the checking further includes:
- checking whether the first event tag has returned; and
- checking whether the first event tag is outstanding if it has not returned.
15. The method of claim 14, wherein checking whether the first event tag has returned is performed after the generating the second command.
16. The method of claim 14, wherein checking whether the first event tag has returned is performed prior to the generating the second command.
17. A system for supporting deferred command issuing in an advanced computer system, the system comprising:
- a multi-threaded central processing unit (CPU);
- a graphics subsystem with multiple graphics processing units;
- at least one command buffer for storing commands and associated event-tags; and
- a graphics driver embedded in the CPU for generating commands to be stored in the command buffers, assigning event-tags when synchronizations are needed, controlling command issuing and monitoring event-tag returns.
Type: Application
Filed: Oct 17, 2006
Publication Date: Apr 19, 2007
Applicant:
Inventor: Guofeng Zhang (Shanghai)
Application Number: 11/581,975
International Classification: G06F 3/00 (20060101);