Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

strata-vision-hip (Windows): hipblas.dll is delay-loaded and rocm\bin is put on the DLL search path first, so the reader starts from any PATH

Niko12216b8cfcd1a340
diff --git a/tools/vision/CMakeLists.txt b/tools/vision/CMakeLists.txt
index 5b09e2d6f..5f031b9ce 100644
--- a/tools/vision/CMakeLists.txt
+++ b/tools/vision/CMakeLists.txt
@@ -82,6 +82,12 @@ if(STRATA_VISION_HIP)
string(REPLACE ";" "," _hip_archs "${STRATA_VISION_HIP_ARCHS}")
target_compile_definitions(strata-vision PRIVATE STRATA_VISION_HIP STRATA_VISION_HIP_ARCHS="${_hip_archs}")
endif()
+if(WIN32 AND STRATA_VISION_HIP)
+ # hipblas.dll (and rocblas.dll behind it) live in rocm\bin of the engine package: loaded on first use, after main() has put that folder on
+ # the DLL search path, so the reader starts from any PATH and says "no GPU" itself where there is none
+ target_link_libraries(strata-vision PRIVATE delayimp)
+ target_link_options(strata-vision PRIVATE -Wl,/delayload:hipblas.dll)
+endif()
if(UNIX AND NOT APPLE)
# the libraries it needs are the ones in its own folder (a component folder is relocatable): RUNPATH $ORIGIN
set_target_properties(strata-vision PROPERTIES BUILD_WITH_INSTALL_RPATH ON INSTALL_RPATH "$ORIGIN")
diff --git a/tools/vision/strata_vision.cpp b/tools/vision/strata_vision.cpp
index 85979b664..eef3e81c9 100644
--- a/tools/vision/strata_vision.cpp
+++ b/tools/vision/strata_vision.cpp
@@ -26,6 +26,10 @@
#if !defined(_WIN32)
#include <fcntl.h>
#include <unistd.h>
+#elif defined(STRATA_VISION_HIP)
+#define WIN32_LEAN_AND_MEAN
+#define NOMINMAX
+#include <windows.h>
#endif
#include <chrono>
#include <cstdio>
@@ -65,6 +69,22 @@ bool parse_enc(const std::string& line, std::string& img, std::string& out) {
} // namespace
int main(int argc, char** argv) {
+#if defined(_WIN32) && defined(STRATA_VISION_HIP)
+ // hipblas.dll is delay-loaded (tools/vision/CMakeLists.txt): it and the ROCm DLLs behind it (rocblas.dll finds its kernel
+ // library and ../.kpack beside itself) stay in rocm\bin of the engine package, which is not on the DLL search path of a
+ // program started with nothing but System32 in PATH. Put that folder on it before the first call.
+ {
+ wchar_t exe[MAX_PATH];
+ const DWORD n = GetModuleFileNameW(nullptr, exe, MAX_PATH);
+ std::wstring dir(exe, n);
+ const size_t cut = dir.find_last_of(L"\\/");
+ if (cut != std::wstring::npos) {
+ dir.resize(cut);
+ const std::wstring rocm = dir + L"\\rocm\\bin";
+ if (GetFileAttributesW(rocm.c_str()) != INVALID_FILE_ATTRIBUTES) SetDllDirectoryW(rocm.c_str());
+ }
+ }
+#endif
std::string mmproj, model;
bool gpu = false;
int threads = 0, max_tokens = 0, min_tokens = 0;