Skip to content

Commit 2574490

Browse files
mschulfejpawlakpradzynmateusztabakajwludzik
authored
NPU Driver 1.10.0 release unified 2024WW44 (#57)
New driver and test code snapshot in 1.10.0 version. Updated compiler to npu_ud_2024_44_rc1. Updated firmware to ci_tag_ud202444_vpu_rc_20241025_1830 tag. Signed-off-by: Schulfer, Magdalena <[email protected]> Co-authored-by: Pawlak, Jakub <[email protected]> Co-authored-by: Pradzynski, Krystian <[email protected]> Co-authored-by: Tabaka, Mateusz <[email protected]> Co-authored-by: Wludzik, Jozef <[email protected]>
1 parent 14d75ba commit 2574490

File tree

151 files changed

+4221
-5535
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+4221
-5535
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24")
1010
cmake_policy(SET CMP0135 NEW)
1111
endif()
1212

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

1616
set(BUILD_NUMBER "dev-0" CACHE STRING "Build number composed of name and unique number used as driver version")

cmake/compiler_flags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
add_compile_options(
1414
# Compiler warnings
15-
-Wall -Wextra -Werror -Wno-unused-parameter
15+
-Wall -Wextra -Werror -Wno-unused-parameter -Wvla
1616
# Control flow integrity
1717
$<$<CONFIG:Release>:-fcf-protection=full>
1818
# Format string defence

cmake/packaging/setup.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ if (EXISTS "/etc/debian_version")
4242
elseif(EXISTS "/etc/portage")
4343
set(PACKAGE_TYPE "ebuild")
4444
else()
45-
message(FATAL_ERROR "Unable to detect package type for this system")
45+
message(WARNING "Unable to detect package type for this system")
46+
return()
4647
endif()
4748

4849
include(${CMAKE_CURRENT_LIST_DIR}/generators/${PACKAGE_TYPE}.cmake)

compiler/compiler_source.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ endif()
1717
include(ExternalProject)
1818

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

2525
# Directories
2626
set(OPENVINO_PREFIX_DIR "${CMAKE_BINARY_DIR}/third_party/openvino")

compiler/include/npu_driver_compiler.h

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
extern "C" {
2323
#endif
2424

25-
#define VCL_COMPILER_VERSION_MAJOR 5
26-
#define VCL_COMPILER_VERSION_MINOR 8
25+
#define VCL_COMPILER_VERSION_MAJOR 6
26+
#define VCL_COMPILER_VERSION_MINOR 1
2727
#define VCL_PROFILING_VERSION_MAJOR 2
2828
#define VCL_PROFILING_VERSION_MINOR 0
2929

@@ -69,7 +69,7 @@ typedef struct __vcl_log_handle_t* vcl_log_handle_t;
6969

7070
///////////////////////////////////////////////////////////////////////////////
7171
/// @brief Defines type of requested data.
72-
/// Must be in sync with \b _ze_graph_profiling_type_t
72+
/// Must be in sync with _ze_graph_profiling_type_t
7373
typedef enum __vcl_profiling_request_type_t {
7474
VCL_PROFILING_LAYER_LEVEL = 0x1,
7575
VCL_PROFILING_TASK_LEVEL = 0x2,
@@ -120,10 +120,9 @@ typedef struct __vcl_profiling_properties_t {
120120
typedef enum __vcl_platform_t {
121121
VCL_PLATFORM_UNKNOWN = -1,
122122

123-
VCL_PLATFORM_VPU3700, ///< VPU3700
124-
VCL_PLATFORM_VPU3720, ///< NPU3720
125-
VCL_PLATFORM_VPU4000, ///< NPU4000
126-
123+
VCL_PLATFORM_VPU3700 = 0, ///< VPU3700
124+
VCL_PLATFORM_VPU3720 = 1, ///< VPU3720
125+
VCL_PLATFORM_VPU4000 = 2, ///< VPU4000
127126
} vcl_platform_t;
128127

129128
///////////////////////////////////////////////////////////////////////////////
@@ -164,6 +163,23 @@ typedef struct __vcl_executable_desc_t {
164163
uint64_t optionsSize; ///< Size of options
165164
} vcl_executable_desc_t;
166165

166+
///////////////////////////////////////////////////////////////////////////////
167+
/// @brief Defines query description to be passed during query network creation
168+
///
169+
/// Format of modelIRData (defined in L0 adaptor):
170+
/// 1. API version : vcl_version_info_t
171+
/// 2. Num of data elements (now only xml + weights = 2) : uint32_t
172+
/// 3. Size of data 1 (xml) : uint64_t
173+
/// 4. Data 1 : $2 bytes
174+
/// 5. Size of data 2 (weights) : uint64_t
175+
/// 6. Data 2 : $4 bytes
176+
typedef struct __vcl_query_desc_t {
177+
const uint8_t* modelIRData;
178+
uint64_t modelIRSize; ///< Size of modelIRData
179+
const char* options; ///< Compiler config options
180+
uint64_t optionsSize; ///< Size of options
181+
} vcl_query_desc_t;
182+
167183
///////////////////////////////////////////////////////////////////////////////
168184
/// @brief Defines input that is required to create profiling handler
169185
typedef struct __vcl_profiling_input_t {
@@ -196,8 +212,8 @@ VCL_APIEXPORT vcl_result_t VCL_APICALL vclCompilerGetProperties(vcl_compiler_han
196212

197213
///////////////////////////////////////////////////////////////////////////////
198214
/// @brief Create an querynetwork object and return the handle
199-
VCL_APIEXPORT vcl_result_t VCL_APICALL vclQueryNetworkCreate(vcl_compiler_handle_t compiler, uint8_t* modelIR,
200-
uint64_t modelIRSize, vcl_query_handle_t* query);
215+
VCL_APIEXPORT vcl_result_t VCL_APICALL vclQueryNetworkCreate(vcl_compiler_handle_t compiler, vcl_query_desc_t desc,
216+
vcl_query_handle_t* query);
201217

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

233+
typedef struct __vcl_allocator_t {
234+
uint8_t* (*allocate)(uint64_t);
235+
void (*deallocate)(uint8_t*);
236+
} vcl_allocator_t;
237+
238+
VCL_APIEXPORT vcl_result_t VCL_APICALL vclAllocatedExecutableCreate(vcl_compiler_handle_t compiler,
239+
vcl_executable_desc_t desc,
240+
vcl_allocator_t const* allocator,
241+
uint8_t** blobBuffer, uint64_t* blobSize);
242+
217243
///////////////////////////////////////////////////////////////////////////////
218244
/// @brief Destroys the executable and releases the cached blob.
219245
VCL_APIEXPORT vcl_result_t VCL_APICALL vclExecutableDestroy(vcl_executable_handle_t executable);

firmware/bin/vpu_37xx_v0.0.bin

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:d0639a72240b89d37e827d89edb3f13f0c995a5b7d8a28e5e48ca326bf4effad
3-
size 2485040
2+
oid sha256:2600c098d22d49531edd263c6720e9e385d68ffbd1c87f36d7db86dbf381328a
3+
size 2428000

firmware/bin/vpu_40xx_v0.0.bin

-105 KB
Binary file not shown.

firmware/include/api/vpu_dma_hw_40xx.h

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ typedef enum {
6262

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

7172
// Burst Length Encoding
@@ -178,6 +179,12 @@ typedef enum {
178179
DMA_MODE_MAX,
179180
} DmaJobMode;
180181

182+
typedef enum {
183+
DMA_CTRG_0,
184+
DMA_CTRG_1,
185+
DMA_CTRG_MAX,
186+
} DmaCtrgEnum;
187+
181188
#pragma pack(push, 1)
182189

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

393402
static_assert(sizeof(DmaDescriptor) == 192, "DmaDescriptor size != 192");

0 commit comments

Comments
 (0)