[code-reflection] RFR: Implementation of a HAT Spirv backend
duke
duke at openjdk.org
Wed Sep 18 18:27:21 UTC 2024
On Wed, 11 Sep 2024 22:27:46 GMT, Steve Dohrmann <sdohrmann at openjdk.org> wrote:
> ## A HAT SPIR-V backend
>
> Implements an initial version of a HAT SPIR-V backend. It extends JavaBackend and includes no native code. It is complete enough to run the HAT Mandel example and some other simple examples. It lacks generalized data structure support and so will not yet run, e.g., the BlackScholes or ViolaJones examples.
>
> The backend currently only supports Linux and requires an Intel GPU to run. Examples of compatible Intel GPU hardware are:
>
> * Integrated Intel GPU such as:
> * Iris Xe or UHD graphics in 11th generation or later CPUs (Rocket Lake, Alder Lake, Raptor Lake, ...)
> * Arc graphics available with the latest CPUs, e.g., Meteor Lake
> * Discrete Intel GPU such as Arc 580, 750, 770
> * these are available on Amazon, search, e.g., "Intel Arc 580" or "Intel Arc 770"
>
> Linux drivers for the above hardware have been included in some major Linux distros (e.g. Ubuntu) in time corresponding to the release of the hardware. Drivers for the discrete Arc cards are included in, e.g., Ubuntu 23.10. Ubuntu drivers for Arc discrete GPUs can also be downloaded separately. See https://www.intel.com/content/www/us/en/download/747008/intel-arc-graphics-driver-ubuntu.html
>
> ## Dependencies
> Software-wise, the backend has several dependencies outside of the Babylon repo:
>
> 1. The Intel Level Zero library, a low level native library used to access the GPU
> 2. A Java binding to the Level Zero library, generated using the OpenJDK jextract tool
> 3. The Beehive Labs Java SPIR-V toolkit, used to construct a SPIR-V binary module
>
> Currently these dependencies are not automatically built. Below is information on how to build and install the three items above.
>
>
> ### Intel Level Zero library
>
> A build-levelzero.sh script is included in the hat/backends/spirv/scripts directory. Superuser privileges may be required when running this script. Execute the script with the scripts directory as the current directory:
>
> cd backends/spirv/scripts
> sh build-level-zero.sh
>
> This will build and install the Level Zero ze_loader.so to /usr/local/lib. This path must be include in java.library.path or LD_LIBRARY_PATH when running using the spirv backend.
>
> ### OpenJDK jextract tool and generated binding to Level Zero
>
> An early-access binary of the jextract tool can be found at:
>
> https://jdk.java.net/jextract/
>
> - expand the archive
> - set a JEXTRACT_DIR environment variable to point at the jextract directory.
>
> A generate-level-zero-binding.sh script is included in the hat...
@steveatgh
Your change (at version 77b68fe5c630b0cc9890df27270810e48fc5214f) is now ready to be sponsored by a Committer.
-------------
PR Comment: https://git.openjdk.org/babylon/pull/229#issuecomment-2359136844
More information about the babylon-dev
mailing list