Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for newer Snapdragon DSP (v73) architectures #8122

Open
adarsh044 opened this issue Feb 25, 2024 · 1 comment
Open

Support for newer Snapdragon DSP (v73) architectures #8122

adarsh044 opened this issue Feb 25, 2024 · 1 comment

Comments

@adarsh044
Copy link

I am trying to run the blur example given in the source code both on the simulator and an actual device target the Hexagon DSP (8+ Gen 1 , DSP V73) .

I have built LLVM , Halide from source following the given instructions in the readme.

Built LLVM :

% cmake -DCMAKE_BUILD_TYPE=Release \ -DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra" \ -DLLVM_TARGETS_TO_BUILD="X86;ARM;NVPTX;AArch64;Hexagon;WebAssembly;RISCV" \ -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_ASSERTIONS=ON \ -DLLVM_ENABLE_EH=ON -DLLVM_ENABLE_RTTI=ON -DLLVM_BUILD_32_BITS=OFF \ -DLLVM_ENABLE_RUNTIMES="compiler-rt" \ -S llvm-project/llvm -B llvm-build % cmake --build llvm-build % cmake --install llvm-build --prefix llvm-install

Built Halide using make

I followed the following to setup the blur application:

To build and run an example app using the Hexagon target,

  1. Obtain and build trunk LLVM and Clang. (Earlier versions of LLVM may work but
    are not actively tested and thus not recommended.)
  2. Download and install the Hexagon SDK and Hexagon Tools. Hexagon SDK 4.3.0 or
    later is needed. Hexagon Tools 8.4 or later is needed.
  3. Build and run an example for Hexagon HVX

Versions : LLVM (tried with both 16.x and 17.x) , Halide (16.0.0) , Hexagon SDK (5.5.01) , Hexagon Tools (8.7.06) .

When I try the following commands to run it on the simulator , it rightlly targets the DSP and runs the application on it.
I confirmed this by adding logs in the test.cpp present in the application.

cd apps/blur export HL_HEXAGON_SIM_REMOTE=../../src/runtime/hexagon_remote/bin/v65/hexagon_sim_remote export HL_HEXAGON_TOOLS=$SDK_LOC/Hexagon_Tools/8.x/Tools/ LD_LIBRARY_PATH=../../src/runtime/hexagon_remote/bin/host/:$HL_HEXAGON_TOOLS/lib/iss/:. HL_TARGET=host-hvx make test

Where as when i run the following commands to run it on the actual hardware described in the header , the application does not run on the DSP , rather on the CPU.

export HL_HEXAGON_TOOLS=$SDK_LOC/HEXAGON_Tools/8.4.11/Tools/ HL_TARGET=arm-64-android-hvx ./adb_run_on_device.sh

I want to understand , what can I do to force the application to run on the DSP on the actual phone. Is it due to that the current verisons of Halide do not support the V73 architecture or something else.

Note: It is to be noted that the phone I am using is not a rooted, but I don't see any instructions that the phone should be rooted to run the application.

Would be a great help , if I could be pointed in a particular direction.

Thanks for the help.

@PureHing
Copy link

PureHing commented Mar 6, 2024

Do you use halide for image processing on hvx of v73? Is it faster than Qualcomm's original hvx_cv?

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

No branches or pull requests

2 participants