From ea73bc2522b85ec52e474ac3a23d1b0d47265e64 Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Tue, 13 Oct 2026 04:35:37 +0200 Subject: [PATCH] Windows HIP: hipKernelNameRefByPtr is resolved at run time (STRATA_VERIFY_NODES), so a runtime DLL without it still starts (#2183) Some amdhip64_7.dll builds (AMD TheRock wheels / ROCm 10.2 / 7.2.4 nightly) do not export hipKernelNameRefByPtr although their import library has it, so strata.exe failed to load with STATUS_ENTRYPOINT_NOT_FOUND before main. It is only used to name graph nodes under STRATA_VERIFY_NODES; on Windows it is now looked up with GetProcAddress and a missing one leaves the node unnamed. From #2183, its verify.cpp part only. The PR's other part (Windows HIP --pcie-mode auto as DMA) changes the default path of every Windows AMD user and was not measured on our side; it is left out. Co-authored-by: dvasdekis <19279397+dvasdekis@users.noreply.github.com> --- src/core/verify.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/core/verify.cpp b/src/core/verify.cpp index bb108338..0513a824 100644 --- a/src/core/verify.cpp +++ b/src/core/verify.cpp @@ -6,6 +6,10 @@ #include "strata/core/dma_batch.hpp" #include "strata/core/spec_prob.hpp" #if defined(_WIN32) +#ifndef NOMINMAX +#define NOMINMAX +#endif +#include #include #endif @@ -1878,7 +1882,14 @@ bool Verifier::capture(int T, std::string& err) { if (ty == hipGraphNodeTypeKernel) { hipKernelNodeParams kp{}; if (hipGraphKernelNodeGetParams(nd, &kp) == hipSuccess && kp.func != nullptr) { +#if defined(_WIN32) + using Fn_hipKernelNameRefByPtr = const char* (*)(const void*, hipStream_t); + static auto p_hipKernelNameRefByPtr = reinterpret_cast( + GetProcAddress(GetModuleHandleA("amdhip64_7.dll"), "hipKernelNameRefByPtr")); + const char* fn = p_hipKernelNameRefByPtr ? p_hipKernelNameRefByPtr(kp.func, nullptr) : nullptr; +#else const char* fn = hipKernelNameRefByPtr(kp.func, nullptr); +#endif if (fn != nullptr) name = fn; } } else if (ty == hipGraphNodeTypeMemcpy) name = "memcpy";