1.0 KiB · text History c20d4f7
--- a/examples/multimodal_model_demo/deploy/src/main.cpp	2026-08-25 11:41:05.799461096 -0400
+++ b/examples/multimodal_model_demo/deploy/src/main.cpp	2026-08-25 11:41:05.829457680 -0400
@@ -119,6 +119,18 @@
         return -1;
     }
 
+    // DMS: let the caller pin inference to specific CPUs. rkllm's default
+    // mask assumes an 8-core RK3588; boards with fewer online cores (the
+    // 6-core CM5 here: 4x A55 + 2x A76) fail rkllm_init with "Mismatch
+    // between enabled CPUs mask and expected count". The runtime also
+    // requires enabled CPUs >= rknn_core_num.
+    if (const char* env_num = getenv("RKLLM_ENABLED_CPUS_NUM")) {
+        param.extend_param.enabled_cpus_num = (int8_t)atoi(env_num);
+    }
+    if (const char* env_mask = getenv("RKLLM_ENABLED_CPUS_MASK")) {
+        param.extend_param.enabled_cpus_mask = (uint32_t)strtoul(env_mask, NULL, 0);
+    }
+
     const char* img_start   = "<|vision_start|>";
     const char* img_end     = "<|vision_end|>";
     const char* img_content = "<|image_pad|>";