intel_gpu: update API calls#625
Conversation
| #include <mutex> | ||
|
|
||
| #include "level_zero/zet_api.h" | ||
| #include <level_zero/zet_api.h> |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
| 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**. |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Formatting again, see aforementioned comments.
| epilogCB.CommandList.pfnAppendLaunchKernelCb = metricQueryEndCB; | ||
|
|
||
| status = zetTracerExpSetProloguesFunc(m_tracer, &prologCB); | ||
| #if defined(PAPI_USE_ZET_EXP_API) |
There was a problem hiding this comment.
Formatting again, see aforementioned comments.
| } | ||
| if (status == ZE_RESULT_SUCCESS) { | ||
| status = zetTracerExpSetEpiloguesFunc(m_tracer, &epilogCB); | ||
| #if defined(PAPI_USE_ZET_EXP_API) |
There was a problem hiding this comment.
Formatting again, see aforementioned comments.
| } | ||
| if (status == ZE_RESULT_SUCCESS) { | ||
| status = zetTracerExpSetEnabledFunc(m_tracer, true); | ||
| #if defined(PAPI_USE_ZET_EXP_API) |
There was a problem hiding this comment.
Formatting again, see aforementioned comments.
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.
307b585 to
e7297f3
Compare
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
Why this PR exists. Reference all relevant information, including background, issues, test failures, etc
Commits are self contained and only do one thing
Commits have a header of the form:
module: short descriptionCommits have a body (whenever relevant) containing a detailed description of the addressed problem and its solution
The PR needs to pass all the tests