diff --git a/src/runtime_src/core/common/api/xrt_kernel.cpp b/src/runtime_src/core/common/api/xrt_kernel.cpp index cc952a60d6f..82f59ead786 100644 --- a/src/runtime_src/core/common/api/xrt_kernel.cpp +++ b/src/runtime_src/core/common/api/xrt_kernel.cpp @@ -2110,7 +2110,7 @@ class run_impl , core_device(kernel->get_core_device()) , cmd(std::make_shared(kernel->get_device(), m_hwqueue, kernel->get_hw_context())) , data(initialize_command(cmd.get())) - , m_header(cmd->get_ert_packet()->header) + , m_header(0) , uid(create_uid()) { XRT_DEBUGF("run_impl::run_impl(%d)\n" , uid); @@ -2307,6 +2307,12 @@ class run_impl encode_compute_units(); auto pkt = cmd->get_ert_packet(); + + // Very first start() of this run object caches the command header + if (!m_header) + m_header = pkt->header; + + // The cached command header is used for all subsequent starts pkt->header = m_header; pkt->state = ERT_CMD_STATE_NEW;