mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-04 15:28:40 +00:00
engine: a Windows HIP engine says when the runtime in use is not the bundled one beside it (#1261)
The report shows the bundled amdhip64_7.dll next to strata.exe and the System32 copy (a different build) in use, with the prompt GEMMs failing. The import is bound before main, so the engine cannot swap it; it now prints a WARNING naming the bundled file when the loaded one is another, so the log carries the fact. Nothing else changes. The fix itself (loading the bundled runtime by full path, or a delay-loaded import) needs a Windows AMD machine to test and is not in this commit.
This commit is contained in:
1 parent
0f931943c8
commit
0499f8f7be
1 file changed
+17
-1
@@ -3872,8 +3872,24 @@ int main(int argc, char** argv) {
|
||||
// #468 #461: which HIP runtime was loaded - the bundled one beside the exe, or an AMD driver's System32 copy
|
||||
if (HMODULE h = GetModuleHandleA("amdhip64_7.dll")) {
|
||||
char path[MAX_PATH] = {};
|
||||
if (GetModuleFileNameA(h, path, MAX_PATH) > 0)
|
||||
if (GetModuleFileNameA(h, path, MAX_PATH) > 0) {
|
||||
std::fprintf(stderr, "strata generate: HIP runtime %s\n", path);
|
||||
// #1261: the bundled runtime sits beside the exe, but Windows bound the import to another copy (the AMD
|
||||
// driver's, in System32, was seen with a different build): kernels of this engine can then fail
|
||||
// (hipErrorInvalidDeviceFunction in the prompt GEMMs). Said, not changed - the import is bound before main.
|
||||
char exe[MAX_PATH] = {};
|
||||
if (GetModuleFileNameA(nullptr, exe, MAX_PATH) > 0) {
|
||||
std::string beside(exe);
|
||||
const size_t cut = beside.find_last_of("\\/");
|
||||
beside = (cut == std::string::npos ? std::string() : beside.substr(0, cut + 1)) + "amdhip64_7.dll";
|
||||
if (GetFileAttributesA(beside.c_str()) != INVALID_FILE_ATTRIBUTES &&
|
||||
_stricmp(beside.c_str(), path) != 0)
|
||||
std::fprintf(stderr, "strata generate: WARNING: the HIP runtime in use is not the bundled one beside "
|
||||
"the engine (%s): if prompts fail with hipErrorInvalidDeviceFunction, tell the "
|
||||
"maintainers with this log (#1261)\n",
|
||||
beside.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
|
||||
Reference in new issue
Block a user