setup --check: RAM below every model's floor is a warning and the verdict says so (#977)
The RAM line was [ok] and the verdict 'This PC can run Strata' although every size said 'does not fit'. Now the line is [!], the verdict says no size fits, and the exit code is 1 for scripts. Check only: --model NAME --yes still installs one anyway.
This commit is contained in:
1 parent
d034539560
commit
4f131fcdcc
2 files changed
+20
-2
No files matched your search
@@ -4118,8 +4118,9 @@ def main() -> int:
|
||||
"copy of the most-used ones: it needs 32 GB of RAM or more (48 GB for the full model); --model "
|
||||
"NAME --yes installs one anyway")
|
||||
warn(f"going on with {ram:.0f} GB of RAM, as you chose")
|
||||
ok(f"RAM: {ram:.0f} GB" if ram >= need - 4 else f"RAM: {ram:.0f} GB (less than the {need} GB the smallest model needs)"
|
||||
+ ("; the GPU's VRAM makes up for it (the low-RAM mode)" if ram < need - 4 and low_ok else ""))
|
||||
ram_msg = (f"RAM: {ram:.0f} GB" if ram >= need - 4 else f"RAM: {ram:.0f} GB (less than the {need} GB the smallest model needs)"
|
||||
+ ("; the GPU's VRAM makes up for it (the low-RAM mode)" if ram < need - 4 and low_ok else ""))
|
||||
(ok if ram >= need - 4 or low_ok else warn)(ram_msg) # #977: a RAM below every model's floor is not [ok]
|
||||
pf = page_file_gb()
|
||||
if pf is not None and pf < 4:
|
||||
warn(f"Windows' page file is {pf:.1f} GB: the graphics card's memory needs room there too (issue #60), so "
|
||||
@@ -4143,6 +4144,7 @@ def main() -> int:
|
||||
a.build = True
|
||||
if a.check:
|
||||
say()
|
||||
any_fits = False
|
||||
for m, d in MODELS.items():
|
||||
verdict = "fits" if ram >= d["ram_gb"] else "tight" if ram >= d["ram_gb"] - 8 else "does not fit"
|
||||
if d.get("budget"):
|
||||
@@ -4155,7 +4157,14 @@ def main() -> int:
|
||||
verdict = (f"fits in the low-RAM mode (the GPU holds ~{100 * low_ram_gpu_share(m, gpu['vram_gb']):.0f}% "
|
||||
"of its experts, " + ("the rest stays in RAM)" if low_ram_resident(m, ram, gpu["vram_gb"])
|
||||
else "the rest is read from the SSD as needed)"))
|
||||
any_fits = any_fits or not verdict.startswith("does not fit")
|
||||
say(f" {m:8s} needs ~{d['ram_gb']} GB RAM: {verdict}")
|
||||
if not any_fits:
|
||||
# #977: every size says "does not fit", so the verdict says so too (and the exit code, for scripts). It only
|
||||
# reports: --model NAME --yes still installs one anyway.
|
||||
say(f"\nThis PC cannot run Strata yet: no model size fits {ram:.0f} GB of RAM (the smallest needs about "
|
||||
f"{need} GB). --model NAME --yes installs one anyway, slowly.")
|
||||
return 1
|
||||
say("\nThis PC can run Strata. Run it again without --check to install.")
|
||||
return 0
|
||||
|
||||
|
||||
@@ -490,6 +490,15 @@ class IQ4XS(Base):
|
||||
self.assertNotIn("EXPERIMENTAL", line)
|
||||
self.assertIn("EXPERIMENTAL", next(ln for ln in out.splitlines() if ln.strip().startswith(M)))
|
||||
|
||||
def test_check_below_every_floor(self):
|
||||
# #977: 16 GB fits no size; the RAM line is not [ok] and the verdict says so
|
||||
code, out, _ = self.main(["--check"], ram=16.0, m=X)
|
||||
self.assertEqual(code, 1, out)
|
||||
self.assertNotIn("[ok] RAM", out)
|
||||
self.assertIn("[!] RAM: 16 GB (less than", out)
|
||||
self.assertIn("This PC cannot run Strata yet", out)
|
||||
self.assertNotIn("This PC can run Strata", out)
|
||||
|
||||
def test_engine_0138(self):
|
||||
code, out, cfg = self.main(["--context", "8192"], version="0.1.37", m=X)
|
||||
self.assertEqual(code, 1)
|
||||
|
||||
Reference in new issue
Block a user