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

Direct Driver HAL #816

Merged
merged 35 commits into from
Oct 19, 2024
Merged

Direct Driver HAL #816

merged 35 commits into from
Oct 19, 2024

Conversation

makslevental
Copy link
Collaborator

@makslevental makslevental commented Oct 2, 2024

quote-you-know-crazy-straws-they-go-all-over-the-place-these-straws-are-sane-they-never-lost-mitch-hedberg-129-5-0527

Let's try this again: this is a HAL that skips/avoids/elides XRT completely. It does so by (essentially) going straight to the XDNA driver's (kmq) shim which talks directly to the kernel module. Note that XDNA's shim actually couples tightly to XRT itself so the bulk of the actual "work" here is/was decoupling. Thus, we vendor the decoupled shim. Just to be explicit/clear: after this PR, on Linux, the only thing needed in the environment is the kernel module itself - not XRT, nor XDNA's shim.

Call outs:

  1. Only Linux for now (Windows soon);
  2. On Linux, we no longer even need to clone XRT (completely really does mean completely);
    • We no longer use .xclbin as the artifact and now just load the .pdi directly;
  3. This uses the so-called kernel-managed queue (kmq) path; user-managed queues (umq) aren't supported until aie4;
  4. The current implementation here is still sync and still uses direct (rather than indirect) command buffers; this PR is already large/complex enough without changing the paradigms. The next PR will add/implement those;
  5. Nothing about how drivers themselves are bumped needs to change - you/anyone can continue to install the XDNA drivers using their full instructions there and everything will work the same, i.e., the XRT pieces will still be skipped even if you have them installed. But I will probably put together a script that builds/installs only their kernel module for those that want to opt-out of XRT in their environment;
  6. For now, the XRT HAL will still work on Linux but it should be considered deprecated (hence no longer tested in CI).

TODOs before landing:

  • remove instructional comments leftover from the null HAL;
  • undo "OO"-ness of the HAL
  • add missing trace zones
  • remove smart pointers where possible
  • move hwq into kernel
  • remove exceptions from the shim.
  • parameterize number of cols/rows (currently hardcoded 4x4 for Phoenix);

shout-out to @benvanik for putting together the null HAL lickety-split for me to study while working on this PR.

@makslevental makslevental force-pushed the makslevental/xrt-lite branch 11 times, most recently from 9644459 to 8f82b0a Compare October 3, 2024 02:35
@makslevental makslevental force-pushed the makslevental/xrt-lite branch 19 times, most recently from 8e0d61a to dae35a9 Compare October 12, 2024 00:11
@makslevental makslevental enabled auto-merge (squash) October 18, 2024 23:08
@makslevental makslevental merged commit fad9629 into main Oct 19, 2024
5 checks passed
@makslevental makslevental deleted the makslevental/xrt-lite branch October 19, 2024 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants