Acuity Toolkit 6.18.8 failed to export NBG model.

Issue Summary: We are encountering critical errors while using Acuity Toolkit 6.18.8 to export an OpenVX model on Linux. The failure occurs during the nbg_generate phase.

Environment:

  • OS: Ubuntu Linux (x86_64)

  • Toolkit Version: 6.18.8 (Wheel package)

  • Operation: Running export ovxlib → generates gen_nbg binary → fails at runtime or link time.

Detailed Problem Description:

We are facing a deadlock between two errors:

1. The Runtime Error (Error 32512) - The Primary Issue When running the export script normally, the tool compiles gen_nbg successfully, but fails to execute it.

  • Error Log:

    /home/.../gen_nbg: error while loading shared libraries: libOpenVX.so.1: cannot open shared object file: No such file or directory
    E Fatal model generation error: 32512
    
    
  • Analysis:

    • The file libOpenVX.so.1 exists in the SDK library path.

    • However, the pegasus.py script appears to sanitize/clear the LD_LIBRARY_PATH before launching the gen_nbg subprocess.

    • The generated binary uses RUNPATH (not RPATH), which has lower priority. Without LD_LIBRARY_PATH, the binary cannot locate libOpenVX.so.1.

2. The Linker Error (Error 512) - The Dependency Chain Issue When we attempt to workaround the runtime error by forcing libraries into the current directory or manually setting link flags, we encounter broken dependency chains.

  • Error Log:

    /usr/bin/ld: warning: libArchModelSw.so, needed by .../libOpenVX.so, not found
    /usr/bin/ld: warning: libNNArchPerf.so, needed by .../libOpenVX.so, not found
    .../libOpenVX.so: undefined reference to `archGetFlagBits'
    ...
    E Fatal model compilation error: 512
    
    
  • Analysis:

    • Even if the linker finds libOpenVX.so, it fails to find its transitive dependencies (libArchModelSw.so, libNNArchPerf.so, etc.).

    • This indicates that libOpenVX.so itself lacks proper DT_RPATH or DT_NEEDED entries to locate its own dependencies relative to itself (e.g., missing $ORIGIN settings).

To isolate the root cause, we have systematically attempted the following workarounds, but all have failed due to the SDK’s architecture:

  1. Manual Library Linking & Copying:

    • We created symbolic links and physical copies of all SDK libraries (from $VSIM_LIB and $COMMON_LIB) into the current working directory.

    • We explicitly renamed libOpenVX.so to libOpenVX.so.1 to match the SONAME requirement.

    • Result: Failed. The loader still could not resolve the transitive dependencies (e.g., libArchModelSw.so) required by libOpenVX.so once the environment variables were cleared.

  2. GCC Interception & RPATH Injection :

    • We created a wrapper script for gcc to forcibly inject -Wl,-rpath,$ORIGIN and absolute paths into the generated gen_nbg binary.

    • Result: The binary was generated with RUNPATH (instead of RPATH), which has lower priority. Since pegasus.py sanitizes LD_LIBRARY_PATH, the RUNPATH was insufficient to locate the secondary dependencies.

  3. Environment Variable Enforcement :

    • We attempted to use a wrapper script to intercept the execution of gen_nbg and force-restore the LD_LIBRARY_PATH.

    • Result: This triggered Error 512 (Linker Error). The linker found libOpenVX.so but explicitly reported libArchModelSw.so not found, confirming that the shared libraries in the SDK are missing proper self-relative paths (e.g., $ORIGIN).

  4. Diagnostic Verification :

    • Used readelf -d to confirm RUNPATH behavior.

    • Used ldd with empty environment variables to simulate the runtime failure.

    • Used a spy script to confirm pegasus.py executes in the correct directory but alters the environment.

Conclusion & Request: The current SDK package seems to have defective library linking configurations (missing RPATH/$ORIGIN support) or overly aggressive environment sanitization in pegasus.py.

Hi @t114c75035 ,

We appreciate your effort in making such detailed diagnosis report. May I check if you have completed the installation of Vivante IDE before performing the model conversion? You may follow the installation steps here if you have not done so. Kindly ensure that the additional commands are added to pegasus_export_ovx.sh too.

--optimize 'VIP8000NANONI_PID0XAD' \
--pack-nbg-unify \
--viv-sdk 'home/Acuity/VivanteIDE5.8.1.1/cmdtools' \

Thank you.

Hi Support Team,

Thank you very much for the guidance regarding the --viv-sdk path.

We have updated the path to point to the cmdtools root directory as suggested. This successfully resolved the previous Runtime Error (32512), and the script can now proceed past the initial execution phase.

Current Issue: However, we are now encountering a compilation failure (Error 512) during the nbg_generate process. The linker reports that while it can locate libOpenVX.so, it cannot find its dependencies (e.g., libArchModelSw.so), resulting in “undefined reference” errors.

Objective Observations: We investigated the library files in the SDK directory (.../vsimulator/lib/) to understand the situation. We observed that although all the required .so files exist in the same directory, the dependency chain appears to be broken when checked with ldd.

Here is the log from our investigation:

  1. Files exist in the directory :

    $ find . -name 'libOpenVX.so'
    ./sdk/VivanteIDE5.8.1.1/cmdtools/vsimulator/lib/libOpenVX.so
    $ find . -name 'libArchModelSw.so'
    ./sdk/VivanteIDE5.8.1.1/cmdtools/vsimulator/lib/libArchModelSw.so
    
    
  2. ldd shows dependencies as “not found” :

    $ ldd ./sdk/VivanteIDE5.8.1.1/cmdtools/vsimulator/lib/libOpenVX.so
        libVSC.so => not found
        libGAL.so => not found
        libArchModelSw.so => not found  <-- (Even though it exists in the same folder)
        libNNArchPerf.so => not found
    
    

Execution Parameters: For your reference, here are the arguments we are using:

python pegasus.py export ovxlib \
    --model $JSON_FILE \
    --model-data $DATA_FILE \
    --model-quantize $QUANTIZE_FILE \
    --with-input-meta $META_FILE \
    --dtype quantized \
    --output-path $EXPORT_DIR \
    --pack-nbg-unify \
    --optimize VIP9000PICOSI_PLUS_PID0XAB \
    --target-ide-project linux64 \
    --viv-sdk $VIV_SDK_ROOT

Hi @t114c75035 ,

Thanks for the update. It seems like IP name of Pro2 is incorrect in the execution parameters. Would you mind to try replacing the optimize parameter with --optimize 'VIP8000NANONI_PID0XAD' ? You may also refer to pegasus_export_ovx.sh for the example export script.

Thank you.

Hi Support Team,

Thank you for the suggestion regarding the IP name correction.

Action Taken: I have updated the script to use the suggested parameter: --optimize 'VIP8000NANONI_PID0XAD'.

Result: Unfortunately, the compilation failure (Error 512) persists unchanged. Based on the error log, the issue does not seem related to the optimization target. The linker explicitly reports that it cannot find the dependencies required by libOpenVX.so (specifically libArchModelSw.so and libNNArchPerf.so), resulting in undefined references.

Error Log:

/usr/bin/ld: warning: libArchModelSw.so, needed by .../libOpenVX.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libNNArchPerf.so, needed by .../libOpenVX.so, not found (try using -rpath or -rpath-link)
...
/usr/bin/ld: .../libOpenVX.so: undefined reference to `archGetFlagBits'
/usr/bin/ld: .../libOpenVX.so: undefined reference to `deInitOptimizeGraphInfo'
collect2: error: ld returned 1 exit status
make: *** [gen_nbg] Error 1
E Fatal model compilation error: 512

Hi @t114c75035 ,

Thank you for the feedback. We will try our best to assist you, kindly help us to verify the following items.

  1. Ensure proper installation of Acuity: pip3 show acuity
  2. Re-installation of VivanteIDE: uninstall and reinstall VivanteIDE5.8.1.1, make sure /cmdtools root directory is set correctly for –viv-sdk
  3. Use of correct optimize parameter: VIP8000NANONI_PID0XAD

I have tried your “ldd show dependencies’‘ method in my environment, it showed the same output.

I also managed to successfully export nbg model using the execution python command you provided (I just modified the parameters to suit my environment).

Thank you.

Hi Support Team,

Per your latest suggestion, I performed a clean uninstallation and re-installation of VivanteIDE 5.8.1.1. After setting up the environment again and using the correct SDK path and optimize parameters (VIP8000NANONI_PID0XAD), the model export process (nbg generation) is now executing perfectly without any errors.

It seems the root cause was indeed related to a corrupted environment or installation conflict in the previous setup.

Thank you very much for your patience and detailed assistance throughout this troubleshooting process.

1 Like