A graphics processor debugging method, device, equipment and storage medium
By obtaining the image frame index and rendering commands of the graphics processor to generate initial debugging commands, and adding parameters based on the running results, the debugging scope is narrowed, which solves the problem that existing tools cannot debug accurately and improves the debugging efficiency and accuracy of graphics processor rendering programs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-03-27
AI Technical Summary
Existing graphics processor debugging tools cannot provide debugging functions for graphics processor-specific programs, resulting in inaccurate debugging results, performance loss, and incompatibility. They cannot fully reflect the actual running conditions and affect program performance.
By detecting when the graphics processor displays abnormally rendered objects during operation, the image frame index and rendering command are obtained, an initial debugging command is generated, and debugging parameters are added based on the initial running results to generate an updated debugging command, gradually narrowing the debugging scope to improve debugging efficiency and accuracy.
It enables efficient and accurate debugging based on real graphics processor hardware, helping developers quickly locate the cause of abnormally rendered objects and reduce hardware load and performance impact.
Smart Images

Figure CN121116733B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and particularly relates to a graphics processor debugging method and device, equipment and storage medium. BACKGROUND
[0002] As a kind of high-performance computing device, graphics processor (Graphics Processing Unit, GPU) has been widely used in graphics rendering, machine learning, scientific computing and other fields. With the continuous expansion of the application range of graphics processor, the reason of graphics processor program exception is more and more complex, and it is particularly important to locate the exception reason in graphics processor program.
[0003] In the prior art, graphics processor program is debugged by means of conventional debugging tools (such as GNU Debugger, Visual Studio Debugger, etc.), graphics processor program debugging tools (such as CUDA Debugger, Advanced Micro Devices GPU Debugger, etc.), graphics processor performance analysis tools (such as Visual Profiler, Radeon GPU Analyzer, etc.) and graphics processor simulator, and the exception reason is determined according to the debugging result.
[0004] However, the conventional debugging tools cannot provide the debugging function of graphics processor specific program, such as checking GPU memory, thread synchronization, etc., which will limit the debugging result when debugging complex graphics processor program; graphics processor program debugging tools are prone to inaccurate debugging results, performance loss and other problems, and there is no compatibility between debugging tools of different manufacturers, so that developers need to learn and master multiple different debugging tools; graphics processor performance analysis tools cannot fully reflect the real running condition of graphics processor, and also have the problem of performance loss, which may affect the actual performance of program running; the simulation result of graphics processor simulator may be different from the real running condition of graphics processor, and cannot completely simulate the hardware characteristics of graphics processor, so that the developers cannot test some specific functions of graphics processor. SUMMARY
[0005] The present application provides a graphics processor debugging method, device, equipment and storage medium, which can improve the debugging efficiency of graphics processor rendering program and the accuracy of debugging result.
[0006] According to an aspect of the present application, a graphics processor debugging method is provided, the method comprising:
[0007] detecting that an abnormal rendering object is displayed during running of the graphics processor, and acquiring an image frame index and a rendering command corresponding to the abnormal rendering object;
[0008] generating an initial debugging command corresponding to the abnormal rendering object according to the image frame index and the rendering command, and running the initial debugging command by the graphics processor;
[0009] The initial debugging command comprises a debugging type corresponding to the abnormal rendering object, a target image frame index, and a debugging index corresponding to the debugging type.
[0010] acquiring an initial running result of the initial debugging command by the graphics processor, adding at least one debugging parameter in the initial debugging command according to the initial running result to obtain an updated debugging command, and running the updated debugging command by the graphics processor.
[0011] According to another aspect of the present application, a graphics processor debugging device is provided, which comprises:
[0012] an object detection module, configured to detect that an abnormal rendering object is displayed during running of the graphics processor, and acquire an image frame index and a rendering command corresponding to the abnormal rendering object;
[0013] an initial command generation module, configured to generate an initial debugging command corresponding to the abnormal rendering object according to the image frame index and the rendering command, and run the initial debugging command by the graphics processor;
[0014] The initial debugging command comprises a debugging type corresponding to the abnormal rendering object, a target image frame index, and a debugging index corresponding to the debugging type.
[0015] an updated command generation module, configured to acquire an initial running result of the initial debugging command by the graphics processor, add at least one debugging parameter in the initial debugging command according to the initial running result to obtain an updated debugging command, and run the updated debugging command by the graphics processor.
[0016] According to another aspect of the present application, an electronic device is provided, which comprises:
[0017] at least one processor; and
[0018] a memory connected with the at least one processor in communication; wherein,
[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the graphics processor debugging method according to any one of the embodiments of the present application.
[0020] According to another aspect of the present application, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the graphic processor debugging method according to any of the embodiments of the present application when executed.
[0021] The technical solution provided by the present application can obtain the image frame index and the rendering command corresponding to the abnormal rendering object when the graphic processor displays the abnormal rendering object during running, generate the initial debugging command corresponding to the abnormal rendering object according to the image frame index and the rendering command, run the initial debugging command through the graphic processor, obtain the initial running result of the initial debugging command by the graphic processor, add at least one debugging parameter in the initial debugging command according to the initial running result to obtain the updated debugging command, and run the updated debugging command through the graphic processor. Thus, the rendering program can be debugged based on the real graphic processor hardware, more accurate debugging information can be obtained, the developer can locate the abnormal reason of the abnormal rendering object according to the debugging information, and thus the debugging efficiency of the graphic processor rendering program is improved.
[0022] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the present application, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0024] Figure 1 is a flow chart of a graphic processor debugging method according to an embodiment of the present application;
[0025] Figure 2 is a flow chart of another graphic processor debugging method according to an embodiment of the present application;
[0026] Figure 3 is a flow chart of another graphic processor debugging method according to an embodiment of the present application;
[0027] Figure 4 is a structural schematic diagram of a graphic processor debugging device according to an embodiment of the present application;
[0028] Figure 5It is a structure schematic diagram of an electronic device for implementing the graphic processor debugging method of the fifth embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the persons skilled in the art better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by the persons skilled in the art without creative labor should belong to the protection scope of the present application.
[0030] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0031] Figure 1 A flowchart of a graphic processor debugging method provided for the first embodiment of the present application, the present embodiment can be applicable to the case of debugging a graphic processor rendering program, and the method can be executed by a graphic processor debugging device which can be realized in the form of hardware and / or software and configured in an electronic device. As shown in the figure, the method comprises: Figure 1
[0032] In step 110, when the graphic processor displays an abnormal rendering object during the running process, the image frame index and the rendering command corresponding to the abnormal rendering object are acquired.
[0033] In the present embodiment, the graphic processor rendering program can be an application program in the graphic processor for rendering a display picture. Specifically, during the running process of the graphic processor rendering program, an object (i.e. abnormal rendering object) with abnormal rendering in the display picture can be acquired.
[0034] Taking a game interface as an example, during the process of rendering the interface by using the graphic processor rendering program, a game scene (such as a game character or a game prop, etc.) with abnormal display can be acquired as an abnormal rendering object, and the image frame index and the rendering command corresponding to the abnormal rendering object can be acquired according to the rendering program.
[0035] In step 120, an initial debugging command corresponding to the abnormal rendering object is generated according to the image frame index and the rendering command, and the initial debugging command is run by the graphic processor; the initial debugging command includes a debugging type corresponding to the abnormal rendering object, a target image frame index, and a debugging index corresponding to the debugging type.
[0036] In this embodiment, after detecting the abnormal rendering object, the rendering type corresponding to the abnormal rendering object can be obtained according to the rendering command corresponding to the abnormal rendering object, and the rendering type is taken as the debugging type, and then the initial debugging command is generated according to the image frame index corresponding to the abnormal rendering object and the debugging type.
[0037] Specifically, the debugging type can be drawing (DDI DRAW), scheduling (DDI DISPATCH), clearing (DDI CLEAR), resource updating (DDI RESOURCE UPDATE), or resource copying (DDI RESOURCE COPY), etc. Assuming that the abnormal event corresponding to the abnormal rendering object is a display abnormality, the debugging type can be determined as drawing; assuming that the abnormal event corresponding to the abnormal rendering object is an updating abnormality, the debugging type can be determined as resource updating.
[0038] In one embodiment of this embodiment, taking the debugging type as drawing as an example, the initial debugging command corresponding to the abnormal rendering object can be:
[0039] DEBUG TYPE=DDI DRAW, LOG ENABLE=TRUE
[0040] Set FRAME INDEX RANGE=Start frame-End frame DRAW INDEX RANGE=Start drawing-End drawing
[0041] wherein "DEBUG_TYPE" is used to represent the debug type, "LOG_ENABLE" is used to represent whether to enable log record, "Set" is used to set the filter condition to limit the debug range of the debug command, and spaces are used to separate each filter condition. "FRAME_INDEX_RANGE" is used to represent the target image frame index corresponding to the abnormal rendering object, which can be a specific value or an interval. When "FRAME_INDEX_RANGE" is set to -1, it is used to represent that all image frames are acquired. "DRAW_INDEX_RANGE" is used to represent the drawing index corresponding to the debug type of drawing, which can be a specific value or an interval. When "DRAW_INDEX_RANGE" is set to -1, it is used to represent that all drawing processes are acquired. Therefore, the above initial debug command is used to represent the program information of the first drawing and the last drawing in the start image frame and the end image frame of the abnormal rendering object.
[0042] In one specific embodiment, if the program information of the 2nd-3rd drawing in the 1st image frame of the abnormal rendering object is to be acquired, the following initial debug command can be generated:
[0043] DEBUG_TYPE=DDI_DRAW, LOG_ENABLE=TRUE
[0044] Set FRAME_INDEX_RANGE=1 DRAW_INDEX_RANGE=2-3
[0045] In another specific embodiment, if the program information of the 4th drawing in all image frames of the abnormal rendering object is to be acquired, the following initial debug command can be generated:
[0046] DEBUG_TYPE=DDI_DRAW, LOG_ENABLE=TRUE
[0047] Set FRAME_INDEX_RANGE=-1 DRAW_INDEX_RANGE=4
[0048] In another specific embodiment, if the program information of all drawings in all image frames of the abnormal rendering object is to be acquired, the following initial debug command can be generated:
[0049] DEBUG_TYPE=DDI_DRAW, LOG_ENABLE=TRUE
[0050] Set FRAME_INDEX_RANGE=-1 DRAW_INDEX_RANGE=-1
[0051] In another embodiment of the present embodiment, taking the debug type of dispatch as an example, the initial debug command corresponding to the abnormal rendering object can be:
[0052] DEBUG TYPE = DDI DISPATCH, LOG ENABLE = TRUE
[0053] Set FRAME INDEX RANGE = start frame-end frame DISPATCH INDEX RANGE = start dispatch-end dispatch
[0054] The initial debug command is used to indicate the program information of the first dispatch and the last dispatch in the start image frame and the end image frame of the abnormal rendering object. The DISPATCH INDEX RANGE is used to indicate the dispatch index corresponding to the debug type of dispatch, which can be a specific value or an interval. When the DISPATCH INDEX RANGE is set to -1, it is used to indicate that all dispatch processes are obtained.
[0055] In the present embodiment, after the initial debug command corresponding to the abnormal rendering object is generated in the above manner, the initial debug command can be transmitted to the graphics processor, and the graphics processor is run by the initial debug command.
[0056] Step 130, obtaining the initial running result of the initial debug command by the graphics processor, adding at least one debug parameter in the initial debug command according to the initial running result, obtaining the updated debug command, and running the updated debug command by the graphics processor.
[0057] In actual application, the initial running result of the initial debug command by the graphics processor usually has a large amount of code data, and it is difficult to quickly and accurately locate the abnormal reason corresponding to the abnormal rendering object. In view of this, the present embodiment provides a way of narrowing the debug range of the initial debug command to obtain the updated debug command, so as to reduce the amount of code data in the running result of the debug command, and realize the quick positioning of the abnormal reason.
[0058] In the present embodiment, at least one debug parameter can be added to the initial debug command according to the debug type in the initial debug command to obtain the updated debug command, and the updated debug command is run by the graphics processor. Taking the debug type of drawing as an example, the specific rendering parameters in the drawing process can be added to the initial debug command; taking the debug type of dispatch as an example, the specific rendering parameters in the dispatch process can be added to the initial debug command.
[0059] After the updated debugging command is run by the graphics processor, the developer can locate the abnormal reason of the abnormal rendering object according to the running result of the updated debugging command.
[0060] The advantage of the arrangement is that the debugging efficiency of the graphics processor rendering program can be improved, and the hardware load of the graphics processor and the influence on the performance of the rendering program can be reduced by gradually narrowing the debugging range of the debugging command.
[0061] The technical scheme provided by the embodiment can locate the abnormal reason of the abnormal rendering object according to the running result of the updated debugging command by detecting that the graphics processor displays the abnormal rendering object during the running process, obtaining the image frame index and the rendering command corresponding to the abnormal rendering object, generating the initial debugging command corresponding to the abnormal rendering object according to the image frame index and the rendering command, obtaining the initial running result of the initial debugging command by the graphics processor, adding at least one debugging parameter in the initial debugging command according to the initial running result to obtain the updated debugging command, and running the updated debugging command by the graphics processor, which can debug the rendering program based on the real graphics processor hardware, obtain more accurate debugging information, and facilitate the developer to locate the abnormal reason of the abnormal rendering object according to the debugging information, thereby improving the debugging efficiency of the graphics processor rendering program.
[0062] Figure 2 The flowchart of the graphics processor debugging method provided for the second embodiment of the application is a further refinement of the above-mentioned embodiment. As shown in Figure 2 The method comprises the following steps.
[0063] In step 210, when the graphics processor displays the abnormal rendering object during the running process, the image frame index and the rendering command corresponding to the abnormal rendering object are obtained.
[0064] In step 220, the initial debugging command corresponding to the drawing type is generated according to the image frame index and the rendering command, and the initial debugging command is run by the graphics processor.
[0065] In step 230, the initial running result of the initial debugging command by the graphics processor is obtained, and the multiple drawing identification, the multiple instance identification and the primitive identification corresponding to the abnormal rendering object are added in the initial debugging command according to the initial running result to obtain the first updated command.
[0066] In a specific embodiment, the first updated command can be:
[0067] DEBUG_TYPE=DDI_DRAW, LOG_ENABLE=TRUE
[0068] Set FRAME_INDEX_RANGE=1 DRAW_INDEX_RANGE=2 DRAWID_RNAGE=1-10 INSTANCEID_RANGE=1-20 PRIMITIVEID_RNAGE=1-30
[0069] wherein, DRAWID_RNAGE is used to represent the draw ID in multi-draw, DRAWID_RNAGE can be a specific value or interval, DRAWID_RNAGE is -1, which is used to represent obtaining all draw IDs. INSTANCEID_RANGE is used to represent the instance ID in multi-instance, INSTANCEID_RANGE can be a specific value or interval, INSTANCEID_RANGE is -1, which is used to represent obtaining all instance IDs. PRIMITIVEID_RNAGE is used to represent the primitive ID, PRIMITIVEID_RNAGE can be a specific value or interval, PRIMITIVEID_RNAGE is -1, which is used to represent obtaining all primitive IDs.
[0070] Therefore, the first update command is used to represent obtaining the program information of the first to tenth draw IDs, the first to twentieth instance IDs and the first to thirtieth primitive IDs in the first drawing of the first image frame corresponding to the abnormal rendering object.
[0071] Step 240, running the first update command by the graphics processor, and obtaining the first running result of the graphics processor on the first update command.
[0072] Step 250, according to the first running result, adding the shader type corresponding to the abnormal rendering object and the pixel range corresponding to the shader type in the first update command to obtain the second update command.
[0073] In the embodiment, if the code data amount in the first running result is large, the debugging range of the first update command can be further reduced to obtain the second update command.
[0074] Specifically, in order to reduce the debugging range of the first update command, the filtering condition of the shader in the graphics pipeline can be added on the basis of the first update command to obtain the second update command:
[0075] DEBUG_TYPE=DDI_DRAW, LOG_ENABLE=TRUE
[0076] Set FRAME_INDEX_RANGE=1 DRAW_INDEX_RANGE=2 DRAWID_RNAGE=1
[0077] INSTANCEID_RANGE=2 PRIMITIVEID_RNAGE=3 SHADER_TYPE=PS
[0078] PS_BOX_RANGE=(100-150, 200-250)
[0079] The "SHADER_TYPE" is used to represent the shader type corresponding to the abnormal rendering object, such as a vertex shader (VS), a hull shader (HS), a domain shader (DS), a geometry shader (GS), and a pixel shader (PS). The "PS_BOX_RANGE" is used to represent the pixel range corresponding to the pixel shader. The "PS_BOX_RANGE" can be represented by coordinates (C, D), where C is the pixel range in the horizontal direction, and D is the pixel range in the vertical direction.
[0080] Therefore, the second update command is used to represent the program information of the pixels in the (100-150, 200-250) region in the corresponding pixel shader of the first drawing ID, the second instance ID, and the third primitive ID in the second drawing process in the first image frame of the abnormal rendering object.
[0081] In step 260, the second update command is executed by the graphics processor, and the second execution result of the graphics processor on the second update command is obtained. According to the second execution result, the target abnormal reason corresponding to the abnormal rendering object is determined.
[0082] In one embodiment of the present embodiment, according to the second execution result, the target abnormal reason corresponding to the abnormal rendering object is determined, including: storing the second execution result into a target log file, and determining the target abnormal reason corresponding to the abnormal rendering object according to the target log file.
[0083] In another embodiment of the present embodiment, according to the second execution result, the target abnormal reason corresponding to the abnormal rendering object is determined, including: displaying the second execution result through a visual interface, and determining the target abnormal reason corresponding to the abnormal rendering object according to the visual interface.
[0084] The advantage of the arrangement is that the abnormal reason of the abnormal rendering object can be quickly determined, and the solving efficiency of the abnormal rendering object is improved.
[0085] The technical scheme provided by the embodiment can detect the display of the abnormal rendering object by the graphic processor during the running process, acquire the image frame index and the rendering command corresponding to the abnormal rendering object, generate the initial debugging command corresponding to the drawing type according to the image frame index and the rendering command, run the initial debugging command by the graphic processor, acquire the initial running result of the initial debugging command by the graphic processor, add the multi-drawing identifier, the multi-instance identifier and the primitive identifier corresponding to the abnormal rendering object in the initial debugging command according to the initial running result, obtain the first update command, run the first update command by the graphic processor, acquire the first running result of the first update command by the graphic processor, add the shader type corresponding to the abnormal rendering object and the pixel range corresponding to the shader type in the first update command according to the first running result, obtain the second update command, run the second update command by the graphic processor, acquire the second running result of the second update command by the graphic processor, and determine the target abnormal reason corresponding to the abnormal rendering object according to the second running result, so that the debugging efficiency of the graphic processor rendering program and the accuracy of the debugging result can be improved.
[0086] Figure 3 The flowchart of the graphic processor debugging method provided for the third embodiment of the application is a further refinement of the above-mentioned embodiments. Figure 3 As shown in the figure, the method comprises the following steps.
[0087] In step 310, when the graphic processor displays an abnormal rendering object during the running process, the image frame index and the rendering command corresponding to the abnormal rendering object are acquired.
[0088] In step 320, the initial debugging command corresponding to the scheduling type is generated according to the image frame index and the rendering command, and the initial debugging command is run by the graphic processor.
[0089] In step 330, the initial running result of the initial debugging command by the graphic processor is acquired.
[0090] In step 340, the compute shader corresponding to the abnormal rendering object is determined, and the work group range corresponding to the compute shader is added in the initial debugging command to obtain the update debugging command.
[0091] In the embodiment, the workgroup range can be represented using coordinates (A, B, C), A represents the workgroup range on the x-coordinate axis, B represents the workgroup range on the y-coordinate axis, and C represents the workgroup range on the z-coordinate axis.
[0092] Specifically, if the computing shader workgroup information in the region (1-1, 3-6, 7-8) in the third dispatch process (1-1, 3-6, 7-8) in the fifth image frame of the abnormal rendering object is to be acquired, the following updated debugging command can be generated:
[0093] DEBUG_TYPE=DDI_DISPATCH, LOG_ENABLE=TRUE
[0094] Set FRAME_INDEX_RANGE=5 DISPATCH_INDEX_RANGE=3
[0095] GROUP_RANGE=(1-1, 3-6, 7-8)
[0096] Step 350, running the updated debugging command through the graphics processor.
[0097] The technical scheme provided by the embodiment, when an abnormal rendering object is displayed during the running of the graphics processor, the image frame index corresponding to the abnormal rendering object and the rendering command are acquired, the initial debugging command corresponding to the dispatch type is generated according to the image frame index and the rendering command, the initial debugging command is run through the graphics processor, the initial running result of the initial debugging command by the graphics processor is acquired, the computing shader corresponding to the abnormal rendering object is determined, the workgroup range corresponding to the computing shader is added in the initial debugging command to obtain the updated debugging command, and the technical means of running the updated debugging command through the graphics processor can improve the debugging efficiency of the graphics processor rendering program and the accuracy of the debugging result.
[0098] Figure 4 A structural schematic diagram of a graphics processor debugging device provided by the fourth embodiment of the application is shown in FIG. 4. The device is applied in an electronic device. As shown in FIG. 4, the device includes an object detection module 410, an initial command generation module 420, and an updated command generation module 430. Figure 4
[0099] The object detection module 410 is configured to acquire the image frame index corresponding to the abnormal rendering object and the rendering command when the graphics processor displays an abnormal rendering object during the running of the graphics processor.
[0100] The initial command generation module 420 is configured to generate an initial debugging command corresponding to the abnormal rendering object according to the image frame index and the rendering command, and run the initial debugging command through the graphics processor.
[0101] The initial debugging command includes a debugging type corresponding to the abnormal rendering object, a target image frame index, and a debugging index corresponding to the debugging type.
[0102] The update command generation module 430 is configured to obtain an initial running result of the initial debugging command by the graphics processor, add at least one debugging parameter in the initial debugging command according to the initial running result to obtain an update debugging command, and run the update debugging command through the graphics processor.
[0103] The technical scheme provided by the embodiment can obtain an image frame index and a rendering command corresponding to the abnormal rendering object when the graphics processor displays the abnormal rendering object in a running process, generate an initial debugging command corresponding to the abnormal rendering object according to the image frame index and the rendering command, run the initial debugging command through the graphics processor, obtain an initial running result of the initial debugging command by the graphics processor, add at least one debugging parameter in the initial debugging command according to the initial running result to obtain an update debugging command, and run the update debugging command through the graphics processor. Therefore, the rendering program can be debugged based on the real graphics processor hardware, more accurate debugging information can be obtained, the developer can locate the abnormal reason of the abnormal rendering object according to the debugging information, and thus the debugging efficiency of the graphics processor rendering program is improved.
[0104] On the basis of the above embodiment, the update command generation module 430 includes:
[0105] The first command generation unit is configured to, if the debugging type is drawing, add a multi-drawing identifier, a multi-instance identifier, and a primitive identifier corresponding to the abnormal rendering object in the initial debugging command according to the initial running result to obtain a first update command.
[0106] The first command running unit is configured to run the first update command through the graphics processor.
[0107] The second command generation unit is configured to obtain a first running result of the first update command by the graphics processor, and add a shader type corresponding to the abnormal rendering object and a pixel range corresponding to the shader type in the first update command according to the first running result to obtain a second update command.
[0108] The second command running unit is configured to run the second update command through the graphics processor.
[0109] an exception determination unit, configured to acquire a second running result of the graphics processor on a second update command, and determine a target exception cause corresponding to an exception rendering object according to the second running result;
[0110] an initial command processing unit, configured to, when the type of the initial debugging command is scheduling, determine a compute shader corresponding to the exception rendering object, and add a workgroup range corresponding to the compute shader in the initial debugging command to obtain an updated debugging command;
[0111] a result storage unit, configured to store the second running result into a target log file, and determine a target exception cause corresponding to the exception rendering object according to the target log file;
[0112] a result display unit, configured to display the second running result through a visual interface, and determine a target exception cause corresponding to the exception rendering object according to the visual interface.
[0113] The apparatus can perform the method provided by all the foregoing embodiments of the present application, and has the corresponding function modules and beneficial effects of performing the foregoing method. Technical details not described in the embodiment can be referred to the method provided by all the foregoing embodiments of the present application.
[0114] Figure 5 A structural diagram of an electronic device 10 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices (e.g., headgear, eyewear, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the present application as described and / or claimed herein.
[0115] As Figure 5As shown, the electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM), a random access memory (RAM), etc., communicatively connected to the at least one processor 11, where the memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory 12 or loaded into the random access memory 13 from the storage unit 18. Various programs and data required for the operation of the electronic device 10 can also be stored in the random access memory 13. The processor 11, the read-only memory 12, and the random access memory 13 are connected to each other through a bus 14. An input / output (I / O) interface is also connected to the bus 14.
[0116] Various components in the electronic device 10 are connected to the input / output interface 15, including an input unit 16, such as a keyboard, a mouse, etc., an output unit 17, such as various types of displays, a speaker, etc., a storage unit 18, such as a magnetic disk, an optical disk, etc., and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0117] The processor 11 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the graphics processor debugging method.
[0118] In some embodiments, the graphics processor debugging method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the read-only memory 12 and / or the communication unit 19. When the computer program is loaded into the random access memory 13 and executed by the processor 11, one or more steps of the graphics processor debugging method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the graphics processor debugging method by any other appropriate means, such as by means of firmware.
[0119] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0120] Computer programs used to implement the processes of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer program, when executed, can cause instructions defined in the flow charts and / or block diagrams to be implemented. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a standalone software package and partially on a remote machine or entirely on a remote machine or server.
[0121] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. Computer-readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0122] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0123] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0124] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0125] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present disclosure. For example, the steps recited in the present disclosure can be executed in parallel, executed in sequence, or executed in a different order, as long as the desired results of the present disclosure are achieved, and the present disclosure is not limited herein.
[0126] The specific embodiments described above are not intended to be limiting, and persons skilled in the art will appreciate that various modifications, combinations, sub-combinations and alternatives can be made to the specific embodiments without departing from the spirit and principles of the disclosure. Accordingly, the disclosure is not limited to the specific embodiments described above, but only by the scope of the appended claims.
Claims
1. A method of debugging a graphics processor, the method comprising: The method comprises: detecting that an abnormal rendering object is displayed during running of a graphics processor, and acquiring an image frame index and a rendering command corresponding to the abnormal rendering object; generating an initial debugging command corresponding to the abnormal rendering object according to the image frame index and the rendering command, and running the initial debugging command through the graphics processor; wherein the initial debugging command comprises a debugging type corresponding to the abnormal rendering object, a target image frame index, and a debugging index corresponding to the debugging type; acquiring an initial running result of the initial debugging command by the graphics processor, adding at least one debugging parameter in the initial debugging command according to the initial running result to obtain an updated debugging command, and running the updated debugging command through the graphics processor; wherein, after detecting the abnormal rendering object, further comprising: acquiring a rendering type corresponding to the abnormal rendering object according to the rendering command corresponding to the abnormal rendering object, and taking the rendering type as the debugging type.
2. The method of claim 1, wherein, If the debugging type is drawing, adding at least one debugging parameter in the initial debugging command according to the initial running result to obtain an updated debugging command, and running the updated debugging command through the graphics processor, comprises: adding a multi-drawing identifier, a multi-instance identifier and a primitive identifier corresponding to the abnormal rendering object in the initial debugging command according to the initial running result to obtain a first updated command; running the first updated command through the graphics processor.
3. The method of claim 2, wherein, After running the first updated command through the graphics processor, further comprising: acquiring a first running result of the first updated command by the graphics processor; adding a shader type corresponding to the abnormal rendering object and a pixel range corresponding to the shader type in the first updated command according to the first running result to obtain a second updated command; running the second updated command through the graphics processor; acquiring a second running result of the second updated command by the graphics processor, and determining a target abnormal reason corresponding to the abnormal rendering object according to the second running result.
4. The method of claim 1, wherein, If the debugging type is scheduling, adding at least one debugging parameter in the initial debugging command according to the running result to obtain an updated debugging command, comprises: determining a compute shader corresponding to the abnormal rendering object; adding a workgroup range corresponding to the compute shader in the initial debugging command to obtain an updated debugging command.
5. The method of claim 3, wherein, Determining a target abnormal reason corresponding to the abnormal rendering object according to the second running result, comprises: storing the second running result into a target log file, and determining the target abnormal reason corresponding to the abnormal rendering object according to the target log file.
6. The method of claim 3, wherein, Determining a target abnormal reason corresponding to the abnormal rendering object according to the second running result, comprises: displaying the second running result through a visualization interface, and determining the target abnormal reason corresponding to the abnormal rendering object according to the visualization interface.
7. A graphics processor debugging apparatus, comprising: The device comprises: an object detection module configured to detect that an abnormal rendering object is displayed during running of a graphics processor, and acquire an image frame index and a rendering command corresponding to the abnormal rendering object; An initial command generation module is configured to generate an initial debugging command corresponding to the abnormal rendering object according to the image frame index and the rendering command, and run the initial debugging command through the graphics processor; The initial debugging command includes a debugging type corresponding to the abnormal rendering object, a target image frame index, and a debugging index corresponding to the debugging type; An update command generation module is configured to obtain an initial running result of the initial debugging command by the graphics processor, add at least one debugging parameter in the initial debugging command according to the initial running result, obtain an updated debugging command, and run the updated debugging command through the graphics processor; After detecting the abnormal rendering object, the method further includes: obtaining a rendering type corresponding to the abnormal rendering object according to the rendering command corresponding to the abnormal rendering object, and taking the rendering type as the debugging type.
8. The apparatus of claim 7, wherein, The update command generation module includes: A first command generation unit is configured to, if the debugging type is drawing, add a multi-drawing identifier, a multi-instance identifier, and a primitive identifier corresponding to the abnormal rendering object in the initial debugging command according to the initial running result, and obtain a first updated command. A first command running unit is configured to run the first updated command through the graphics processor.
9. An electronic device, comprising: The device includes: at least one processor; and a memory connected with the at least one processor in communication; wherein The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the graphics processor debugging method in any one of claims 1-6.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for enabling the processor to execute the graphics processor debugging method in any one of claims 1-6 when executed.
Citation Information
Patent Citations
Target frame data acquisition method and device for GPU function verification and storage medium
CN112686797A
GPU (Graphics Processing Unit) state debugging method and device based on self-developed graphics card and storage medium
CN115408227A