Skip to content

intel_gpu: update API calls#625

Open
dbarry9 wants to merge 1 commit into
icl-utk-edu:masterfrom
dbarry9:2026.06.26__intel_gpu-exp-to-zel
Open

intel_gpu: update API calls#625
dbarry9 wants to merge 1 commit into
icl-utk-edu:masterfrom
dbarry9:2026.06.26__intel_gpu-exp-to-zel

Conversation

@dbarry9

@dbarry9 dbarry9 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Pull Request Description

The Experimental API Tracing in Level Zero has been deprecated, and the Level Zero drivers now support only the Loader Tracing Layer.

Failing to use the Loader Tracing Layer with newer drivers results in error code 0x78000001 (ZE_RESULT_ERROR_UNINITIALIZED -- "driver is not initialized").

These changes have been tested on the Intel Data Center Max 1100 (Ponte Vecchio architecture) with driver version 1.6.

This PR resolves Issue #523.

Thank you to Treece Burgess for suggesting this solution methodology!

Author Checklist

  • Description
    Why this PR exists. Reference all relevant information, including background, issues, test failures, etc
  • Commits
    Commits are self contained and only do one thing
    Commits have a header of the form: module: short description
    Commits have a body (whenever relevant) containing a detailed description of the addressed problem and its solution
  • Tests
    The PR needs to pass all the tests

@dbarry9 dbarry9 requested a review from Treece-Burgess June 26, 2026 15:57
@dbarry9 dbarry9 linked an issue Jun 26, 2026 that may be closed by this pull request
@dbarry9 dbarry9 added component-intel_gpu PRs and Issues related to the intel_gpu component status-ready-for-review PR is ready to be reviewed labels Jun 26, 2026
#include <mutex>

#include "level_zero/zet_api.h"
#include <level_zero/zet_api.h>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Could you not use the same #if defined(PAPI_USE_ZET_EXP_API) logic here to only include the header file that is actually needed by the zet or zel API's respectively?

```sh
METRICS_SAMPLING_PERIOD=value
```
* The Experimental API Tracing has been deprecated and is no longer supported in the Level Zero drivers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: What quantifies as a Level Zero driver i.e. what Intel GPU's are supported by the Loader Tracing Layer?

}
if (status == ZE_RESULT_SUCCESS) {
status = zetTracerExpSetEpiloguesFunc(m_tracer, &epilogCB);
#if defined(PAPI_USE_ZET_EXP_API)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the README.md, it is stated that the environment variable PAPI_USE_ZET_EXP_API needs to be set to enable the experimental API. However, as this is a preprocessor check a user exported environment variable is not going to take effect. A user would need to pass -D at compilation or set the #define inside the actual file.

This leads me to the question, can you make this check be at runtime or make it such that we internally check for the user if their driver needs the experimental API or Loader Tracing Layer?

If the later is not possible, a possible workaround would be to check for the PAPI_USE_ZET_EXP_API environment variable inside Rules.intel_gpu and then pass the define via -D. As a note, this solution is off the top of my head and not tested.

Comment thread src/components/intel_gpu/Rules.intel_gpu
METRICS_SAMPLING_PERIOD=value
```
* The Experimental API Tracing has been deprecated and is no longer supported in the Level Zero drivers.
It has been replaced with the Loader Tracing Layer. To use the Experimental API Tracing, you must set the environment variable **PAPI\_USE\_ZET\_EXP\_API**.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are unable to change the current workflow to support a runtime check or where we check internally for a user if a Level Zero driver is in use. I would explicitly state this needs to be set at compilation time.

m_queryState->handle = this;
tracerDesc.pUserData = m_queryState;
status = zetTracerExpCreateFunc(m_context, &tracerDesc, &m_tracer);
#if defined(PAPI_USE_ZET_EXP_API)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting again, see aforementioned comments.

epilogCB.CommandList.pfnAppendLaunchKernelCb = metricQueryEndCB;

status = zetTracerExpSetProloguesFunc(m_tracer, &prologCB);
#if defined(PAPI_USE_ZET_EXP_API)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting again, see aforementioned comments.

}
if (status == ZE_RESULT_SUCCESS) {
status = zetTracerExpSetEpiloguesFunc(m_tracer, &epilogCB);
#if defined(PAPI_USE_ZET_EXP_API)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting again, see aforementioned comments.

}
if (status == ZE_RESULT_SUCCESS) {
status = zetTracerExpSetEnabledFunc(m_tracer, true);
#if defined(PAPI_USE_ZET_EXP_API)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting again, see aforementioned comments.

Comment thread src/components/intel_gpu/README.md Outdated
The Experimental API Tracing in Level Zero has been deprecated, and the
Level Zero drivers now support only the Loader Tracing Layer.

Failing to use the Loader Tracing Layer with newer drivers results in
error code 0x78000001 (ZE_RESULT_ERROR_UNINITIALIZED -- "driver is not
initialized").

These changes have been tested on the Intel Data Center Max 1100 (Ponte
Vecchio architecture) with driver version 1.6.
@dbarry9 dbarry9 force-pushed the 2026.06.26__intel_gpu-exp-to-zel branch from 307b585 to e7297f3 Compare June 26, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component-intel_gpu PRs and Issues related to the intel_gpu component status-ready-for-review PR is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue]: zero-values from intel_gpu component test

2 participants