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++

dsv41: strata-dsv41 --version and a 'ds4: build <commit>' line with --verbose (commit from git at configure, a BUILD_ID file in an archive, or -DSTRATA_BUILD_ID)

Niko1221f1cb66d09e66
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80ba5890c..c7fcd7deb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -778,6 +778,18 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP)
add_executable(strata-dsv41 src/dsv41/ds4_main.cpp src/dsv41/ds4_model.cu src/dsv41/ds4_kernels.cu src/dsv41/ds4_vision.cu
src/dsv41/ds4_gguf.cu src/dsv41/ds4_gguf_cpu.cpp src/dsv41/ds4_iq.cu src/dsv41/ds4_iq_cpu.cpp
src/dsv41/ds4_tq.cu src/dsv41/ds4_tq_cpu.cpp src/dsv41/ds4_gg_cpu.cpp src/dsv41/ds4_packinfo.cpp)
+ # the commit the binary was built from, readable with --version (set -DSTRATA_BUILD_ID=... for a tree without .git)
+ if(NOT STRATA_BUILD_ID AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/BUILD_ID) # (a git archive has no .git: the packer writes the commit here)
+ file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/BUILD_ID STRATA_BUILD_ID LIMIT_COUNT 1)
+ endif()
+ if(NOT STRATA_BUILD_ID)
+ execute_process(COMMAND git -C ${CMAKE_CURRENT_SOURCE_DIR} rev-parse --short=9 HEAD OUTPUT_VARIABLE STRATA_BUILD_ID
+ OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
+ endif()
+ if(NOT STRATA_BUILD_ID)
+ set(STRATA_BUILD_ID unknown)
+ endif()
+ set_source_files_properties(src/dsv41/ds4_main.cpp PROPERTIES COMPILE_DEFINITIONS "DS4_BUILD_ID=\"${STRATA_BUILD_ID}\"")
target_include_directories(strata-dsv41 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${_strata_gpu_include_directories}
${CMAKE_CURRENT_SOURCE_DIR}/third_party/ggml)
target_link_libraries(strata-dsv41 PRIVATE strata_dsv41_kernels ${_strata_gpu_runtime_target} ${_strata_gpu_blas_target})
diff --git a/src/dsv41/ds4_main.cpp b/src/dsv41/ds4_main.cpp
index 420fa93fe..3378403b0 100644
--- a/src/dsv41/ds4_main.cpp
+++ b/src/dsv41/ds4_main.cpp
@@ -735,6 +735,10 @@ int spec_eval(strata::ds4::Model& m, const std::string& ids_path, int n, int win
}
} // namespace
+#ifndef DS4_BUILD_ID
+#define DS4_BUILD_ID "unknown"
+#endif
+
int main(int argc, char** argv) {
strata::ds4::Options o;
std::string ids_s, dump, eos = "1";
@@ -794,7 +798,13 @@ int main(int argc, char** argv) {
}
else if (a == "--temperature") temp = (float) std::atof(val("--temperature").c_str());
else if (a == "--seed") cli_seed = std::strtoull(val("--seed").c_str(), nullptr, 10);
- else if (a == "--verbose" || a == "-v") o.verbose = true;
+ else if (a == "--verbose" || a == "-v") {
+ o.verbose = true;
+ std::fprintf(stderr, "ds4: build %s (%s)\n", DS4_BUILD_ID, STRATA_VERSION);
+ } else if (a == "--version") {
+ std::printf("strata-dsv41 %s build %s\n", STRATA_VERSION, DS4_BUILD_ID);
+ return 0;
+ }
else if (a == "--ids") ids_s = val("--ids");
else if (a == "--n") n = std::atoi(val("--n").c_str());
else if (a == "--window") window = std::max(1, std::atoi(val("--window").c_str())); // (> 16: the chunked prompt path)