Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clean/installer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ With the defaults nothing of this section changes the installer.
architecture from HIP's device properties and creates a context on a supported one: `gfx1201` (RX 9070 family);
`gfx1200` (RX 9060 family) is reported as not supported yet (one line, `kSupportedArch`, when the owner decides).
Search order: System32 (installed by the AMD Software: Adrenalin Edition driver), the PATH folders, the newest
`C:\Program Files\AMD\ROCm\<version>\bin`, `HIP_PATH`; `WRONGGPU_HIP_RUNTIME` overrides it (development). The child
`C:\Program Files\AMD\ROCm\<version>\bin`, `HIP_PATH`; `WRONGGPU_HIP_RUNTIME` overrides it in a `WRONGGPU_TESTING` build only (development; since 0.6.1). The child
runs without `LLVM_PATH`. On failure the player is pointed to AMD's driver page
(https://www.amd.com/en/support/download/drivers.html), the HIP SDK only as a second option. No SDK is needed.
- **Model file (bring your own).** Candidates in this order: a file the player picks (`Model file...` / `/MODEL=`),
Expand Down
9 changes: 6 additions & 3 deletions clean/installer/src/wg_core/checks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ GpuInfo DetectGpu() {

// The AMD HIP runtime (amdhip64_7.dll) the clean runtime loads (spec 30 answer 7): from the system search path first
// (System32, where the AMD Software: Adrenalin Edition driver installs it; then the PATH folders), then the newest
// C:\Program Files\AMD\ROCm\<version>\bin (HIP SDK), then HIP_PATH. WRONGGPU_HIP_RUNTIME overrides (development).
// C:\Program Files\AMD\ROCm\<version>\bin (HIP SDK), then HIP_PATH. WRONGGPU_HIP_RUNTIME overrides (development; read
// only by a WRONGGPU_TESTING build).
const wchar_t* const kHipDll = L"amdhip64_7.dll";
const wchar_t* const kDriverPage = L"https://www.amd.com/en/support/download/drivers.html";
const char* const kSupportedArch[] = {"gfx1201", "gfx1200"}; // RDNA 4: the RX 9070 family and the RX 9060 family
Expand Down Expand Up @@ -103,9 +104,11 @@ std::vector<wstring> HipCandidates() {
}
return c;
}
#endif
wstring env = EnvVar(L"WRONGGPU_HIP_RUNTIME");
// 0.6.1: the development override only in a WRONGGPU_TESTING build; a release build never reads it (a developer's
// mock HIP library set at install time was recorded in hip-runtime.txt)
const wstring env = EnvVar(L"WRONGGPU_HIP_RUNTIME");
if (!env.empty()) c.push_back(env);
#endif
wchar_t sys[MAX_PATH];
if (GetSystemDirectoryW(sys, MAX_PATH)) c.push_back(Join(sys, kHipDll));
wstring path = EnvVar(L"PATH");
Expand Down
23 changes: 23 additions & 0 deletions clean/installer/tests/wg_core_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,29 @@ int main() {
// VersionLess (the launcher's start, Update due, the update check, ROCm folders): a pre-release before its release
require(VersionLess(L"0.6.1-rc1", L"0.6.1") && !VersionLess(L"0.6.1", L"0.6.1-rc1"), "VersionLess: 0.6.1-rc1 < 0.6.1");
require(VersionLess(L"0.6.0", L"0.6.1-rc1") && !VersionLess(L"0.6.1-rc1", L"0.6.0"), "VersionLess: 0.6.0 < 0.6.1-rc1");
// 0.6.1: WRONGGPU_HIP_RUNTIME (the development override of the HIP runtime search) is read only by a WRONGGPU_TESTING
// build. The candidate list only names files that exist (nothing is loaded): a few bytes of text stand in for the
// library in the test's own temp folder; the test's variables are put back afterwards.
{
const wstring savedHip = EnvVar(L"WRONGGPU_HIP_RUNTIME"), savedMocks = EnvVar(L"WRONGGPU_TEST_HIP_CANDIDATES");
const wstring hipDir = TempFolder(), fake = Join(hipDir, L"amdhip64_7.dll");
if (FILE* f = _wfopen(fake.c_str(), L"wb")) { std::fputs("not a HIP runtime (wg-core-tests)", f); std::fclose(f); }
require(IsFile(fake), "HIP search: the stand-in file is there");
SetEnvironmentVariableW(L"WRONGGPU_TEST_HIP_CANDIDATES", nullptr);
SetEnvironmentVariableW(L"WRONGGPU_HIP_RUNTIME", fake.c_str());
const std::vector<wstring> cands = HipCandidates();
bool named = false;
for (auto& c : cands) named = named || IEq(c, fake);
SetEnvironmentVariableW(L"WRONGGPU_HIP_RUNTIME", savedHip.empty() ? nullptr : savedHip.c_str());
SetEnvironmentVariableW(L"WRONGGPU_TEST_HIP_CANDIDATES", savedMocks.empty() ? nullptr : savedMocks.c_str());
RemoveTree(hipDir);
#ifdef WRONGGPU_TESTING
require(!cands.empty() && IEq(cands[0], fake), "HIP search: a testing build tries WRONGGPU_HIP_RUNTIME first");
#else
require(!named, "HIP search: a release build never reads WRONGGPU_HIP_RUNTIME");
#endif
(void)named;
}
require(VersionLess(L"0.6.1-rc2", L"0.6.1-rc10") && VersionLess(L"0.6.1-beta2", L"0.6.1-rc1") && !VersionLess(L"0.6.1-rc1", L"0.6.1-rc1"),
"VersionLess: two pre-releases by their words, then their numbers");
require(!VersionLess(L"v0.6.1", L"0.6.1") && !VersionLess(L"0.6.1", L"v0.6.1") && VersionLess(L"v0.6.0", L"0.6.1"), "VersionLess: a leading v doesn't count");
Expand Down
Loading