diff --git a/apps/hexagon_benchmarks/process.cpp b/apps/hexagon_benchmarks/process.cpp
index 975bf8aa2da4..6d6229a94f3f 100644
--- a/apps/hexagon_benchmarks/process.cpp
+++ b/apps/hexagon_benchmarks/process.cpp
@@ -45,6 +45,11 @@ int main(int argc, char **argv) {
     std::vector<PipelineDescriptorBase *> pipelines = {&conv3x3a16_pipeline, &dilate3x3_pipeine, &median3x3_pipeline,
                                                        &gaussian5x5_pipeline, &sobel_pipeline, &conv3x3a32_pipeline};
 
+#ifdef HALIDE_RUNTIME_HEXAGON
+    // Set thread_priority = 80 and stack_size = 32KB for dsp threads.
+    halide_hexagon_set_thread_params(NULL, 80, 32 * 1024);
+#endif
+
     for (PipelineDescriptorBase *p : pipelines) {
         if (!p->defined()) {
             continue;
diff --git a/src/runtime/HalideRuntimeHexagonHost.h b/src/runtime/HalideRuntimeHexagonHost.h
index ff0092ffd111..88fb32c64961 100644
--- a/src/runtime/HalideRuntimeHexagonHost.h
+++ b/src/runtime/HalideRuntimeHexagonHost.h
@@ -118,16 +118,18 @@ extern int halide_hexagon_set_performance_mode(void *user_context, halide_hexago
 extern int halide_hexagon_set_performance(void *user_context, halide_hexagon_power_t *perf);
 // @}
 
-/** Set the default priority for Halide Hexagon user threads:
- *   - Valid priority values range from 1 to 255
+/** Set the default priority/stack_size for dsp threads:
+ *   - Valid priority values range from 1 to 255. -1 to use default (100)
+ *   - Stack size in bytes. Range: (16KB - 8MB). -1 to use default (16KB)
  *   - Smaller number for higher priority
  *   - The highest priority for a user thread is 1
  *   - Priority 0 is reserved for OS usage
- * If this routine is not called, the priority will default to 100.
- * This is intended to be called before dispatching any pipeline. */
-// @{
-extern int halide_hexagon_set_thread_priority(void *user_context, int priority);
-// @}
+ * If halide_hexagon_set_thread_params routine is not called by the user,
+ * then it is called automatically during  init_hexagon_runtime with
+ * priority=100 and stack size=16KB. It should be called before
+ * making any other FastRPC calls (because remote_session_control has to be
+ * the first fastRPC call made by the program). */
+extern int halide_hexagon_set_thread_params(void *user_context, int priority, int stack_size);
 
 /** These are forward declared here to allow clients to override the
  *  Halide Hexagon runtime. Do not call them. */
diff --git a/src/runtime/hexagon_host.cpp b/src/runtime/hexagon_host.cpp
index 00f5cfeba9a2..957b70a90db9 100644
--- a/src/runtime/hexagon_host.cpp
+++ b/src/runtime/hexagon_host.cpp
@@ -10,6 +10,20 @@ namespace Runtime {
 namespace Internal {
 namespace Hexagon {
 
+#define FASTRPC_THREAD_PARAMS (1)
+#define CDSP_DOMAIN_ID 3
+
+static const int default_thread_priority = 100;
+static const int default_stack_size = 16 * 1024;  // 16KB
+static int set_thread_params_called = false;
+
+// Used with FASTRPC_THREAD_PARAMS req ID
+struct remote_rpc_thread_params {
+    int domain;      // Remote subsystem domain ID, pass -1 to set params for all domains
+    int prio;        // user thread priority (1 to 255), pass -1 to use default
+    int stack_size;  // user thread stack size, pass -1 to use default
+};
+
 struct ion_device_handle {
     void *buffer;
     size_t size;
@@ -39,7 +53,8 @@ typedef int (*remote_profiler_set_current_func_fn)(int);
 typedef int (*remote_power_fn)();
 typedef int (*remote_power_mode_fn)(int);
 typedef int (*remote_power_perf_fn)(int, unsigned int, unsigned int, int, unsigned int, unsigned int, int, int);
-typedef int (*remote_thread_priority_fn)(int);
+typedef int (*remote_set_thread_params_fn)(int, int);
+typedef int (*remote_session_control_fn)(uint32_t req, void *data, uint32_t datalen);
 
 typedef void (*host_malloc_init_fn)();
 typedef void *(*host_malloc_fn)(size_t);
@@ -56,7 +71,8 @@ WEAK remote_power_fn remote_power_hvx_on = nullptr;
 WEAK remote_power_fn remote_power_hvx_off = nullptr;
 WEAK remote_power_perf_fn remote_set_performance = nullptr;
 WEAK remote_power_mode_fn remote_set_performance_mode = nullptr;
-WEAK remote_thread_priority_fn remote_set_thread_priority = nullptr;
+WEAK remote_set_thread_params_fn remote_set_thread_params = nullptr;
+WEAK remote_session_control_fn remote_thread_session_control = nullptr;
 
 WEAK host_malloc_init_fn host_malloc_init = nullptr;
 WEAK host_malloc_init_fn host_malloc_deinit = nullptr;
@@ -183,10 +199,17 @@ WEAK int init_hexagon_runtime(void *user_context) {
     get_symbol(user_context, host_lib, "halide_hexagon_remote_power_hvx_off", remote_power_hvx_off, /* required */ false);
     get_symbol(user_context, host_lib, "halide_hexagon_remote_set_performance", remote_set_performance, /* required */ false);
     get_symbol(user_context, host_lib, "halide_hexagon_remote_set_performance_mode", remote_set_performance_mode, /* required */ false);
-    get_symbol(user_context, host_lib, "halide_hexagon_remote_set_thread_priority", remote_set_thread_priority, /* required */ false);
+    get_symbol(user_context, host_lib, "halide_hexagon_remote_set_thread_params", remote_set_thread_params, /* required */ false);
+    get_symbol(user_context, host_lib, "remote_session_control", remote_thread_session_control, /* required */ false);
 
     host_malloc_init();
 
+    // Needs to be the first fastRPC call.
+    if (!set_thread_params_called) {
+        halide_hexagon_set_thread_params(nullptr, default_thread_priority,
+                                         default_stack_size);
+    }
+
     return 0;
 }
 
@@ -247,9 +270,9 @@ WEAK int halide_hexagon_initialize_kernels(void *user_context, void **state_ptr,
                         << ", state_ptr: " << state_ptr
                         << ", *state_ptr: " << *state_ptr
                         << ", code: " << code
-                        << ", code_size: " << (int)code_size << ")\n"
-                        << ", code: " << runtime
-                        << ", code_size: " << (int)runtime_size << ")\n";
+                        << ", code_size: " << (int)code_size
+                        << ", runtime: " << runtime
+                        << ", runtime_size: " << (int)runtime_size << ")\n";
     halide_assert(user_context, state_ptr != nullptr);
 
 #ifdef DEBUG_RUNTIME
@@ -928,6 +951,53 @@ WEAK void halide_hexagon_power_hvx_off_as_destructor(void *user_context, void *
     halide_hexagon_power_hvx_off(user_context);
 }
 
+// This function makes two fastrpc calls
+// - remote_session_control for setting priority/stack_size for fastprc threads
+// - remote_set_thread_params for setting priority/stack_size for user threads
+// halide_hexagon_set_thread_params must be the first fastRPC call made
+// by the program.
+WEAK int halide_hexagon_set_thread_params(void *user_context, int priority, int stack_size) {
+    set_thread_params_called = true;
+    int result = init_hexagon_runtime(user_context);
+    if (result != 0) {
+        return result;
+    }
+
+    debug(user_context) << "halide_hexagon_set_thread_params\n";
+    if (!remote_thread_session_control) {
+        // This runtime doesn't support changing the thread params.
+        return 0;
+    }
+
+    // Change fastRPC default values to our default values
+    priority = (priority == -1) ? default_thread_priority : priority;
+    stack_size = (stack_size == -1) ? default_stack_size : stack_size;
+
+    // Set priority/stack-size of fastrpc created threads.
+    struct remote_rpc_thread_params th = {CDSP_DOMAIN_ID, priority, stack_size};
+    debug(user_context) << "    remote_session_control("
+                        << "thread_priority: " << priority
+                        << ", thread_stack_size: " << stack_size << ") -> \n";
+    result = remote_thread_session_control(FASTRPC_THREAD_PARAMS,
+                                           (void *)&th, sizeof(th));
+    debug(user_context) << "        " << result << "\n";
+    if (result != 0) {
+        error(user_context) << "remote_session_control failed.\n";
+        return -1;
+    }
+    // Set priority/stack-size of dsp user threads.
+    debug(user_context) << "    remote_set_thread_params("
+                        << "thread_priority: " << priority
+                        << ", thread_stack_size: " << stack_size << ") -> \n";
+    result = remote_set_thread_params(priority, stack_size);
+    debug(user_context) << "        " << result << "\n";
+    if (result != 0) {
+        error(user_context) << "remote_set_thread_params failed.\n";
+        return result;
+    }
+    return 0;
+}
+
 WEAK int halide_hexagon_set_performance_mode(void *user_context, halide_hexagon_power_mode_t mode) {
     int result = init_hexagon_runtime(user_context);
     if (result != 0) {
@@ -982,29 +1052,6 @@ WEAK int halide_hexagon_set_performance(void *user_context, halide_hexagon_power
     return 0;
 }
 
-WEAK int halide_hexagon_set_thread_priority(void *user_context, int priority) {
-    int result = init_hexagon_runtime(user_context);
-    if (result != 0) {
-        return result;
-    }
-
-    debug(user_context) << "halide_hexagon_set_thread_priority\n";
-    if (!remote_set_thread_priority) {
-        // This runtime doesn't support changing the thread priority.
-        return 0;
-    }
-
-    debug(user_context) << "    remote_set_thread_priority -> ";
-    result = remote_set_thread_priority(priority);
-    debug(user_context) << "        " << result << "\n";
-    if (result != 0) {
-        error(user_context) << "remote_set_thread_priority failed.\n";
-        return result;
-    }
-
-    return 0;
-}
-
 WEAK const halide_device_interface_t *halide_hexagon_device_interface() {
     return &hexagon_device_interface;
 }
diff --git a/src/runtime/hexagon_remote/bin/arm-32-android/libhalide_hexagon_host.so b/src/runtime/hexagon_remote/bin/arm-32-android/libhalide_hexagon_host.so
index f1294b39c9b9..5366ba301370 100755
Binary files a/src/runtime/hexagon_remote/bin/arm-32-android/libhalide_hexagon_host.so and b/src/runtime/hexagon_remote/bin/arm-32-android/libhalide_hexagon_host.so differ
diff --git a/src/runtime/hexagon_remote/bin/arm-64-android/libhalide_hexagon_host.so b/src/runtime/hexagon_remote/bin/arm-64-android/libhalide_hexagon_host.so
index cf17eb3d7538..4a661b241c2f 100755
Binary files a/src/runtime/hexagon_remote/bin/arm-64-android/libhalide_hexagon_host.so and b/src/runtime/hexagon_remote/bin/arm-64-android/libhalide_hexagon_host.so differ
diff --git a/src/runtime/hexagon_remote/bin/host/libhalide_hexagon_host.so b/src/runtime/hexagon_remote/bin/host/libhalide_hexagon_host.so
index 15fc7d957a99..4251cbce02aa 100755
Binary files a/src/runtime/hexagon_remote/bin/host/libhalide_hexagon_host.so and b/src/runtime/hexagon_remote/bin/host/libhalide_hexagon_host.so differ
diff --git a/src/runtime/hexagon_remote/bin/host/sim_host.o b/src/runtime/hexagon_remote/bin/host/sim_host.o
new file mode 100644
index 000000000000..27c539bd663e
Binary files /dev/null and b/src/runtime/hexagon_remote/bin/host/sim_host.o differ
diff --git a/src/runtime/hexagon_remote/bin/src/halide_hexagon_remote.h b/src/runtime/hexagon_remote/bin/src/halide_hexagon_remote.h
index 70c962f1540d..0079e7131ddc 100644
--- a/src/runtime/hexagon_remote/bin/src/halide_hexagon_remote.h
+++ b/src/runtime/hexagon_remote/bin/src/halide_hexagon_remote.h
@@ -48,7 +48,7 @@ __QAIC_HEADER_EXPORT int __QAIC_HEADER(halide_hexagon_remote_poll_profiler_state
 __QAIC_HEADER_EXPORT int __QAIC_HEADER(halide_hexagon_remote_profiler_set_current_func)(int current_func) __QAIC_HEADER_ATTRIBUTE;
 __QAIC_HEADER_EXPORT int __QAIC_HEADER(halide_hexagon_remote_set_performance_mode)(int mode) __QAIC_HEADER_ATTRIBUTE;
 __QAIC_HEADER_EXPORT int __QAIC_HEADER(halide_hexagon_remote_set_performance)(int set_mips, unsigned int mipsPerThread, unsigned int mipsTotal, int set_bus_bw, unsigned int bwMegabytesPerSec, unsigned int busbwUsagePercentage, int set_latency, int latency) __QAIC_HEADER_ATTRIBUTE;
-__QAIC_HEADER_EXPORT int __QAIC_HEADER(halide_hexagon_remote_set_thread_priority)(int priority) __QAIC_HEADER_ATTRIBUTE;
+__QAIC_HEADER_EXPORT int __QAIC_HEADER(halide_hexagon_remote_set_thread_params)(int priority, int stack_size) __QAIC_HEADER_ATTRIBUTE;
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/runtime/hexagon_remote/bin/src/halide_hexagon_remote_skel.c b/src/runtime/hexagon_remote/bin/src/halide_hexagon_remote_skel.c
index 4c120c19f40c..1219ab5f4e8b 100644
--- a/src/runtime/hexagon_remote/bin/src/halide_hexagon_remote_skel.c
+++ b/src/runtime/hexagon_remote/bin/src/halide_hexagon_remote_skel.c
@@ -427,28 +427,30 @@ static const SequenceType sequenceTypes[1] = {{&(types[2]),0x0,0x4,0x4,0x0}};
 static const Type types[4] = {{0x1,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x1},{0x1,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x1},{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)&(types[1]),(const uintptr_t)0x0}}, 9,SLIM_IFPTR32(0x4,0x8)},{0x8,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x8}};
 static const Parameter parameters[11] = {{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)&(types[0]),(const uintptr_t)0x0}}, 9,SLIM_IFPTR32(0x4,0x8),0,0},{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)&(types[1]),(const uintptr_t)0x0}}, 9,SLIM_IFPTR32(0x4,0x8),0,0},{0x4,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x4,3,0},{0x4,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x4,0,0},{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)&(sequenceTypes[0]),0}}, 25,SLIM_IFPTR32(0x4,0x8),0,0},{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)&(sequenceTypes[0]),0}}, 25,SLIM_IFPTR32(0x4,0x8),3,0},{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)&(types[3]),(const uintptr_t)0x0}}, 9,SLIM_IFPTR32(0x4,0x8),0,0},{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)&(types[0]),(const uintptr_t)0x0}}, 9,SLIM_IFPTR32(0x4,0x8),3,0},{0x4,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x4,3,0},{0x4,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x4,0,0},{0x4,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x4,0,0}};
 static const Parameter* const parameterArrays[23] = {(&(parameters[9])),(&(parameters[10])),(&(parameters[10])),(&(parameters[9])),(&(parameters[10])),(&(parameters[10])),(&(parameters[9])),(&(parameters[9])),(&(parameters[3])),(&(parameters[3])),(&(parameters[4])),(&(parameters[5])),(&(parameters[6])),(&(parameters[3])),(&(parameters[0])),(&(parameters[2])),(&(parameters[0])),(&(parameters[1])),(&(parameters[2])),(&(parameters[8])),(&(parameters[8])),(&(parameters[7])),(&(parameters[8]))};
-static const Method methods[9] = {{REMOTE_SCALARS_MAKEX(0,0,0x3,0x1,0x0,0x0),0x8,0x4,5,3,(&(parameterArrays[16])),0x4,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x2,0x1,0x0,0x0),0x8,0x4,4,3,(&(parameterArrays[13])),0x4,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x0,0x0,0x0,0x0),0x0,0x0,0,0,0,0x0,0x0},{REMOTE_SCALARS_MAKEX(0,0,255,255,15,15),0x14,0x0,9,5,(&(parameterArrays[8])),0x4,0x1},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x0,0x0,0x0),0x4,0x0,1,1,(&(parameterArrays[8])),0x4,0x0},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x2,0x0,0x0),0x4,0x4,4,2,(&(parameterArrays[21])),0x4,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x0,0x1,0x0,0x0),0x0,0x8,2,2,(&(parameterArrays[19])),0x1,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x0,0x0,0x0),0x4,0x0,1,1,(&(parameterArrays[0])),0x4,0x0},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x0,0x0,0x0),0x20,0x0,8,8,(&(parameterArrays[0])),0x4,0x0}};
-static const Method* const methodArrays[12] = {&(methods[0]),&(methods[1]),&(methods[2]),&(methods[2]),&(methods[3]),&(methods[4]),&(methods[5]),&(methods[6]),&(methods[7]),&(methods[7]),&(methods[8]),&(methods[7])};
-static const char strings[378] = "profiler_set_current_func\0busbwUsagePercentage\0set_performance_mode\0set_thread_priority\0poll_profiler_state\0bwMegabytesPerSec\0set_performance\0release_library\0output_buffers\0mipsPerThread\0input_buffers\0power_hvx_off\0get_symbol_v4\0power_hvx_on\0load_library\0set_latency\0set_bus_bw\0module_ptr\0mipsTotal\0read_size\0set_mips\0poll_log\0threads\0scalars\0sym_ptr\0symbol\0run_v2\0soname\0code\0";
-static const uint16_t methodStrings[39] = {126,309,173,289,267,108,26,255,259,358,278,351,187,158,335,215,278,367,343,242,365,372,278,88,21,327,318,323,299,68,79,47,63,0,13,142,278,201,229};
-static const uint16_t methodStringsArrays[12] = {19,15,38,37,9,35,26,23,33,31,0,29};
+static const Method methods[10] = {{REMOTE_SCALARS_MAKEX(0,0,0x3,0x1,0x0,0x0),0x8,0x4,5,3,(&(parameterArrays[16])),0x4,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x2,0x1,0x0,0x0),0x8,0x4,4,3,(&(parameterArrays[13])),0x4,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x0,0x0,0x0,0x0),0x0,0x0,0,0,0,0x0,0x0},{REMOTE_SCALARS_MAKEX(0,0,255,255,15,15),0x14,0x0,9,5,(&(parameterArrays[8])),0x4,0x1},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x0,0x0,0x0),0x4,0x0,1,1,(&(parameterArrays[8])),0x4,0x0},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x2,0x0,0x0),0x4,0x4,4,2,(&(parameterArrays[21])),0x4,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x0,0x1,0x0,0x0),0x0,0x8,2,2,(&(parameterArrays[19])),0x1,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x0,0x0,0x0),0x4,0x0,1,1,(&(parameterArrays[0])),0x4,0x0},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x0,0x0,0x0),0x20,0x0,8,8,(&(parameterArrays[0])),0x4,0x0},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x0,0x0,0x0),0x8,0x0,2,2,(&(parameterArrays[6])),0x4,0x0}};
+static const Method* const methodArrays[12] = {&(methods[0]),&(methods[1]),&(methods[2]),&(methods[2]),&(methods[3]),&(methods[4]),&(methods[5]),&(methods[6]),&(methods[7]),&(methods[7]),&(methods[8]),&(methods[9])};
+static const char strings[396] = "profiler_set_current_func\0busbwUsagePercentage\0set_performance_mode\0poll_profiler_state\0set_thread_params\0bwMegabytesPerSec\0set_performance\0release_library\0output_buffers\0mipsPerThread\0input_buffers\0power_hvx_off\0get_symbol_v4\0power_hvx_on\0load_library\0set_latency\0stack_size\0set_bus_bw\0module_ptr\0mipsTotal\0read_size\0priority\0set_mips\0poll_log\0threads\0scalars\0sym_ptr\0symbol\0run_v2\0soname\0code\0";
+static const uint16_t methodStrings[40] = {124,327,171,298,276,106,26,253,257,376,287,369,185,156,353,213,287,385,361,240,383,390,287,88,318,265,68,21,345,336,341,308,47,63,0,13,140,287,199,227};
+static const uint16_t methodStringsArrays[12] = {19,15,39,38,9,36,29,26,34,32,0,23};
 __QAIC_SLIM_EXPORT const Interface __QAIC_SLIM(halide_hexagon_remote_slim) = {12,&(methodArrays[0]),0,0,&(methodStringsArrays [0]),methodStrings,strings};
 #endif //_HALIDE_HEXAGON_REMOTE_SLIM_H
 extern int adsp_mmap_fd_getinfo(int, uint32_t *);
 #ifdef __cplusplus
 extern "C" {
 #endif
-static __inline int _skel_method(int (*_pfn)(int), uint32_t _sc, remote_arg* _pra) {
+static __inline int _skel_method(int (*_pfn)(int, int), uint32_t _sc, remote_arg* _pra) {
    remote_arg* _praEnd;
    uint32_t _in0[1];
+   uint32_t _in1[1];
    uint32_t* _primIn;
    int _nErr = 0;
    _praEnd = ((_pra + REMOTE_SCALARS_INBUFS(_sc)) + REMOTE_SCALARS_OUTBUFS(_sc) + REMOTE_SCALARS_INHANDLES(_sc) + REMOTE_SCALARS_OUTHANDLES(_sc));
    _ASSERT(_nErr, (_pra + ((1 + 0) + (((0 + 0) + 0) + 0))) <= _praEnd);
-   _ASSERT(_nErr, _pra[0].buf.nLen >= 4);
+   _ASSERT(_nErr, _pra[0].buf.nLen >= 8);
    _primIn = _pra[0].buf.pv;
    _COPY(_in0, 0, _primIn, 0, 4);
-   _TRY(_nErr, _pfn((int)*_in0));
+   _COPY(_in1, 0, _primIn, 4, 4);
+   _TRY(_nErr, _pfn((int)*_in0, (int)*_in1));
    _CATCH(_nErr) {}
    return _nErr;
 }
@@ -480,7 +482,21 @@ static __inline int _skel_method_1(int (*_pfn)(int, unsigned int, unsigned int,
    _CATCH(_nErr) {}
    return _nErr;
 }
-static __inline int _skel_method_2(int (*_pfn)(int*, int*), uint32_t _sc, remote_arg* _pra) {
+static __inline int _skel_method_2(int (*_pfn)(int), uint32_t _sc, remote_arg* _pra) {
+   remote_arg* _praEnd;
+   uint32_t _in0[1];
+   uint32_t* _primIn;
+   int _nErr = 0;
+   _praEnd = ((_pra + REMOTE_SCALARS_INBUFS(_sc)) + REMOTE_SCALARS_OUTBUFS(_sc) + REMOTE_SCALARS_INHANDLES(_sc) + REMOTE_SCALARS_OUTHANDLES(_sc));
+   _ASSERT(_nErr, (_pra + ((1 + 0) + (((0 + 0) + 0) + 0))) <= _praEnd);
+   _ASSERT(_nErr, _pra[0].buf.nLen >= 4);
+   _primIn = _pra[0].buf.pv;
+   _COPY(_in0, 0, _primIn, 0, 4);
+   _TRY(_nErr, _pfn((int)*_in0));
+   _CATCH(_nErr) {}
+   return _nErr;
+}
+static __inline int _skel_method_3(int (*_pfn)(int*, int*), uint32_t _sc, remote_arg* _pra) {
    remote_arg* _praEnd;
    uint32_t _rout0[1];
    uint32_t _rout1[1];
@@ -498,7 +514,7 @@ static __inline int _skel_method_2(int (*_pfn)(int*, int*), uint32_t _sc, remote
    _CATCH(_nErr) {}
    return _nErr;
 }
-static __inline int _skel_method_3(int (*_pfn)(char*, int, int*), uint32_t _sc, remote_arg* _pra) {
+static __inline int _skel_method_4(int (*_pfn)(char*, int, int*), uint32_t _sc, remote_arg* _pra) {
    remote_arg* _praEnd;
    char* _rout0[1];
    uint32_t _rout0Len[1];
@@ -526,7 +542,7 @@ static __inline int _skel_method_3(int (*_pfn)(char*, int, int*), uint32_t _sc,
    _CATCH(_nErr) {}
    return _nErr;
 }
-static __inline int _skel_method_4(int (*_pfn)(halide_hexagon_remote_handle_t), uint32_t _sc, remote_arg* _pra) {
+static __inline int _skel_method_5(int (*_pfn)(halide_hexagon_remote_handle_t), uint32_t _sc, remote_arg* _pra) {
    remote_arg* _praEnd;
    uint32_t _in0[1];
    uint32_t* _primIn;
@@ -588,7 +604,7 @@ static __inline int _skel_unpack_1(_allocator* _al, remote_arg* _praIn, remote_a
    _CATCH(_nErr) {}
    return _nErr;
 }
-static __inline int _skel_method_5(int (*_pfn)(halide_hexagon_remote_handle_t, halide_hexagon_remote_handle_t, const halide_hexagon_remote_buffer*, int, halide_hexagon_remote_buffer*, int, const halide_hexagon_remote_scalar_t*, int), uint32_t _sc, remote_arg* _pra) {
+static __inline int _skel_method_6(int (*_pfn)(halide_hexagon_remote_handle_t, halide_hexagon_remote_handle_t, const halide_hexagon_remote_buffer*, int, halide_hexagon_remote_buffer*, int, const halide_hexagon_remote_scalar_t*, int), uint32_t _sc, remote_arg* _pra) {
    remote_arg* _praEnd;
    uint32_t _in0[1];
    uint32_t _in1[1];
@@ -668,7 +684,7 @@ static __inline int _skel_method_5(int (*_pfn)(halide_hexagon_remote_handle_t, h
    _allocator_deinit(_al);
    return _nErr;
 }
-static __inline int _skel_method_6(int (*_pfn)(void), uint32_t _sc, remote_arg* _pra) {
+static __inline int _skel_method_7(int (*_pfn)(void), uint32_t _sc, remote_arg* _pra) {
    remote_arg* _praEnd;
    int _nErr = 0;
    _praEnd = ((_pra + REMOTE_SCALARS_INBUFS(_sc)) + REMOTE_SCALARS_OUTBUFS(_sc) + REMOTE_SCALARS_INHANDLES(_sc) + REMOTE_SCALARS_OUTHANDLES(_sc));
@@ -677,7 +693,7 @@ static __inline int _skel_method_6(int (*_pfn)(void), uint32_t _sc, remote_arg*
    _CATCH(_nErr) {}
    return _nErr;
 }
-static __inline int _skel_method_7(int (*_pfn)(halide_hexagon_remote_handle_t, const char*, int, halide_hexagon_remote_handle_t*), uint32_t _sc, remote_arg* _pra) {
+static __inline int _skel_method_8(int (*_pfn)(halide_hexagon_remote_handle_t, const char*, int, halide_hexagon_remote_handle_t*), uint32_t _sc, remote_arg* _pra) {
    remote_arg* _praEnd;
    uint32_t _in0[1];
    char* _in1[1];
@@ -705,7 +721,7 @@ static __inline int _skel_method_7(int (*_pfn)(halide_hexagon_remote_handle_t, c
    _CATCH(_nErr) {}
    return _nErr;
 }
-static __inline int _skel_method_8(int (*_pfn)(const char*, int, const unsigned char*, int, halide_hexagon_remote_handle_t*), uint32_t _sc, remote_arg* _pra) {
+static __inline int _skel_method_9(int (*_pfn)(const char*, int, const unsigned char*, int, halide_hexagon_remote_handle_t*), uint32_t _sc, remote_arg* _pra) {
    remote_arg* _praEnd;
    char* _in0[1];
    uint32_t _in0Len[1];
@@ -740,29 +756,29 @@ __QAIC_SKEL_EXPORT int __QAIC_SKEL(halide_hexagon_remote_skel_invoke)(uint32_t _
    switch(REMOTE_SCALARS_METHOD(_sc))
    {
       case 0:
-      return _skel_method_8(__QAIC_IMPL(halide_hexagon_remote_load_library), _sc, _pra);
+      return _skel_method_9(__QAIC_IMPL(halide_hexagon_remote_load_library), _sc, _pra);
       case 1:
-      return _skel_method_7(__QAIC_IMPL(halide_hexagon_remote_get_symbol_v4), _sc, _pra);
+      return _skel_method_8(__QAIC_IMPL(halide_hexagon_remote_get_symbol_v4), _sc, _pra);
       case 2:
-      return _skel_method_6(__QAIC_IMPL(halide_hexagon_remote_power_hvx_on), _sc, _pra);
+      return _skel_method_7(__QAIC_IMPL(halide_hexagon_remote_power_hvx_on), _sc, _pra);
       case 3:
-      return _skel_method_6(__QAIC_IMPL(halide_hexagon_remote_power_hvx_off), _sc, _pra);
+      return _skel_method_7(__QAIC_IMPL(halide_hexagon_remote_power_hvx_off), _sc, _pra);
       case 4:
-      return _skel_method_5(__QAIC_IMPL(halide_hexagon_remote_run_v2), _sc, _pra);
+      return _skel_method_6(__QAIC_IMPL(halide_hexagon_remote_run_v2), _sc, _pra);
       case 5:
-      return _skel_method_4(__QAIC_IMPL(halide_hexagon_remote_release_library), _sc, _pra);
+      return _skel_method_5(__QAIC_IMPL(halide_hexagon_remote_release_library), _sc, _pra);
       case 6:
-      return _skel_method_3(__QAIC_IMPL(halide_hexagon_remote_poll_log), _sc, _pra);
+      return _skel_method_4(__QAIC_IMPL(halide_hexagon_remote_poll_log), _sc, _pra);
       case 7:
-      return _skel_method_2(__QAIC_IMPL(halide_hexagon_remote_poll_profiler_state), _sc, _pra);
+      return _skel_method_3(__QAIC_IMPL(halide_hexagon_remote_poll_profiler_state), _sc, _pra);
       case 8:
-      return _skel_method(__QAIC_IMPL(halide_hexagon_remote_profiler_set_current_func), _sc, _pra);
+      return _skel_method_2(__QAIC_IMPL(halide_hexagon_remote_profiler_set_current_func), _sc, _pra);
       case 9:
-      return _skel_method(__QAIC_IMPL(halide_hexagon_remote_set_performance_mode), _sc, _pra);
+      return _skel_method_2(__QAIC_IMPL(halide_hexagon_remote_set_performance_mode), _sc, _pra);
       case 10:
       return _skel_method_1(__QAIC_IMPL(halide_hexagon_remote_set_performance), _sc, _pra);
       case 11:
-      return _skel_method(__QAIC_IMPL(halide_hexagon_remote_set_thread_priority), _sc, _pra);
+      return _skel_method(__QAIC_IMPL(halide_hexagon_remote_set_thread_params), _sc, _pra);
    }
    return AEE_EUNSUPPORTED;
 }
diff --git a/src/runtime/hexagon_remote/bin/src/halide_hexagon_remote_stub.c b/src/runtime/hexagon_remote/bin/src/halide_hexagon_remote_stub.c
index e7f7959933d7..b5e1719d0d46 100644
--- a/src/runtime/hexagon_remote/bin/src/halide_hexagon_remote_stub.c
+++ b/src/runtime/hexagon_remote/bin/src/halide_hexagon_remote_stub.c
@@ -425,11 +425,11 @@ static const SequenceType sequenceTypes[1] = {{&(types[2]),0x0,0x4,0x4,0x0}};
 static const Type types[4] = {{0x1,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x1},{0x1,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x1},{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)&(types[1]),(const uintptr_t)0x0}}, 9,SLIM_IFPTR32(0x4,0x8)},{0x8,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x8}};
 static const Parameter parameters[11] = {{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)&(types[0]),(const uintptr_t)0x0}}, 9,SLIM_IFPTR32(0x4,0x8),0,0},{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)&(types[1]),(const uintptr_t)0x0}}, 9,SLIM_IFPTR32(0x4,0x8),0,0},{0x4,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x4,3,0},{0x4,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x4,0,0},{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)&(sequenceTypes[0]),0}}, 25,SLIM_IFPTR32(0x4,0x8),0,0},{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)&(sequenceTypes[0]),0}}, 25,SLIM_IFPTR32(0x4,0x8),3,0},{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)&(types[3]),(const uintptr_t)0x0}}, 9,SLIM_IFPTR32(0x4,0x8),0,0},{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)&(types[0]),(const uintptr_t)0x0}}, 9,SLIM_IFPTR32(0x4,0x8),3,0},{0x4,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x4,3,0},{0x4,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x4,0,0},{0x4,{{(const uintptr_t)0,(const uintptr_t)1}}, 2,0x4,0,0}};
 static const Parameter* const parameterArrays[23] = {(&(parameters[9])),(&(parameters[10])),(&(parameters[10])),(&(parameters[9])),(&(parameters[10])),(&(parameters[10])),(&(parameters[9])),(&(parameters[9])),(&(parameters[3])),(&(parameters[3])),(&(parameters[4])),(&(parameters[5])),(&(parameters[6])),(&(parameters[3])),(&(parameters[0])),(&(parameters[2])),(&(parameters[0])),(&(parameters[1])),(&(parameters[2])),(&(parameters[8])),(&(parameters[8])),(&(parameters[7])),(&(parameters[8]))};
-static const Method methods[9] = {{REMOTE_SCALARS_MAKEX(0,0,0x3,0x1,0x0,0x0),0x8,0x4,5,3,(&(parameterArrays[16])),0x4,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x2,0x1,0x0,0x0),0x8,0x4,4,3,(&(parameterArrays[13])),0x4,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x0,0x0,0x0,0x0),0x0,0x0,0,0,0,0x0,0x0},{REMOTE_SCALARS_MAKEX(0,0,255,255,15,15),0x14,0x0,9,5,(&(parameterArrays[8])),0x4,0x1},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x0,0x0,0x0),0x4,0x0,1,1,(&(parameterArrays[8])),0x4,0x0},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x2,0x0,0x0),0x4,0x4,4,2,(&(parameterArrays[21])),0x4,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x0,0x1,0x0,0x0),0x0,0x8,2,2,(&(parameterArrays[19])),0x1,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x0,0x0,0x0),0x4,0x0,1,1,(&(parameterArrays[0])),0x4,0x0},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x0,0x0,0x0),0x20,0x0,8,8,(&(parameterArrays[0])),0x4,0x0}};
-static const Method* const methodArrays[12] = {&(methods[0]),&(methods[1]),&(methods[2]),&(methods[2]),&(methods[3]),&(methods[4]),&(methods[5]),&(methods[6]),&(methods[7]),&(methods[7]),&(methods[8]),&(methods[7])};
-static const char strings[378] = "profiler_set_current_func\0busbwUsagePercentage\0set_performance_mode\0set_thread_priority\0poll_profiler_state\0bwMegabytesPerSec\0set_performance\0release_library\0output_buffers\0mipsPerThread\0input_buffers\0power_hvx_off\0get_symbol_v4\0power_hvx_on\0load_library\0set_latency\0set_bus_bw\0module_ptr\0mipsTotal\0read_size\0set_mips\0poll_log\0threads\0scalars\0sym_ptr\0symbol\0run_v2\0soname\0code\0";
-static const uint16_t methodStrings[39] = {126,309,173,289,267,108,26,255,259,358,278,351,187,158,335,215,278,367,343,242,365,372,278,88,21,327,318,323,299,68,79,47,63,0,13,142,278,201,229};
-static const uint16_t methodStringsArrays[12] = {19,15,38,37,9,35,26,23,33,31,0,29};
+static const Method methods[10] = {{REMOTE_SCALARS_MAKEX(0,0,0x3,0x1,0x0,0x0),0x8,0x4,5,3,(&(parameterArrays[16])),0x4,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x2,0x1,0x0,0x0),0x8,0x4,4,3,(&(parameterArrays[13])),0x4,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x0,0x0,0x0,0x0),0x0,0x0,0,0,0,0x0,0x0},{REMOTE_SCALARS_MAKEX(0,0,255,255,15,15),0x14,0x0,9,5,(&(parameterArrays[8])),0x4,0x1},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x0,0x0,0x0),0x4,0x0,1,1,(&(parameterArrays[8])),0x4,0x0},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x2,0x0,0x0),0x4,0x4,4,2,(&(parameterArrays[21])),0x4,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x0,0x1,0x0,0x0),0x0,0x8,2,2,(&(parameterArrays[19])),0x1,0x4},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x0,0x0,0x0),0x4,0x0,1,1,(&(parameterArrays[0])),0x4,0x0},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x0,0x0,0x0),0x20,0x0,8,8,(&(parameterArrays[0])),0x4,0x0},{REMOTE_SCALARS_MAKEX(0,0,0x1,0x0,0x0,0x0),0x8,0x0,2,2,(&(parameterArrays[6])),0x4,0x0}};
+static const Method* const methodArrays[12] = {&(methods[0]),&(methods[1]),&(methods[2]),&(methods[2]),&(methods[3]),&(methods[4]),&(methods[5]),&(methods[6]),&(methods[7]),&(methods[7]),&(methods[8]),&(methods[9])};
+static const char strings[396] = "profiler_set_current_func\0busbwUsagePercentage\0set_performance_mode\0poll_profiler_state\0set_thread_params\0bwMegabytesPerSec\0set_performance\0release_library\0output_buffers\0mipsPerThread\0input_buffers\0power_hvx_off\0get_symbol_v4\0power_hvx_on\0load_library\0set_latency\0stack_size\0set_bus_bw\0module_ptr\0mipsTotal\0read_size\0priority\0set_mips\0poll_log\0threads\0scalars\0sym_ptr\0symbol\0run_v2\0soname\0code\0";
+static const uint16_t methodStrings[40] = {124,327,171,298,276,106,26,253,257,376,287,369,185,156,353,213,287,385,361,240,383,390,287,88,318,265,68,21,345,336,341,308,47,63,0,13,140,287,199,227};
+static const uint16_t methodStringsArrays[12] = {19,15,39,38,9,36,29,26,34,32,0,23};
 __QAIC_SLIM_EXPORT const Interface __QAIC_SLIM(halide_hexagon_remote_slim) = {12,&(methodArrays[0]),0,0,&(methodStringsArrays [0]),methodStrings,strings};
 #endif //_HALIDE_HEXAGON_REMOTE_SLIM_H
 #ifdef __cplusplus
@@ -891,11 +891,23 @@ __QAIC_STUB_EXPORT int __QAIC_STUB(halide_hexagon_remote_set_performance)(int se
    return AEE_EBADHANDLE;
     }
 }
-__QAIC_STUB_EXPORT int __QAIC_STUB(halide_hexagon_remote_set_thread_priority)(int priority) __QAIC_STUB_ATTRIBUTE {
+static __inline int _stub_method_8(remote_handle _handle, uint32_t _mid, uint32_t _in0[1], uint32_t _in1[1]) {
+   remote_arg _pra[1];
+   uint32_t _primIn[2];
+   int _nErr = 0;
+   _pra[0].buf.pv = (void*)_primIn;
+   _pra[0].buf.nLen = sizeof(_primIn);
+   _COPY(_primIn, 0, _in0, 0, 4);
+   _COPY(_primIn, 4, _in1, 0, 4);
+   _TRY(_nErr, __QAIC_REMOTE(remote_handle_invoke)(_handle, REMOTE_SCALARS_MAKEX(0, _mid, 1, 0, 0, 0), _pra));
+   _CATCH(_nErr) {}
+   return _nErr;
+}
+__QAIC_STUB_EXPORT int __QAIC_STUB(halide_hexagon_remote_set_thread_params)(int priority, int stack_size) __QAIC_STUB_ATTRIBUTE {
    uint32_t _mid = 11;
    remote_handle _handle = _halide_hexagon_remote_handle();
    if (_handle != -1)
-   return _stub_method_4(_handle, _mid, (uint32_t*)&priority);
+   return _stub_method_8(_handle, _mid, (uint32_t*)&priority, (uint32_t*)&stack_size);
    else {
    return AEE_EBADHANDLE;
     }
diff --git a/src/runtime/hexagon_remote/bin/v65/libhalide_hexagon_remote_skel.so b/src/runtime/hexagon_remote/bin/v65/libhalide_hexagon_remote_skel.so
index 280ff14b195f..e2b97595037f 100755
Binary files a/src/runtime/hexagon_remote/bin/v65/libhalide_hexagon_remote_skel.so and b/src/runtime/hexagon_remote/bin/v65/libhalide_hexagon_remote_skel.so differ
diff --git a/src/runtime/hexagon_remote/bin/v65/signed_by_debug/Elfsigner_log.txt b/src/runtime/hexagon_remote/bin/v65/signed_by_debug/Elfsigner_log.txt
new file mode 100644
index 000000000000..f2d8f6688e57
--- /dev/null
+++ b/src/runtime/hexagon_remote/bin/v65/signed_by_debug/Elfsigner_log.txt
@@ -0,0 +1,102 @@
+Logging to /local/mnt/workspace/aankit/Halide-install/Halide-aankit/src/runtime/hexagon_remote/bin/v65/signed_by_debug/Elfsigner_log.txt
+------------------------------------------------------------
+Logging to /local/mnt/workspace/aankit/Halide-install/Halide-aankit/src/runtime/hexagon_remote/bin/v65/signed_by_debug/secimage_output/SecImage_log.txt
+
+
+     SecImage v5.34 launched as: "/local/mnt/workspace/Hexagon_SDK/4.3.0.0/tools/elfsigner/elfsigner.py --no_disclaimer -i bin/v65/libhalide_hexagon_remote_skel.so -o bin/v65/signed_by_debug"
+
+Config path is set to: /local/mnt/workspace/aankit/Halide-install/Halide-aankit/src/runtime/hexagon_remote/bin/v65/signed_by_debug/libhalide_hexagon_remote_skel_generated_config.xml
+WARNING: OEM ID is set to 0 for sign_id "elf_local"
+------------------------------------------------------
+Processing 1/1: /local/mnt/workspace/aankit/Halide-install/Halide-aankit/src/runtime/hexagon_remote/bin/v65/libhalide_hexagon_remote_skel.so
+
+Performing OEM sign on image: /local/mnt/workspace/aankit/Halide-install/Halide-aankit/src/runtime/hexagon_remote/bin/v65/libhalide_hexagon_remote_skel.so
+
+Attestation Certificate Properties:
+| SW_ID     | 0x0000000000000000  |
+| HW_ID     | 0x0000000000000000  |
+| DEBUG     | 0x0000000000000002  |
+| OEM_ID    | 0x0000              |
+| SW_SIZE   | 232                 |
+| MODEL_ID  | 0x0000              |
+| SHA_ALGO  | SHA256              |
+| EXPONENT  | 3                   |
+| TCG_MIN   | 0x0001E240          |
+| TCG_MAX   | 0x0001E240          |
+
+Signed image is stored at /local/mnt/workspace/aankit/Halide-install/Halide-aankit/src/runtime/hexagon_remote/bin/v65/signed_by_debug/secimage_output/tcg/elf_local/libhalide_hexagon_remote_skel.so
+OEM signed image with PKCS
+Image /local/mnt/workspace/aankit/Halide-install/Halide-aankit/src/runtime/hexagon_remote/bin/v65/signed_by_debug/secimage_output/tcg/elf_local/libhalide_hexagon_remote_skel.so signature is valid
+Image /local/mnt/workspace/aankit/Halide-install/Halide-aankit/src/runtime/hexagon_remote/bin/v65/signed_by_debug/secimage_output/tcg/elf_local/libhalide_hexagon_remote_skel.so is not encrypted
+
+Base Properties: 
+| Integrity Check             | True  |
+| Signed                      | True  |
+| Encrypted                   | False |
+| Size of signature           | 256   |
+| Size of one cert            | 2048  |
+| Num of certs in cert chain  | 3     |
+| Number of root certs        | 1     |
+| Maximum number of root certs| None  |
+| Cert chain size             | 6144  |
+
+ELF Properties: 
+Header: 
+| b'Magic'                   | ELF                           |
+| Class                      | ELF32                          |
+| Data                       | 2's complement, little endian  |
+| Version                    | 1 (Current)                    |
+| OS/ABI                     | No extensions or unspecified   |
+| ABI Version                | 0                              |
+| Type                       | DYN (Shared object file)       |
+| Machine                    | 164                            |
+| Version                    | 0x1                            |
+| Entry address              | 0x00000000                     |
+| Program headers offset     | 0x00000034                     |
+| Section headers offset     | 0x00000000                     |
+| Flags                      | 0x00000065                     |
+| ELF header size            | 52                             |
+| Program headers size       | 32                             |
+| Number of program headers  | 4                              |
+| Section headers size       | 40                             |
+| Number of section headers  | 0                              |
+| String table section index | 0                              |
+
+Program Headers: 
+| Num |     Type    | Offset | VirtAddr | PhysAddr | FileSize | MemSize | Flags | Align |
+|-----|-------------|--------|----------|----------|----------|---------|-------|-------|
+|  1  | LOAD        | 0x3000 |  0x0000  |  0x0000  |  0x6ea4  |  0x6ea4 |   RE  | 0x1000|
+|  2  | LOAD        | 0xa000 |  0x7000  |  0x7000  |  0x17ea  |  0x1838 |   RW  | 0x1000|
+|  3  | DYNAMIC     | 0xa570 |  0x7570  |  0x7570  |  0x00b0  |  0x00b0 |   RW  | 0x4   |
+|  4  | 1685382482  | 0xa000 |  0x7000  |  0x7000  |  0x063c  |  0x063c |   RW  | 0x8   |
+
+Hash Segment Properties: 
+| Header Size     | 40B     |
+| Hash Algorithm  | sha256  |
+
+Header: 
+| cert_chain_ptr  | 0x000091e8  |
+| cert_chain_size | 0x00001800  |
+| code_size       | 0x000000c0  |
+| image_dest_ptr  | 0x00009028  |
+| image_id        | 0x00000000  |
+| image_size      | 0x000019c0  |
+| image_src       | 0x00000000  |
+| sig_ptr         | 0x000090e8  |
+| sig_size        | 0x00000100  |
+| version         | 0x00000003  |
+
+
+------------------------------------------------------
+
+SUMMARY:
+Following actions were performed: "sign, validate"
+Output is saved at: /local/mnt/workspace/aankit/Halide-install/Halide-aankit/src/runtime/hexagon_remote/bin/v65/signed_by_debug/secimage_output
+
+| Idx |   SignId  | Parse | Integrity | Sign | Encrypt |              Validate              |
+|     |           |       |           |      |         | Parse | Integrity | Sign | Encrypt |
+|-----|-----------|-------|-----------|------|---------|-------|-----------|------|---------|
+|  1. | elf_local |   T   |     NA    |  T   |    NA   |   T   |     T     |  T   |    NA   |
+
+Signing complete! Output saved at /local/mnt/workspace/aankit/Halide-install/Halide-aankit/src/runtime/hexagon_remote/bin/v65/signed_by_debug/libhalide_hexagon_remote_skel.so
+
diff --git a/src/runtime/hexagon_remote/bin/v65/signed_by_debug/libhalide_hexagon_remote_skel.so b/src/runtime/hexagon_remote/bin/v65/signed_by_debug/libhalide_hexagon_remote_skel.so
index de936cab46fd..4b6455cec321 100644
Binary files a/src/runtime/hexagon_remote/bin/v65/signed_by_debug/libhalide_hexagon_remote_skel.so and b/src/runtime/hexagon_remote/bin/v65/signed_by_debug/libhalide_hexagon_remote_skel.so differ
diff --git a/src/runtime/hexagon_remote/halide_hexagon_remote.idl b/src/runtime/hexagon_remote/halide_hexagon_remote.idl
index 01006baf11b2..0b93e21b995b 100644
--- a/src/runtime/hexagon_remote/halide_hexagon_remote.idl
+++ b/src/runtime/hexagon_remote/halide_hexagon_remote.idl
@@ -48,6 +48,6 @@ interface halide_hexagon_remote
                          in long set_latency,
                          in long latency);
 
-    // Set thread priority
-    long set_thread_priority(in long priority);
+    // Set thread priority and stack size
+    long set_thread_params(in long priority, in long stack_size);
 };
diff --git a/src/runtime/hexagon_remote/halide_remote.cpp b/src/runtime/hexagon_remote/halide_remote.cpp
index d990caeeb89b..c485d88b3cad 100644
--- a/src/runtime/hexagon_remote/halide_remote.cpp
+++ b/src/runtime/hexagon_remote/halide_remote.cpp
@@ -15,9 +15,6 @@ extern "C" {
 #include "known_symbols.h"
 #include "log.h"
 
-const int stack_alignment = 128;
-const int stack_size = 1024 * 1024;
-
 typedef halide_hexagon_remote_handle_t handle_t;
 typedef halide_hexagon_remote_buffer buffer;
 typedef halide_hexagon_remote_scalar_t scalar_t;
@@ -310,34 +307,26 @@ int halide_hexagon_remote_get_symbol_v4(handle_t module_ptr, const char *name, i
     return *sym_ptr != 0 ? 0 : -1;
 }
 
-// Thread priority for QURT threads
+// Thread priority/stack_size for QURT threads
 // Negative: use the current default (don't explicitly reset it)
 // Positive: the priority needs to be set once the shared runtime is loaded
-int saved_thread_priority = -1;
+static int saved_thread_priority = -1;
+static int saved_stack_size = -1;
 
-int halide_hexagon_remote_set_thread_priority(int priority) {
-    // Just save requested priority for now.  The priority can't actually
+int halide_hexagon_remote_set_thread_params(int priority, int stack_size) {
+    // Just save requested priority/stack_size for now. They can't actually
     // be set in qurt_thread_pool until the shared runtime has been loaded.
     saved_thread_priority = priority;
+    saved_stack_size = stack_size;
     return 0;
 }
 
-int halide_hexagon_runtime_set_thread_priority(int priority) {
-    if (priority < 0) {
-        return 0;
-    }
-
-    // Find the halide_set_default_thread_priority function in the shared runtime,
-    // which we loaded with RTLD_GLOBAL.
-    void (*set_priority)(int) = (void (*)(int))halide_get_symbol("halide_set_default_thread_priority");
-
-    if (set_priority) {
-        set_priority(priority);
-    } else {
-        // This code being run is old, doesn't have set priority feature, do nothing.
-    }
+int halide_hexagon_runtime_get_thread_priority() {
+    return saved_thread_priority;
+}
 
-    return 0;
+int halide_hexagon_runtime_get_stack_size() {
+    return saved_stack_size;
 }
 
 int halide_hexagon_remote_run_v2(handle_t module_ptr, handle_t function,
@@ -420,11 +409,6 @@ int halide_hexagon_remote_release_library(handle_t module_ptr) {
 }
 
 int halide_hexagon_remote_poll_profiler_state(int *func, int *threads) {
-    // Increase the current thread priority to match working threads priorities,
-    // so profiler can access the remote state without extra latency.
-    qurt_thread_t current_thread_id = qurt_thread_get_id();
-    qurt_thread_set_priority(current_thread_id, 100);
-
     *func = halide_profiler_get_state()->current_func;
     *threads = halide_profiler_get_state()->active_threads;
     return 0;
diff --git a/src/runtime/hexagon_remote/libadsprpc_shim.cpp b/src/runtime/hexagon_remote/libadsprpc_shim.cpp
index 29cb8d692076..59bdaa184ffc 100644
--- a/src/runtime/hexagon_remote/libadsprpc_shim.cpp
+++ b/src/runtime/hexagon_remote/libadsprpc_shim.cpp
@@ -65,6 +65,7 @@ typedef int (*remote_mmap_fn)(int, uint32_t, uint32_t, int, uint32_t *);
 typedef int (*remote_munmap_fn)(uint32_t, int);
 typedef void (*remote_register_buf_fn)(void *, int, int);
 typedef int (*remote_set_mode_fn)(uint32_t);
+typedef int (*remote_session_control_fn)(uint32_t, void *, uint32_t);
 
 remote_handle_open_fn handle_open_fn = get_libadsprpc_symbol<remote_handle_open_fn>("remote_handle_open");
 remote_handle64_open_fn handle64_open_fn = get_libadsprpc_symbol<remote_handle64_open_fn>("remote_handle64_open");
@@ -76,6 +77,7 @@ remote_mmap_fn mmap_fn = get_libadsprpc_symbol<remote_mmap_fn>("remote_mmap");
 remote_munmap_fn munmap_fn = get_libadsprpc_symbol<remote_munmap_fn>("remote_munmap");
 remote_register_buf_fn register_buf_fn = get_libadsprpc_symbol<remote_register_buf_fn>("remote_register_buf");
 remote_set_mode_fn set_mode_fn = get_libadsprpc_symbol<remote_set_mode_fn>("remote_set_mode");
+remote_session_control_fn session_control_fn = get_libadsprpc_symbol<remote_session_control_fn>("remote_session_control");
 
 }  // namespace
 
@@ -128,4 +130,8 @@ WEAK int remote_set_mode(uint32_t mode) {
     return set_mode_fn ? set_mode_fn(mode) : -1;
 }
 
+WEAK int remote_session_control(uint32_t req, void *data, uint32_t datalen) {
+    return session_control_fn ? session_control_fn(req, data, datalen) : -1;
+}
+
 }  // extern "C"
diff --git a/src/runtime/qurt_threads.cpp b/src/runtime/qurt_threads.cpp
index 15af8f939f66..38f84eecf2d2 100644
--- a/src/runtime/qurt_threads.cpp
+++ b/src/runtime/qurt_threads.cpp
@@ -25,42 +25,30 @@ void spawn_thread_helper(void *arg) {
 
 extern "C" {
 
-extern void *memalign(size_t, size_t);
+void *memalign(size_t, size_t);
+
+int halide_hexagon_runtime_get_thread_priority();
+
+int halide_hexagon_runtime_get_stack_size();
 
 int halide_host_cpu_count() {
     // Assume a Snapdragon 820
     return 4;
 }
 
-#define STACK_SIZE (256 * 1024)
-
-WEAK uint16_t halide_qurt_default_thread_priority = 100;
-
-WEAK void halide_set_default_thread_priority(int priority) {
-    if (priority > 0xFF) {
-        priority = 0xFF;  // Clamp to max priority
-    } else if (priority <= 0) {
-        return;  // Ignore settings of zero and below
-    }
-    halide_qurt_default_thread_priority = priority;
-}
-
-WEAK uint16_t halide_get_default_thread_priority() {
-    return halide_qurt_default_thread_priority;
-}
-
 WEAK struct halide_thread *halide_spawn_thread(void (*f)(void *), void *closure) {
-    uint16_t priority = halide_get_default_thread_priority();
+    int thread_priority = halide_hexagon_runtime_get_thread_priority();
+    int stack_size = halide_hexagon_runtime_get_stack_size();
     spawned_thread *t = (spawned_thread *)malloc(sizeof(spawned_thread));
     t->f = f;
     t->closure = closure;
-    t->stack = memalign(128, STACK_SIZE);
+    t->stack = memalign(128, stack_size);
     memset(&t->handle, 0, sizeof(t->handle));
     qurt_thread_attr_t thread_attr;
     qurt_thread_attr_init(&thread_attr);
     qurt_thread_attr_set_stack_addr(&thread_attr, t->stack);
-    qurt_thread_attr_set_stack_size(&thread_attr, STACK_SIZE);
-    qurt_thread_attr_set_priority(&thread_attr, priority);
+    qurt_thread_attr_set_stack_size(&thread_attr, stack_size);
+    qurt_thread_attr_set_priority(&thread_attr, thread_priority);
     qurt_thread_create(&t->handle.val, &thread_attr, &spawn_thread_helper, t);
     return (halide_thread *)t;
 }
diff --git a/src/runtime/runtime_api.cpp b/src/runtime/runtime_api.cpp
index a431a28098fc..b2fdb57eb53f 100644
--- a/src/runtime/runtime_api.cpp
+++ b/src/runtime/runtime_api.cpp
@@ -101,7 +101,7 @@ extern "C" __attribute__((used)) void *halide_runtime_api_functions[] = {
     (void *)&halide_hexagon_run,
     (void *)&halide_hexagon_set_performance,
     (void *)&halide_hexagon_set_performance_mode,
-    (void *)&halide_hexagon_set_thread_priority,
+    (void *)&halide_hexagon_set_thread_params,
     (void *)&halide_hexagon_wrap_device_handle,
     (void *)&halide_int64_to_string,
     (void *)&halide_join_thread,
