Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype new command-list submission entrypoint #1975

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fabiomestre
Copy link
Contributor

@fabiomestre fabiomestre commented Aug 14, 2024

Work in progress. Waiting for the new level-zero entrypoint to work before continuing.

@github-actions github-actions bot added level-zero L0 adapter specific issues command-buffer Command Buffer feature addition/changes/specification labels Aug 14, 2024
urCommandBufferCreateExp(ur_context_handle_t Context, ur_device_handle_t Device,
const ur_exp_command_buffer_desc_t *CommandBufferDesc,
ur_exp_command_buffer_handle_t *CommandBuffer) {
if (Device->isPVC() && Device->ImmCommandListUsed) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably check for the existance of the extension here in the driver instead, something like

if (!CommandBuffer->Context->getPlatform()
           ->ZeDriverAppendImmediateCommandListExtensionFound) 

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm checking the driver version in the latest commit. But this is definitely better. Will update the code to do it in this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I implemented this but it seems that the level-zero driver is not yet reporting the extension correctly. I left a TODO to switch to this later.

source/adapters/level_zero/command_buffer.cpp Outdated Show resolved Hide resolved
source/adapters/level_zero/command_buffer.cpp Outdated Show resolved Hide resolved
source/adapters/level_zero/command_buffer.cpp Outdated Show resolved Hide resolved
source/adapters/level_zero/command_buffer.cpp Outdated Show resolved Hide resolved
@fabiomestre fabiomestre force-pushed the fabio/immediate_append_exp branch 2 times, most recently from 12fcfa5 to 6c0b66c Compare October 14, 2024 18:06
Adds a new path that uses the
zeCommandListImmediateAppendCommandListsExp to submit
command-buffers on PVC hardware.
source/adapters/level_zero/command_buffer.cpp Outdated Show resolved Hide resolved
source/adapters/level_zero/command_buffer.cpp Outdated Show resolved Hide resolved
source/adapters/level_zero/command_buffer.cpp Outdated Show resolved Hide resolved
bool IsInOrder = canBeInOrder(Context, CommandBufferDesc);
bool EnableProfiling =
CommandBufferDesc && CommandBufferDesc->enableProfiling;
CommandBufferDesc && CommandBufferDesc->enableProfiling && !IsInOrder;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this change mean we can't profile in-order command-lists?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In-order command-lists don't have sync-point events. So there is nothing to profile. This check already existed on the original implementation, but it was only checked during enqueue with:

const bool DoProfiling =
      (UrQueue->Properties & UR_QUEUE_FLAG_PROFILING_ENABLE) &&
      (!CommandBuffer->IsInOrderCmdList) &&
      (CommandBuffer->IsProfilingEnabled) && Event;

source/adapters/level_zero/command_buffer.cpp Outdated Show resolved Hide resolved
source/adapters/level_zero/command_buffer.cpp Outdated Show resolved Hide resolved
source/adapters/level_zero/command_buffer.cpp Outdated Show resolved Hide resolved
source/adapters/level_zero/command_buffer.hpp Outdated Show resolved Hide resolved
source/adapters/level_zero/command_buffer.hpp Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command-buffer Command Buffer feature addition/changes/specification level-zero L0 adapter specific issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants