Skip to content

Conversation

@anyj0527
Copy link
Member

@anyj0527 anyj0527 commented Aug 26, 2025

Commit by @abhajaswal

  • Add functionality to read ADSP library path from configuration file or use default path.
  • The change includes a helper function to trim strings and a new function to set the ADSP_LIBRARY_PATH environment variable.
  • This ensures the SNPE backend can properly locate necessary libraries for hardware acceleration.

@anyj0527 anyj0527 requested a review from a team as a code owner August 26, 2025 05:06
Copy link

@songgot songgot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@abhajaswal
Copy link

I added similar patch my end and tested : works well my end

Logs like below appear, we can reduce logs if needed?

root@Samsung-FamilyHub:/media/SDCardA1/ml-api/snpe-object-detection-yolov8#
onf 5 100 1ection-yolov8-example yolov8m_416_quantized.dlc.pipeline.appsrc.jpg.co
** INFO: 19:42:54.036: Hello, ML API yolov8 example!
** INFO: 19:42:54.038: Got conf file: yolov8m_416_quantized.dlc.pipeline.appsrc.jpg.conf
** INFO: 19:42:54.038: Got total input frame number: 5
** INFO: 19:42:54.038: Got sleep time between input in ms: 100
** INFO: 19:42:54.039: Use jpg file as input (value: 1) or raw file (pre-processed) as input (value: 0): 1
** (snpe-object-detection-yolov8-example:9832): DEBUG: 19:42:54.228: Using path from configuration file: [/hal/lib/dsp;/dsp/]

** (snpe-object-detection-yolov8-example:9832): DEBUG: 19:42:54.228:
Final ADSP_LIBRARY_PATH to set: /hal/lib/dsp;/dsp/

** (snpe-object-detection-yolov8-example:9832): DEBUG: 19:42:54.228: setenv result: 1, ADSP_LIBRARY_PATH=/hal/lib/dsp;/dsp/

** (snpe-object-detection-yolov8-example:9832): DEBUG: 19:42:54.240: Using path from configuration file: [/hal/lib/dsp;/dsp/]

** (snpe-object-detection-yolov8-example:9832): DEBUG: [ 302.451995@6] adsprpc: fastrpc_mem_map_to_dsp failed. err 0x80000414 fd -1 len 0x19000
19:42:54.240:
Final ADSP_LIBRARY_PATH to set: /hal/lib/dsp;/dsp/

** (snpe-object-detection-yolov8-example:9832): DEBUG: 19:42:54.240: setenv result: 1, ADSP_LIBRARY_PATH=/hal/lib/dsp;/dsp/

** INFO: 19:42:54.241: SNPE Version: 2.26.0.240827110523_99241

** (snpe-object-detection-yolov8-example:9832): WARNING **: 19:42:54.241: Unknown option (backend:snpe).
** INFO: 19:42:54.241: Add output tensor name of /model.22/Sigmoid_output_0
** INFO: 19:42:54.242: Add output tensor name of /model.22/Mul_output_0
/prj/qct/webtech_hyd18/mlg_user_admin/qaisw_source_repo/qaisw_repo_release/snpe_src/avante-tools/prebuilt/dsp/hexagon-sdk-4.1.0/ipc/fastrpc/rpcmem/src/rpcmem_android.c:38:dummy call to rpcmem_init, rpcmem APIs will be used from libxdsprpc
** INFO: 19:42:54.341: Given runtime dsp_fixed8_tf is available
** INFO: 19:42:55.285: confidence_threshold: 0.300000
** INFO: 19:42:55.286: iou_threshold: 0.600000

[Abha Jaswal (Abha)] 08-26-2025 11:14
** (snpe-object-detection-yolov8-example:9832): WARNING **: 19:42:55.290: Loaded image label file successfully. 80 labels loaded.
** INFO: 19:42:55.468: probBox size: 1135680, expected: 1135680
** INFO: 19:42:55.468: infoBox size: 56784, expected: 56784
** INFO: 19:42:55.472: 0-th object[bed]: 0, 209, 109, 143, 0.857062
** INFO: 19:42:55.472: 1-th object[chair]: 263, 222, 55, 114, 0.857062
** INFO: 19:42:55.472: 2-th object[person]: 126, 2, 137, 385, 0.768666
** INFO: 19:42:55.472: -----------------------------------
** INFO: 19:42:55.555: probBox size: 1135680, expected: 1135680
** INFO: 19:42:55.555: infoBox size: 56784, expected: 56784
** INFO: 19:42:55.559: 0-th object[giraffe]: 245, 124, 137, 222, 0.933929
** INFO: 19:42:55.559: 1-th object[giraffe]: 70, 162, 68, 180, 0.857062
** INFO: 19:42:55.559: 2-th object[giraffe]: 21, 205, 42, 141, 0.830159
** INFO: 19:42:55.559: -----------------------------------
** INFO: 19:42:55.642: probBox size: 1135680, expected: 1135680
** INFO: 19:42:55.642: infoBox size: 56784, expected: 56784
** INFO: 19:42:55.646: -----------------------------------
** INFO: 19:42:55.727: probBox size: 1135680, expected: 1135680
** INFO: 19:42:55.727: infoBox size: 56784, expected: 56784
** INFO: 19:42:55.731: 0-th object[truck]: 212, 241, 42, 95, 0.641836
** INFO: 19:42:55.731: 1-th object[truck]: 179, 273, 63, 105, 0.541909
** INFO: 19:42:55.731: 2-th object[stop sign]: 280, 160, 24, 53, 0.491946
** INFO: 19:42:55.731: 3-th object[car]: 267, 278, 24, 36, 0.491946
** INFO: 19:42:55.731: 4-th object[person]: 283, 280, 15, 82, 0.491946
** INFO: 19:42:55.731: 5-th object[car]: 68, 273, 26, 82, 0.491946
** INFO: 19:42:55.731: -----------------------------------
** INFO: 19:42:55.803: Exit this app...
** INFO: 19:42:55.803: Duration: 512405 us (0.512405 sec)
** INFO: 19:42:55.803: total input: 5, 9.757907 fps
** INFO: 19:42:55.803: Total output: 4, throughput 7.806325 fps, Latency (1/throughput) : 128.101257 ms

above logs also look fine

@anyj0527 anyj0527 force-pushed the snpe-set-env-var branch 2 times, most recently from e6585e6 to 70b4704 Compare August 26, 2025 06:05
@anyj0527
Copy link
Member Author

@abhajaswal I removed most logging. PTAL

- Add functionality to read ADSP library path from configuration file or use default path.
- The change includes a helper function to trim strings and a new function to set the ADSP_LIBRARY_PATH environment variable.
- This ensures the SNPE backend can properly locate necessary libraries for hardware acceleration.

Signed-off-by: Yongjoo Ahn <[email protected]>
Co-Authored-By: Abha Jaswal <[email protected]>
Copy link

@again4you again4you left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@abhajaswal
Copy link

LGTM, with and without ini file the test is done on tizen 10.0 image

without init:
root@Samsung-FamilyHub:/media/SDCardA1/ml-api/snpe-object-detection-yolov8# ** INFO: 18:07:28.466: Hello, ML API yolov8 example!

** INFO: 18:07:29.389: Checking for ADSP_LIBRARY_PATH configuration file: /hal/etc/snpe/dsp/adsp_library_path.ini
** INFO: 18:07:29.390: Using default ADSP_LIBRARY_PATH
** INFO: 18:07:29.390: Set ADSP_LIBRARY_PATH=/hal/lib/dsp;/dsp
** INFO: 18:07:29.403: Checking for ADSP_LIBRARY_PATH configuration file: /hal/etc/snpe/dsp/adsp_library_path.ini
** INFO: 18:07:29.403: Using default ADSP_LIBRARY_PATH
** INFO: 18:07:29.403: Set ADSP_LIBRARY_PATH=/hal/lib/dsp;/dsp
** INFO: 18:07:29.405: SNPE Version: 2.26.0.240827110523_99241

with ini:

root@Samsung-FamilyHub:/media/SDCardA1/ml-api/snpe-object-detection-yolov8# ** INFO: 18:09:50.452: Hello, ML API yolov8 example!
** INFO: 18:09:50.711: Checking for ADSP_LIBRARY_PATH configuration file: /hal/etc/snpe/dsp/adsp_library_path.ini
** INFO: 18:09:50.711: Set ADSP_LIBRARY_PATH=/hal/lib/dsp;/dsp/
** INFO: 18:09:50.727: Checking for ADSP_LIBRARY_PATH configuration file: /hal/etc/snpe/dsp/adsp_library_path.ini
** INFO: 18:09:50.727: Set ADSP_LIBRARY_PATH=/hal/lib/dsp;/dsp/
** INFO: 18:09:50.729: SNPE Version: 2.26.0.240827110523_99241

** (snpe-object-detection-yolov8-example:14999): WARNING **: 18:09:50.729: Unknown option (backend:snpe).
** INFO: 18:09:50.729: Add output tensor name of /model.22/Sigmoid_output_0
** INFO: 18:09:50.729: Add output tensor name of /model.22/Mul_output_0
/prj/qct/webtech_hyd18/mlg_user_admin/qaisw_source_repo/qaisw_repo_release/snpe_src/avante-tools/prebuilt/dsp/hexagon-sdk-4.1.0/ipc/fastrpc/rpcmem/src/rpcmem_android.c:38:dummy call to rpcmem_init, rpcmem APIs will be used from libxdsprpc
** INFO: 18:09:50.840: Given runtime dsp_fixed8_tf is available
** INFO: 18:09:51.971: ml_snpe_configure_instance--
** INFO: 18:09:51.971: ml_snpe_get_framework_info ++
** INFO: 18:09:51.972: ml_snpe_get_framework_info --
** INFO: 18:09:51.972: ml_snpe_get_model_info ++
** INFO: 18:09:51.982: confidence_threshold: 0.300000
** INFO: 18:09:51.983: iou[ 589.170980@0] vlogger: vlogutil(15035) open vlogger from dump_systemstat(14933)

@anyj0527 anyj0527 merged commit 65874bf into nnstreamer:main Aug 26, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants