[Engine] fix Windows HIP long-path loading

This commit is contained in:
tobitege committed 2026-10-30 09:42:20 +01:00
1 parent 870aedd9e1
commit bf3ef25841
3 files changed
+16

No files matched your search

+11
View File
@@ -43,6 +43,17 @@ endif()
string(REPLACE ";" "," STRATA_HIP_ARCHS "${STRATA_HIP_ARCH_LIST}")
enable_language(HIP)
# The Windows HIP build uses clang's GNU-style driver, so the MSVC-only manifest helper does not run.
# Embed the Windows settings in every HIP executable, including the tests. Tensile opens its kernel files
# with ordinary paths; without longPathAware it fails above MAX_PATH even when Windows long paths are on.
if(WIN32)
add_library(strata_hip_windows_settings INTERFACE)
target_link_options(strata_hip_windows_settings INTERFACE "LINKER:/MANIFEST:EMBED"
"LINKER:/MANIFESTINPUT:${CMAKE_CURRENT_LIST_DIR}/strata-utf8.manifest")
set_property(TARGET strata_hip_windows_settings PROPERTY INTERFACE_LINK_DEPENDS
"${CMAKE_CURRENT_LIST_DIR}/strata-utf8.manifest")
link_libraries(strata_hip_windows_settings)
endif()
# CMake caches CMAKE_HIP_FLAGS_<CONFIG> while it enables HIP, before it tests the compiler. A configure that stopped
# there because HIP could not compile at all (Visual Studio 2026's <cmath> with the HIP SDK 7.2, a wrong ROCm path)
# cached them empty, and every later configure of that build folder keeps them: setup's Release build then compiled
+1
View File
@@ -3,6 +3,7 @@
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
</assembly>
+4
View File
@@ -52,8 +52,12 @@ T* dev(size_t n) {
int main(int argc, char** argv) {
const bool off = argc > 1 && std::strcmp(argv[1], "--off") == 0;
#if defined(_WIN32)
if (_putenv_s("STRATA_HC_PERSIST", off ? "" : "1") != 0) return 2;
#else
if (off) unsetenv("STRATA_HC_PERSIST");
else setenv("STRATA_HC_PERSIST", "1", 1);
#endif
k::fused_gr_check();
k::fused_gr_persist_init();