aboutsummaryrefslogtreecommitdiff
path: root/driver_library
AgeCommit message (Collapse)Author
2024-04-04Add IOCTL command names to driver library loggingMikael Olsson
Currently the driver library will log IOCTL commands as hexadecimal values, which makes it hard to know what command is being logged unless you know the command values. To make this easier, the driver library will now translate the command values into their respective names when logging. Change-Id: I7ef2f411b0261ea7819c1a7a6825422859031a25 Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
2024-02-21Fix UAPI device type naming and validationMikael Olsson
The device types in the UAPI have been renamed to follow the UAPI namespacing and driver library validation has been added to ensure the driver library and UAPI device enum values match. The kernel and driver library version have been given a major bump for the introduction of the device type in the capabilities. Change-Id: Ib782b0bd7a8641db88521f8be399f709d2d73816 Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
2024-02-19Add NPU device type to capabilitiesMikael Olsson
In preparation to support the Linux kernel driver directly managing the NPU without a subsystem. A NPU device type has been added to the capabilities to be able to specify what kind of NPU is used. Change-Id: I45345b7d75d234f821d70b858453d3af2a99194e Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
2023-12-20Change PMU event counter values to use 64-bitMikael Olsson
The PMU event counter value is an accumulation of 32-bit values during the inference and to ensure the total value fits in the rpmsg message and UAPI, the variable holding the value has been changed to 64-bit. The driver library, Python wrapper and inference runner have been changed accordingly to support the 64-bit values. Change-Id: I09a8e45eb75800c8a787f83abff5a3693148cc15 Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
2023-11-06Change create network UAPI to take a user bufferMikael Olsson
To not allow the buffer for a network instance to be changed after creation, the create network UAPI will now take the network model data as a user buffer. The content of the user buffer is copied into an internally allocated DMA buffer that cannot be accessed by the user. This breaks the current API so the Linux kernel NPU driver version and the driver library version have been given major version bumps. All the tests, documentation and other applications affected by the changes have been updated accordingly. Change-Id: I25c785d75a24794c3db632e4abe5cfbb1c7ac190 Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
2023-11-06Remove buffer capacity, offset and resize in UAPIMikael Olsson
The UAPI no longer supports the buffer capacity, offset and resize functionality. Instead, the UAPI now only accepts a fixed size given at the creation of the buffer. This change was made because the features were not used and made the buffer handling more complicated. The user knows how big buffers they need for their networks so they don't need resize support or partial buffer usage support by having separate size and capacity with an offset. Without these features, the buffer instance no longer needs any IOCTL call support so it has been removed. However, to still be able to check the size of a buffer from its file descriptor, seek support has been implemented so lseek and similar functions can be used to get the size. The driver library's clear function that previously only reset the size and offset values of the buffer will now clear the buffer content instead. These are breaking changes so the Linux kernel NPU driver version and the driver library version have been given major version bumps. All the tests and other applications affected by these changes have been updated accordingly. Change-Id: Ifc34cf04724a95853ad23fd7398dd286f73bcdab Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
2023-08-16Add command and error to IOCTL failure exceptionMikael Olsson
When an IOCTL call fails in the driver library, the failure exception only states "IOCTL failed" without any further information. To make it easier to see what IOCTL call failed and why, the exception will now include the command that failed and the reason for the failure. Change-Id: Ife4957d2c0d692b3fcdbdc72538690d50385d365 Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
2023-08-09Add version to driver library23.08-rc1Mikael Olsson
A version has been added to the driver library so users can check if they are compatible with the driver library in use. The Python wrapper has been updated accordingly to make the version information available. Change-Id: I8affbf7068c057f7103adf14c9e4a331d547fbcc Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
2023-08-09Add kernel driver version check in driver libraryMikael Olsson
The driver library will now check that it's compatible with the kernel driver in use by checking the kernel driver's version. The kernel driver version has also been made available to the library users and the Python wrapper has been updated accordingly. Change-Id: Ieae8c0bfc323f945038e7264eceeab90c833f76d Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
2023-04-20Fix compiler flag passing in Python API CMake file23.05-rc1Mikael Olsson
To support cross-compilation of the driver library Swig C wrapper for the Python API, the CMake file must pass on the C and CXX flags that have been setup by the build environment so that the correct flags, include paths etc are used when building the wrapper. Change-Id: I6288016056c5a4eeef1162ea2a9afb1e3ab4b86a
2023-04-20Fix Python API CMake file ETHOS_U_DRIVER_LIB pathMikael Olsson
The ETHOS_U_DRIVER_LIB environment variable in the Python API CMake file specifies that the driver library archive will be found in a lib subdirectory in the build directory. This is incorrect as the archive will be put directly into the driver library directory and the CMake file has been updated accordingly. Change-Id: Ie296f89f7669d69f193d96d994ad8e1918e3d1eb
2023-04-20Fix license file path in Python API CMake fileMikael Olsson
The CMake file for the Python API, currently fails to copy the license file to the build directory because it incorrectly assumes that the file is in the Python API folder. The license file that should be used is in the top of the repository and the CMake file has been updated accordingly. Change-Id: Ia0131cc27abdf28d355c69a556229691901971e5
2022-10-25Added Python interface for Arm Ethos-U NPU driver library.22.11-rc1Kshitij Sisodia
Python `ethosu_driver` could be built as part of Arm Ethos-U Linux driver library CMake flow. See driver_library/python/README.md for more details. Change-Id: I177a890add5c13df9a839f4f43621f972afe5ab1 Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
2022-08-29Add linux_driver_stack testsDavide Grohmann
Change-Id: I303f1424eb46576847312672f7ed5ac03c05aee1
2022-06-30Improved logging22.08-rc222.08-rc122.08Kristofer Jonsson
Add logging class for driver library. Log severity can be configured using an environment variable. Add information to prints in kernel space. Change-Id: I19a1078869733746726515a6cafb79110314066d
2022-05-05Add support for inference cancellationDavide Grohmann
Send cancel inference messages to the ethosu subsystem to abort inference execution there. Also mark inference as aborted in the linux driver stack itself, so pending inference messages are not resent when resetting the firmware. Change-Id: I244c2b119fd7995d14e3859815abf2a00c7f0583
2022-05-02Add support for rejected inference responsesDavide Grohmann
Change-Id: I62e13df69c712ed4cf70766429b4cb13fc9c9dcb
2022-04-26Fix: always close fd when destructing buffersDavide Grohmann
Also always rethrow exceptions not swallow them Change-Id: I7a4b1e408858aa0d0128ca7bd6d6a7715662f9fb
2022-04-12Drop tflite and flatbuffer dependenciesDavide Grohmann
There is not real need for the linux_driver_stack to know about tflite and flatbuffers. A better approach is to just pass the buffer to the firmware to be processes, i.e., either parsed or executed. This solves issues when linux_driver_stack and firmware are not in sync with the same library versions. Change-Id: I9b2a12e69f37f61b1ac594433a15883fb1c67b9c
2022-03-14Network infoKristofer Jonsson
Add UAPI and core message that allows user space space to fetch information about network models built into the firmware. Change-Id: Ic92529bce3edd0a5499e691a566bd065da2a72ad
2022-03-10Firmware resident modelKristofer Jonsson
Support referencing a network model by index that has been built into the firmware binary. Change-Id: Idd5294376ea82503dfeafe1203dcc0694d296dfe
2022-01-17Updating tflite schema22.02-rc322.02-rc222.02-rc122.02Kristofer Jonsson
Change-Id: Iaf878efcbe42d7a658a76db868806114df9e4b27
2021-12-14const:ify userspace driver libraryPer Åstrand
Change-Id: I965a6f4c42fca1b3b4493e7eef3cbb75e236fe3a
2021-11-23Add support for int32 in inference_runner21.11Henrik Hoglind
Change-Id: Ic4605a22547ab797c638bfddd9719c69d495da75
2021-11-15Fix: do not leak file descriptors on errorsDavide Grohmann
When bailing out on errors in the constructors of Buffers or Networks, the open file descriptor should be closed since the descructor will never be called. Change-Id: I8e1954e9efd65b594cc9544e18d0bfbe0730f156
2021-10-27Improve granularity of wait call in Inference classDavide Grohmann
It now accepts a timeout expressed in nanoseconds. Change-Id: I77fb89c33dc117f846b86494883548ef3241f0ab
2021-10-20Fix: e-functions should throw an exception on errorDavide Grohmann
Change-Id: I99d77bf528ea7c6b7d444c24f6f7b712b281b181
2021-09-06Correct timescale of sleep for stubPer Åstrand
Change-Id: Idc818453362bd3cd4d1c35e1e2d1a9f0ccd7a0a6
2021-08-23Add weak linkage attributes for stubbing21.08-rc2Per Åstrand
Add weak linkage attribute to underlying kernel module and filedescriptors to be able to replace with stub methods together with an example stub implementation. Change-Id: I766c51fceede7df16c599bd9f1874e31c264776d
2021-08-13Do not expose device specific hw config in capabilities21.08-rc1Davide Grohmann
Change-Id: Ia90e2d74c3e071c6e3de381cfada9a5a155d7529
2021-06-10Add support for handling capabilities requestsDavide Grohmann
Change-Id: Id5aa197312c88b0c448dc085d8477ed67da24724
2021-04-12Add nullptr checks21.05-rc321.05-rc221.05Jonny Svärd
Change-Id: Ie76db24dec03a6b45c64070d89a83805397d2f1f
2021-03-31Update license headersAnton Moberg
Update all license headers to the correct years. Change-Id: Ie1aee82af91c744a3cdb949044334ade0d834c16
2021-03-25Add support for float32 in inference_runnerHenrik Hoglind
Change-Id: I1c618be058863a3a2457a849e70b22851aa91b3a
2020-11-2616 bit network support20.11Kristofer Jonsson
Change-Id: I65cd027dea115d2f50f302ebe997d6d2525e0d7e
2020-11-16Add APIs for PMU configuration in libraryPer Åstrand
Change-Id: I7694ab9dd5ff20c29feb0506bcf36a1cf4983243
2020-10-20Removing uapi/ethosu.h from ethosu.hppKristofer Jonsson
Change-Id: I535e4c9297cf0890fa1cb4f2d8b7cad7e0b4ee39
2020-10-16Clang formatKristofer Jonsson
Change-Id: I2ebac7df9c4716be7fee10ce4cba350e40860ca2
2020-09-17Support inferences with multiple inputs and outputsKristofer Jonsson
Build flatbuffers library. Update network class to extract IFM and OFM dimensions from the tflite file. Update the uapi and core apis to support up to 16 IFM and OFM buffers per inference. Change-Id: I2f2f177aa4c2d5f9f50f23eb33c44e01ec2cbe09
2020-08-27Initial commit20.08-rc220.08Kristofer Jonsson
Change-Id: I14b6becc908a0ac215769c32ee9c43db192ae6c8