# US 11,120,521 B2 · Techniques for graphics processing unit profiling using binary instrumentation

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,120,521 B2
- Document ID: US11120521B2
- Status: Granted
- Kind: B2
- Application number: 16/235,257
- Filed: 2018-12-28
- Published: 2019-07-11
- Granted: 2021-09-14
- Earliest claimed: 2018-12-28
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Orr Goldman; Konstantin Levit-Gurevich; Michael Berezalsky; Noam Itzhaki; Arik Narkis
- Web page: https://patentgrep.com/patent/US11120521B2

## CPC

- G06T 1/20: Processor architectures; Processor configuration, e.g. pipelining
- G06F 9/3877: {using a secondary processor, e.g. coprocessor (peripheral processor G06F13/12)}
- G06F 9/45525: {Optimisation or modification within the same instruction set architecture, e.g. HP Dynamo}
- G06F 9/5055: {considering software capabilities, i.e. software resources associated or available to the machine}
- G06F 11/3409: {for performance assessment}
- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- G06F 2201/865: Monitoring of software
- G06F 2201/88: Monitoring involving counting
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques and apparatus for profiling graphics processing unit (GPU) processes using binary instrumentation are described. In one embodiment, for example, an apparatus may include at least one memory comprising instructions and a processor coupled to the at least one memory. The processor may execute the instructions to implement a profiling process to profile a graphics processing unit (GPU) application being executed via a GPU, the profiling process to perform an instrumentation phase to determine an operating process being executed via the GPU and to generate instrumented binary code for the operating process, perform an execution phase to collect profiling data for a command of the operating process, and perform a completion phase for a profiling application executed via the processor to read the profiling data. Other embodiments are described.

## Claims

### Claim 1

An apparatus, comprising:
at least one memory comprising instructions; and
a processor coupled to the at least one memory, the processor to execute the instructions to implement a profiling process to profile a graphics processing unit (GPU) application being executed via a GPU, the profiling process to cause:
a binary instrumentation engine (BIE) to communicate with a GPU driver to perform an instrumentation phase to determine an operating process being executed via the GPU and to generate instrumented binary code from an original binary for the operating process, the instrumented binary code to comprise profiling instructions inserted at different code locations in the original binary code as specified by an instrumentation schema to measure machine instruction-level performance of the operating process,
the BIE to provide the instrumented binary code to the GPU driver to perform an execution phase to collect profiling data for a command of the operating process, and
the GPU driver to notify the BIE when the operating process is complete to perform a completion phase for a profiling application executed via the processor to read the profiling data.

### Claim 2 (depends on 1)

The apparatus of claim 1, the operating process comprising at least one of a compute kernel or a compute shader.

### Claim 3 (depends on 1)

The apparatus of claim 1, the processor to execute the instructions to implement the profiling process to perform the instrumentation phase wherein the GPU driver receives notification of a profile trigger event from the BIE.

### Claim 4 (depends on 3)

The apparatus of claim 3, the profile trigger event comprising creation of the operating process.

### Claim 5 (depends on 1)

The apparatus of claim 1, the processor to execute the instructions to implement the profiling process to perform the instrumentation phase wherein the profiling application operates to instruct the BIE to perform an instrumentation process on the operating process.

### Claim 6 (depends on 5)

The apparatus of claim 5, the processor to execute the instructions to implement the profiling process to perform the instrumentation phase wherein the BIE:
generates instrumented binary code via the instrumentation process.

### Claim 7 (depends on 1)

The apparatus of claim 1, the processor to execute the instructions to implement the profiling process to perform the execution phase wherein the BIE causes the GPU driver to allocate a buffer for the profiling data.

### Claim 8 (depends on 7)

The apparatus of claim 7, the processor to execute the instructions to implement the profiling process to perform the execution phase wherein the GPU driver maps the buffer as shared between the GPU and the processor.

### Claim 9 (depends on 7)

The apparatus of claim 7, the processor to execute the instructions to implement the profiling process to perform the execution phase wherein the GPU driver binds the buffer for the operating process for the command.

### Claim 10 (depends on 7)

The apparatus of claim 7, the processor to execute the instructions to implement the profiling process to perform the completion phase wherein the BIE provides the profiling application with a pointer to the buffer responsive to determining that the command has completed.

### Claim 11

A method, comprising:
performing an instrumentation phase via a binary instrumentation engine (BIE) and a graphics processing unit (GPU) driver to determine an operating process being executed via the GPU and to generate instrumented binary code from an original binary for the operating process, the instrumented binary code to comprise profiling instructions inserted at different code locations in the original binary code as specified by an instrumentation schema to measure machine instruction-level performance of the operating process,
performing an execution phase to collect profiling data for a command of the operating process when the BIE provides the instrumented binary code to the GPU driver, and
performing a completion phase for a profiling application to read the profiling data when the GPU driver notifies the BIE that the operating process is complete.

### Claim 12 (depends on 11)

The method of claim 11, the operating process comprising at least one of a compute kernel or a compute shader.

### Claim 13 (depends on 11)

The method of claim 11, executing, via a processor, the GPU driver and the BIE.

### Claim 14 (depends on 13)

The method of claim 13, the instrumentation phase further comprising the GPU driver receiving notification of a profile trigger event from the BIE.

### Claim 15 (depends on 14)

The method of claim 14, the profile trigger event comprising creation of the operating process.

### Claim 16 (depends on 13)

The method of claim 13, the instrumentation phase further comprising the profiling application operating to instruct the BIE to perform an instrumentation process on the operating process.

### Claim 17 (depends on 16)

The method of claim 16, the instrumentation phase further comprising the BIE:
generating instrumented binary code via the instrumentation process.

### Claim 18 (depends on 13)

The method of claim 13, the execution phase further comprising the BIE causing the GPU driver to allocate a buffer for the profiling data.

### Claim 19 (depends on 18)

The method of claim 18, the execution phase further comprising the GPU driver mapping the buffer as shared between the GPU and the processor.

### Claim 20 (depends on 18)

The method of claim 18, the execution phase further comprising the GPU driver binding the buffer for the operating process for the command.

### Claim 21 (depends on 18)

The method of claim 18, the completion phase further comprising the BIE providing the profiling application with a pointer to the buffer responsive to determining that the command has completed.

### Claim 22

A non-transitory computer-readable storage medium that stores computer-executable instructions for execution by processing circuitry of a computing device, the computer-executable instructions, when executed, to cause the computing device to:
perform an instrumentation phase via a binary instrumentation engine (BIE) and a graphics processing unit (GPU) driver to determine an operating process being executed via the GPU and to generate instrumented binary code from an original binary for the operating process, the instrumented binary code to comprise profiling instructions inserted at different code locations in the original binary code as specified by an instrumentation schema to measure machine instruction-level performance of the operating process,
perform an execution phase to collect profiling data for a command of the operating process when the BIE provides the instrumented binary code to the GPU driver, and
perform a completion phase for a profiling application to read the profiling data when the GPU driver notifies the BIE that the operating process is complete.

### Claim 23 (depends on 22)

The non-transitory computer-readable storage medium of claim 22, the computer-executable instructions, when executed, to cause the computing device to:
execute the GPU driver and the BIE by a processor, and
perform the execution phase wherein the BIE causes the GPU driver to allocate a buffer for the profiling data, the GPU driver to map the buffer as shared between the GPU and processor.
