Skip to content

Run frontier MoE models on hardware you already own — pure C, zero deps, experts streamed from disk. Tiny engine, immense model. 🐦

C

deepseek_v4: say why no CUDA backend DLL was usable (#1906)

JustVugg78e98d16ceab
diff --git a/c/backend_loader_dsv4.c b/c/backend_loader_dsv4.c
index 4ce09ef1..ec512eee 100644
--- a/c/backend_loader_dsv4.c
+++ b/c/backend_loader_dsv4.c
@@ -376,15 +376,30 @@ static int dsv4_cuda_load(void){
int n = 0;
if(forced && *forced) candidates[n++] = forced;
else { candidates[n++] = DSV4_BACKEND_DLL_DG; candidates[n++] = DSV4_BACKEND_DLL; }
+ /* why each candidate was passed over, for the closing line (#1906: it named no cause) */
+ char why[512]; size_t wn = 0; why[0] = 0;
for(int i = 0; i < n; i++){
g_dsv4.dll = dsv4_load_one(candidates[i]);
- if(!g_dsv4.dll) continue;
- if(!dsv4_cuda_resolve(candidates[i])) continue; /* unloaded inside */
+ if(!g_dsv4.dll){
+ DWORD err = GetLastError();
+ int w = snprintf(why + wn, sizeof(why) - wn, "%s%s: %s (Windows error %lu)", wn ? "; " : "", candidates[i],
+ err == ERROR_MOD_NOT_FOUND ? "not next to the engine, or a DLL it needs (the CUDA runtime) is missing"
+ : err == ERROR_BAD_EXE_FORMAT ? "not a 64-bit DLL" : "not loadable", (unsigned long)err);
+ if(w > 0 && (size_t)w < sizeof(why) - wn) wn += (size_t)w;
+ continue;
+ }
+ if(!dsv4_cuda_resolve(candidates[i])){ /* unloaded inside; it said which symbol */
+ int w = snprintf(why + wn, sizeof(why) - wn, "%s%s: a missing symbol", wn ? "; " : "", candidates[i]);
+ if(w > 0 && (size_t)w < sizeof(why) - wn) wn += (size_t)w;
+ continue;
+ }
/* Optional compatibility probe: a build whose kernels cannot run on
* device 0 says so, and the next candidate is tried. */
if(g_dsv4.backend_arch_ok && !g_dsv4.backend_arch_ok(0)){
fprintf(stderr, DSV4_VENDOR_TAG " %s does not fit this GPU; trying the next backend\n",
candidates[i]);
+ int w = snprintf(why + wn, sizeof(why) - wn, "%s%s: not built for this GPU", wn ? "; " : "", candidates[i]);
+ if(w > 0 && (size_t)w < sizeof(why) - wn) wn += (size_t)w;
FreeLibrary(g_dsv4.dll); g_dsv4.dll = NULL;
memset(&g_dsv4, 0, sizeof(g_dsv4)); g_dsv4.loaded = 1;
continue;
@@ -395,8 +410,10 @@ static int dsv4_cuda_load(void){
g_dsv4.available = 1;
return 1;
}
- fprintf(stderr, DSV4_VENDOR_TAG " no usable backend DLL (" DSV4_BACKEND_DLL_DG " / "
- DSV4_BACKEND_DLL "); GPU tier disabled (CPU path remains active).\n");
+ fprintf(stderr, DSV4_VENDOR_TAG " no usable backend DLL (%s); GPU tier disabled (CPU path remains active). "
+ "The DLLs need an sm_80+ GPU (Ampere or newer); Pascal and Turing take a build with "
+ "CUDA_ARCH=portable-pre-ampere NO_TC=1 (docs/deepseek-v4.md).\n",
+ wn ? why : DSV4_BACKEND_DLL_DG " / " DSV4_BACKEND_DLL);
return 0;
}