Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions DEVELOPMENT-GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,29 @@ The library includes several specialized backend implementations:
- All power metrics measured in milliwatts (mW)
- Provides average power consumption over sampling period

#### DSP NPU Backend (Linux ARM64)
- Collects performance metrics from the Qualcomm CDSP/NPU hardware via FastRPC
- Provides Q6 utilization, Q6 clock, HVX utilization, and HMX utilization metrics
- Communicates with the DSP using the `sysmonquery` interface over FastRPC

##### Runtime Dependency: `libcdsprpc.so`

The DSP NPU backend requires `libcdsprpc.so` to be present on the target device at runtime. This library is part of the Qualcomm BSP (Board Support Package) and provides the FastRPC transport used to communicate with the CDSP.

> **Note:** `libcdsprpc.so` is **not** built from source — the build system compiles a stub (`cdsprpc_stub.c`) that satisfies the linker at compile time. The real `libcdsprpc.so` must be present on the device at runtime, typically at `/usr/lib/libcdsprpc.so`.

**What happens if `libcdsprpc.so` is missing:**

| Scenario | Behavior |
|----------|----------|
| `libcdsprpc.so` absent from device | Dynamic linker fails to load the application — process does not start. No graceful fallback. |
| `libcdsprpc.so` present, but CDSP inaccessible | `qcom_dsp_init()` returns a non-success error code. `dsp_npu_init()` reports the failure via the message callback at `QC_PERF_MESSAGE_LEVEL_ERROR` and returns `QC_PERF_RETURN_CODE_FAILED`. |

**Recommendation:** Before running an application that uses the DSP NPU backend, verify the library is present on the device:
```bash
ls /usr/lib/libcdsprpc.so
```

---

## Adding New Backends
Expand Down
14 changes: 11 additions & 3 deletions qcperf/backends/qcom-dsp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@ add_library(QcPerfQcomDsp STATIC

add_library(cdsprpc SHARED
src/cdsprpc_stub.c


)

# libcdsprpc.so is a BSP runtime dependency on the target device.
# This stub exists only to satisfy the linker at build time; it must not
# be included in the deliverable package. Redirect it to a separate
# directory so it cannot be mistaken for a real output artifact.
set_target_properties(cdsprpc PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/link-stubs"
)

target_include_directories(QcPerfQcomDsp PUBLIC
target_include_directories(QcPerfQcomDsp PUBLIC
inc
)

target_include_directories(cdsprpc PUBLIC
target_include_directories(cdsprpc PUBLIC
inc
)

Expand Down
Loading