Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24")
cmake_policy(SET CMP0135 NEW)
endif()

set(STACK_VERSION 1.8.0 CACHE STRING "Main project version")
set(STACK_VERSION 1.10.0 CACHE STRING "Main project version")
project(npu-linux-driver VERSION ${STACK_VERSION})

set(BUILD_NUMBER "dev-0" CACHE STRING "Build number composed of name and unique number used as driver version")
Expand Down
2 changes: 1 addition & 1 deletion cmake/compiler_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

add_compile_options(
# Compiler warnings
-Wall -Wextra -Werror -Wno-unused-parameter
-Wall -Wextra -Werror -Wno-unused-parameter -Wvla
# Control flow integrity
$<$<CONFIG:Release>:-fcf-protection=full>
# Format string defence
Expand Down
3 changes: 2 additions & 1 deletion cmake/packaging/setup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ if (EXISTS "/etc/debian_version")
elseif(EXISTS "/etc/portage")
set(PACKAGE_TYPE "ebuild")
else()
message(FATAL_ERROR "Unable to detect package type for this system")
message(WARNING "Unable to detect package type for this system")
return()
endif()

include(${CMAKE_CURRENT_LIST_DIR}/generators/${PACKAGE_TYPE}.cmake)
Expand Down
8 changes: 4 additions & 4 deletions compiler/compiler_source.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ endif()
include(ExternalProject)

# OpenVINO + NPU Plugin package options
set(OPENVINO_REVISION 7edb05f29487cbf5cc6a7d7ae0a8e228aac763b0)
set(VPUX_PLUGIN_REVISION 1a83394af6430a8a4a29dfc6faf50ed26594e387)
set(VPUX_PLUGIN_RELEASE npu_ud_2024_36_rc1)
set(OPENCV_REVISION 5dc1b39e4c9dfb3339e0b910f7d824a02474ceed)
set(OPENVINO_REVISION 0ebff040fd22daa37612a82fdf930ffce4ebb099)
set(VPUX_PLUGIN_REVISION 4f89b7c000d98bb8f4bf5bb058967bbd02834caa)
set(VPUX_PLUGIN_RELEASE npu_ud_2024_44_rc1)
set(OPENCV_REVISION 78195bc3dfe20b96e721ae8b32d0aa3491755e78)

# Directories
set(OPENVINO_PREFIX_DIR "${CMAKE_BINARY_DIR}/third_party/openvino")
Expand Down
44 changes: 35 additions & 9 deletions compiler/include/npu_driver_compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
extern "C" {
#endif

#define VCL_COMPILER_VERSION_MAJOR 5
#define VCL_COMPILER_VERSION_MINOR 8
#define VCL_COMPILER_VERSION_MAJOR 6
#define VCL_COMPILER_VERSION_MINOR 1
#define VCL_PROFILING_VERSION_MAJOR 2
#define VCL_PROFILING_VERSION_MINOR 0

Expand Down Expand Up @@ -69,7 +69,7 @@ typedef struct __vcl_log_handle_t* vcl_log_handle_t;

///////////////////////////////////////////////////////////////////////////////
/// @brief Defines type of requested data.
/// Must be in sync with \b _ze_graph_profiling_type_t
/// Must be in sync with _ze_graph_profiling_type_t
typedef enum __vcl_profiling_request_type_t {
VCL_PROFILING_LAYER_LEVEL = 0x1,
VCL_PROFILING_TASK_LEVEL = 0x2,
Expand Down Expand Up @@ -120,10 +120,9 @@ typedef struct __vcl_profiling_properties_t {
typedef enum __vcl_platform_t {
VCL_PLATFORM_UNKNOWN = -1,

VCL_PLATFORM_VPU3700, ///< VPU3700
VCL_PLATFORM_VPU3720, ///< NPU3720
VCL_PLATFORM_VPU4000, ///< NPU4000

VCL_PLATFORM_VPU3700 = 0, ///< VPU3700
VCL_PLATFORM_VPU3720 = 1, ///< VPU3720
VCL_PLATFORM_VPU4000 = 2, ///< VPU4000
} vcl_platform_t;

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -164,6 +163,23 @@ typedef struct __vcl_executable_desc_t {
uint64_t optionsSize; ///< Size of options
} vcl_executable_desc_t;

///////////////////////////////////////////////////////////////////////////////
/// @brief Defines query description to be passed during query network creation
///
/// Format of modelIRData (defined in L0 adaptor):
/// 1. API version : vcl_version_info_t
/// 2. Num of data elements (now only xml + weights = 2) : uint32_t
/// 3. Size of data 1 (xml) : uint64_t
/// 4. Data 1 : $2 bytes
/// 5. Size of data 2 (weights) : uint64_t
/// 6. Data 2 : $4 bytes
typedef struct __vcl_query_desc_t {
const uint8_t* modelIRData;
uint64_t modelIRSize; ///< Size of modelIRData
const char* options; ///< Compiler config options
uint64_t optionsSize; ///< Size of options
} vcl_query_desc_t;

///////////////////////////////////////////////////////////////////////////////
/// @brief Defines input that is required to create profiling handler
typedef struct __vcl_profiling_input_t {
Expand Down Expand Up @@ -196,8 +212,8 @@ VCL_APIEXPORT vcl_result_t VCL_APICALL vclCompilerGetProperties(vcl_compiler_han

///////////////////////////////////////////////////////////////////////////////
/// @brief Create an querynetwork object and return the handle
VCL_APIEXPORT vcl_result_t VCL_APICALL vclQueryNetworkCreate(vcl_compiler_handle_t compiler, uint8_t* modelIR,
uint64_t modelIRSize, vcl_query_handle_t* query);
VCL_APIEXPORT vcl_result_t VCL_APICALL vclQueryNetworkCreate(vcl_compiler_handle_t compiler, vcl_query_desc_t desc,
vcl_query_handle_t* query);

///////////////////////////////////////////////////////////////////////////////
/// @brief Retrieve result of query network
Expand All @@ -214,6 +230,16 @@ VCL_APIEXPORT vcl_result_t VCL_APICALL vclQueryNetworkDestroy(vcl_query_handle_t
VCL_APIEXPORT vcl_result_t VCL_APICALL vclExecutableCreate(vcl_compiler_handle_t compiler, vcl_executable_desc_t desc,
vcl_executable_handle_t* executable);

typedef struct __vcl_allocator_t {
uint8_t* (*allocate)(uint64_t);
void (*deallocate)(uint8_t*);
} vcl_allocator_t;

VCL_APIEXPORT vcl_result_t VCL_APICALL vclAllocatedExecutableCreate(vcl_compiler_handle_t compiler,
vcl_executable_desc_t desc,
vcl_allocator_t const* allocator,
uint8_t** blobBuffer, uint64_t* blobSize);

///////////////////////////////////////////////////////////////////////////////
/// @brief Destroys the executable and releases the cached blob.
VCL_APIEXPORT vcl_result_t VCL_APICALL vclExecutableDestroy(vcl_executable_handle_t executable);
Expand Down
4 changes: 2 additions & 2 deletions firmware/bin/vpu_37xx_v0.0.bin
Git LFS file not shown
Binary file modified firmware/bin/vpu_40xx_v0.0.bin
Binary file not shown.
19 changes: 14 additions & 5 deletions firmware/include/api/vpu_dma_hw_40xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ typedef enum {

// Number of dimensions for the dynamic task transfer
typedef enum {
DMA_DYN_NUM_DIM_DISABLED = 0, // 1D dynamic task transfer
DMA_DYN_NUM_DIM_2D, // 2D dynamic task transfer
DMA_DYN_NUM_DIM_3D, // 3D dynamic task transfer
DMA_DYN_NUM_DIM_MAX
DMA_DYN_DIM_DISABLED = 0, // No dynamic task dimensionality
DMA_DYN_DIM_2D, // Enable DESCRIPTOR.*_DIM_SIZE[1]/DESCRIPTOR.*_LIST_SIZE to be dynamic
DMA_DYN_DIM_3D, // Enable DESCRIPTOR.*_DIM_SIZE[2] to be dynamic
DMA_DYN_DIM_2D_3D, // Enable both 2D and 3D dynamic task dimensionality
DMA_DYN_DIM_MAX
} DmaDynamicDimensions;

// Burst Length Encoding
Expand Down Expand Up @@ -178,6 +179,12 @@ typedef enum {
DMA_MODE_MAX,
} DmaJobMode;

typedef enum {
DMA_CTRG_0,
DMA_CTRG_1,
DMA_CTRG_MAX,
} DmaCtrgEnum;

#pragma pack(push, 1)

#define DMA_L2CACHE_ALIGNMENT (32) // Descriptors must be 32-byte aligned
Expand Down Expand Up @@ -387,7 +394,9 @@ typedef struct ALIGN_DMA(DMA_L2CACHE_ALIGNMENT) {
uint16_t task_dyn_id; // Dynamic task phase ID
uint16_t rsvd8; // Reserved
uint32_t task_dyn_addr; // Dynamic Task address
uint64_t pad[2]; // Padding to make all descriptors 32-Byte aligned
uint32_t ptr_wr_addr; // Address used to write the Task Descriptor pointer
uint32_t rsvd9; // Reserved
uint64_t pad[1]; // Padding to make all descriptors 32-Byte aligned
} DmaDescriptor;

static_assert(sizeof(DmaDescriptor) == 192, "DmaDescriptor size != 192");
Expand Down
Loading