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>
This commit is contained in:
1 parent
987548ce2c
commit
ea73bc2522
1 file changed
+11
@@ -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 <windows.h>
|
||||
#include <intrin.h>
|
||||
#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<Fn_hipKernelNameRefByPtr>(
|
||||
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";
|
||||
|
||||
Reference in new issue
Block a user