Skip to content
Haojian Zhuang edited this page Mar 17, 2022 · 1 revision

Welcome to the uadk wiki!

Overview

UADK is a framework for user application to access hardware accelerator in a unified, secure, and efficient way. UADK is comprised of UACCE, libwd and many other algorithm libraries for different applications.

Libwd provides a wrapper of basic UACCE user space interfaces, they are a set of helper functions.

Algorithm libraries offer a set of APIs to users, who could use this set of APIs to do specific task without accessing low level implementations. Algorithm libraries also offer a register interface to let hardware vendors to register their own user space driver, which could use above helper functions to do UACCE related work.

So two mechanisms are provided to user application. User application could either access libwd or algorithm libraries. And all of these are compiled as libraries. User application could pick up appropriate libraries to link.

Based Technology

UADK relies on SVA (Shared Virtual Address) that needs to be supported by IOMMU.

In UADK framework, virtual address could be used by vendor driver and application directly. And it's actually the same virtual address, memory copy could be avoided between vendor driver and application with SVA.

UACCE user space API

As the kernel driver of UADK, UACCE offers a set of APIs between kernel and user space. UACCE is introduced in "uacce.rst" and "sysfs-driver-uacce" in kernel documents.

Hardware accelerator registers in UACCE as a char dev. At the same time, hardware informations of accelerators are also exported in sysfs node. For example, the file path of char dev is /dev/[Accel] and hardware informations are in /sys/class/uacce/[Accel]/. The same name is shared in both devfs and sysfs. The Accel is comprised of name, dash and id.

After opening this char device once, vendor driver will get a context to access the resource of this accelerator device. Vendor driver can configure above context by ioctl of this opened fd, and mmap hardware resource, like MMIO or context to user space.

Clone this wiki locally