[spec] add skip_idu_check option
authorYelin Jeong <yelini.jeong@samsung.com>
Wed, 11 Oct 2023 08:19:33 +0000 (17:19 +0900)
committerWook Song <wook16.song@samsung.com>
Tue, 18 Mar 2025 07:28:09 +0000 (16:28 +0900)
This patch adds skip_idu_check option when build.
npu device driver does not check idu minor version when SKIP_IDU_CHECK is defined.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
meson.build
meson_options.txt
packaging/npu-engine.spec
src/core/npu/NPUdrvAPI_triv2.cc

index 6778fe331c6a6b4b63268386d57f94fa96516431..d9b13561099179e2e8afa2d546ad277b3c776fd1 100644 (file)
@@ -107,6 +107,10 @@ if get_option('enable_npu_cuse')
   add_project_arguments('-DENABLE_CUSE', language: ['c', 'cpp'])
 endif
 
+if get_option('skip_idu_check')
+  add_project_arguments('-DSKIP_IDU_CHECK', language: ['c', 'cpp'])
+endif
+
 if sysroot.startswith('/')
   sysroot_inc_cflags_template = '-I@0@/usr/include@1@'
   sysroot_inc = sysroot_inc_cflags_template.format(sysroot, '')
index 62acb8ddc26b81a76884197a8c229ad3ddc89c5e..ac18f3e10d4466edd1164042cd32b42d52e047ef 100644 (file)
@@ -14,3 +14,4 @@ option('enable_buffering', type : 'boolean', value : false)
 option('enable_plugin_npumgr', type : 'boolean', value : false)
 option('enable_plugin_nns', type : 'boolean', value : false)
 option('kernel_hdr_dir', type : 'string', value : '')
+option('skip_idu_check', type : 'boolean', value : false)
index b65fa0c6f031d7739b13415b9c374c33003c6d96..dfd8a2e1a032e9269058deb24cb0f6684c70a230 100644 (file)
@@ -61,6 +61,12 @@ BuildRequires:       nnstreamer-devel
 %define enable_plugin_nns -Denable_plugin_nns=false
 %endif
 
+%if 0%{?dtv}
+%define skip_idu_check -Dskip_idu_check=true
+%else
+%define skip_idu_check -Dskip_idu_check=false
+%endif
+
 %global debug_package %{nil}
 %global __debug_install_post %{nil}
 
@@ -76,7 +82,7 @@ meson --buildtype=plain --bindir=%{neexampledir} --prefix=%{_prefix} \
       --libdir=%{_libdir} --includedir=%{_includedir} \
       --datadir=%{_datadir} --sysconfdir=%{_sysconfdir} \
       -Dtarget_platform=tizen -Denable_data_manip=true \
-      %{enable_npu_emul} %{enable_npu_cuse} %{enable_plugin_npumgr} %{enable_plugin_nns} \
+      %{enable_npu_emul} %{enable_npu_cuse} %{enable_plugin_npumgr} %{enable_plugin_nns} %{skip_idu_check} \
       build
 ninja -C build %{?_smp_mflags}
 
index 29e3c41f72c520ac9909a67dd76ea24d7e2ae41e..fde53bf7bfcca7a7b6235f12e811d762662c23c1 100644 (file)
@@ -470,8 +470,9 @@ TrinityVision2API::registerModel (model_config_t *model_config) const {
   model_config->metadata_dbuf_fd = meta->getDbufFD ();
 #endif
 
-  /* TODO: need to set npu_version to compare with IDU version */
+#ifdef SKIP_IDU_CHECK
   model_config->npu_version = 0;
+#endif
   ret = ioctl (this->getDeviceFD (), TRINITY_IOCTL_REGISTER_MODEL, model_config);
 
 #ifdef ENABLE_CUSE