oneapi-src / level-zero

oneAPI Level Zero Specification Headers and Loader
https://spec.oneapi.com/versions/latest/elements/l0/source/index.html
MIT License
208 stars 90 forks source link

Question about the software level of level zero in oneAPI. #87

Closed malixian closed 2 years ago

malixian commented 2 years ago

I was very interested in the L0 project, so I looked at some project source code. My understanding is that L0 is the interface to interact with the GPU driver. But I don't see any code like open("/dev/xxGPU") to open a gpu driver.
Instead I noticed the function zeDriverGet at ze_api.h. However, I can't find the implementation of this function. So, my question is:

  1. Does L0 directly interact with the driver? And where is this zeDriverGet defined
  2. The project Compute-runtime is on top of L0?

Thanks.

bmyates commented 2 years ago

Hello, This repo contains the development headers and the L0 loader. It doesn't contain the L0 drivers. Compute-runtime contains the L0 Driver for Intel GPUs. You need both installed for a working L0 stack (assuming you are using intel GPUs).

L0 is an interface for offloading to any type of accelerator device. That could be GPU, FPGA, VPU, etc. Each category of device needs it's own driver. The job of the loader contained in this repo is to discover which L0 drivers are installed on your system, load them, expose them to the user via zeDriverGet, arbitrate between them when there are multiple, and insert various "layers" into the API stack for debugging.

Note: The word "driver" is a bit overloaded. It's used here to refer to a user-mode library implementing L0. Not referring to the underlying kernel drivers.

jandres742 commented 2 years ago

L0 GPU implementation in https://github.com/intel/compute-runtime

malixian commented 2 years ago

Hello, This repo contains the development headers and the L0 loader. It doesn't contain the L0 drivers. Compute-runtime contains the L0 Driver for Intel GPUs. You need both installed for a working L0 stack (assuming you are using intel GPUs).

L0 is an interface for offloading to any type of accelerator device. That could be GPU, FPGA, VPU, etc. Each category of device needs it's own driver. The job of the loader contained in this repo is to discover which L0 drivers are installed on your system, load them, expose them to the user via zeDriverGet, arbitrate between them when there are multiple, and insert various "layers" into the API stack for debugging.

Note: The word "driver" is a bit overloaded. It's used here to refer to a user-mode library implementing L0. Not referring to the underlying kernel drivers.

Thanks!