Make videos on the computer you already own. FreeVideo runs MiniMax H3 in as little as 8 GB of VRAM and 16 GB of RAM, and adapts its acceleration path to your hardware.
Fix stale CUDA GPU architecture admission and diagnostics (#59)
Bowen Xuea74faabc21af
diff --git a/freevideo_engine/bootstrap.py b/freevideo_engine/bootstrap.pyindex 305a41e..7eec9c2 100644--- a/freevideo_engine/bootstrap.py+++ b/freevideo_engine/bootstrap.py@@ -185,12 +185,21 @@ def inventory(gpu=None):if len(matches) != 1:raise ValueError('Select one physical GPU by nvidia-smi index or full UUID with --gpu. MIG is not supported.')selected = matches[0]+ try:+ capability = tuple(map(int, selected['compute_cap'].split('.')))+ if len(capability) != 2:+ capability = (0, 0)+ except (TypeError, ValueError):+ # Keep the raw driver result in inventory for the exported report.+ # Unknown must not be presented as an unsupported old GPU architecture.+ capability = (0, 0)ram = system_memory()limit, available = cgroup_capacity()- hardware = Hardware(selected['name'], tuple(map(int, selected['compute_cap'].split('.'))),+ hardware = Hardware(selected['name'], capability,int(float(selected['memory.total']) * 2**20), int(float(selected['memory.free']) * 2**20),ram['total_bytes'], min(ram['available_bytes'], available) if available is not None else ram['available_bytes'],- platform.system(), cgroup_ram_limit=limit)+ platform.system(), cgroup_ram_limit=limit, gpu_uuid=selected['uuid'],+ driver_version=selected['driver_version'])return {'hardware': hardware.to_dict(), 'selected_gpu': selected, 'gpus': rows,'kernel': platform.release(), 'platform': platform.platform(), 'machine': platform.machine(),'cpu_threads': os.cpu_count(), 'swap_total_bytes': ram.get('swap_total_bytes'),@@ -260,8 +269,10 @@ def plan(args, *, local_progress=None):errors.append('Windows uses the pinned, verified Sage2 wheel; --rebuild-sage is a Linux source-build option.')if int(snapshot['selected_gpu']['driver_version'].split('.')[0]) < 580:errors.append('NVIDIA driver 580 or newer is required by the pinned CUDA 13 encoder; update the driver first.')- if hardware.capability not in ((8, 0), (8, 6), (8, 9), (9, 0), (12, 0)):- errors.append('The one-click profiles currently target SM80/86, SM89, SM90 and SM120.')+ compatibility = hardware.cuda_compatibility()+ if compatibility['error']:+ errors.append(compatibility['error'])+ snapshot['cuda_compatibility'] = compatibilityfor name in () if windows_target else ('git', 'compiler'):if not snapshot.get(name):errors.append('Missing %s. Run ./setup.sh interactively to install basic tools, then review the engine plan.' % name)@@ -448,6 +459,8 @@ def plan(args, *, local_progress=None):if mac_target:from .macos_bootstrap import describe_plandescribe_plan(value)+ else:+ value['cuda_compatibility'] = compatibilityreturn valuediff --git a/freevideo_engine/doctor.py b/freevideo_engine/doctor.pyindex a6e5f34..99559f7 100644--- a/freevideo_engine/doctor.py+++ b/freevideo_engine/doctor.py@@ -17,6 +17,7 @@ def doctor(*, probe=False, hardware=None, backends=None):backends = set(installed_backends() if backends is None else backends)paths = {'vdn': vdn_root(), 'base': base_path(), 'checkpoint': checkpoint_path(), 'comfy': comfy_root()}result = {'hardware': hardware.to_dict(), 'versions': versions,+ 'cuda_compatibility': hardware.cuda_compatibility(),'installed_attention_packages': sorted(backends),'paths': {k: {'path': str(p), 'exists': p.exists()} for k, p in paths.items()},'validation': 'Package and path discovery only. Run bench to check actual kernels and performance.'}diff --git a/freevideo_engine/failure_details.py b/freevideo_engine/failure_details.pyindex d80b0ab..7d87464 100644--- a/freevideo_engine/failure_details.py+++ b/freevideo_engine/failure_details.py@@ -91,6 +91,14 @@ def launcher_failure(value, *, zh=False):action='展开详情或导出报告,查看完整检查结果。' if zh else'Open the details or export the report for the complete results.', kind='kernels')rules = (+ (r'CUDA_ARCH_UNSUPPORTED', 'gpu-architecture',+ ('This GPU lacks the required compute support', '这张显卡不满足当前计算要求'),+ ('The detected GPU and compute capability are shown below. The CUDA runtime requires native BF16 computation (SM80 or newer). Use a compatible GPU; changing the driver does not change its hardware capability.',+ '下方显示实际显卡和计算能力。当前 CUDA 引擎要求原生 BF16 计算(SM80 及以上);需要使用兼容显卡,更新驱动无法改变显卡的硬件能力。')),+ (r'CUDA_CAPABILITY_UNKNOWN', 'gpu-detection',+ ('The GPU architecture could not be read', '未能读取显卡架构'),+ ('Retry hardware detection. If it still fails, export the report; it includes the GPU identity and the raw driver query.',+ '请重试硬件检测。仍失败时导出报告,其中包含显卡信息和驱动查询的原始结果。')),(r'ComfyUI is still running a job', 'busy',('A video is still generating', '还有视频正在生成'),('The update is installed. Click Connect again after the job finishes to restart ComfyUI with it.',diff --git a/freevideo_engine/hardware.py b/freevideo_engine/hardware.pyindex d248c69..4d95b3a 100644--- a/freevideo_engine/hardware.py+++ b/freevideo_engine/hardware.py@@ -26,16 +26,57 @@ class Hardware:@propertydef architecture(self):- if self.capability in ((8, 0), (8, 6)):+ if len(self.capability) != 2 or any(type(v) is not int for v in self.capability):+ return 'other'+ if (8, 0) <= self.capability < (8, 9):return 'ampere'if self.capability == (8, 9):return 'ada'- if self.capability == (9, 0):+ if self.capability[0] == 9:return 'hopper'+ if self.capability in ((10, 0), (10, 3)):+ return 'blackwell-datacenter'+ if self.capability == (11, 0):+ return 'blackwell-tegra'+ if self.capability == (12, 1):+ return 'blackwell-unified'if self.capability[0] == 12:return 'blackwell-rtx'return 'other'+ def cuda_compatibility(self):+ """The engine's arithmetic floor, not a GPU model or performance allowlist.++ Passing this check permits setup. The installed Torch, Triton and+ attention kernels must still execute successfully on the selected GPU.+ CPU architecture/platform and driver requirements are checked separately.+ """+ capability = self.capability+ known = (len(capability) == 2 and all(type(v) is int for v in capability)+ and capability[0] > 0 and 0 <= capability[1] <= 9)+ sm = '%d%d' % capability if known else 'unknown'+ admitted = known and capability >= (8, 0)+ status = ('probe-required' if admitted else+ 'CUDA_ARCH_UNSUPPORTED' if known else 'CUDA_CAPABILITY_UNKNOWN')+ detail = '%s (SM%s; compute capability %s; driver %s)' % (+ self.gpu_name, sm, '.'.join(map(str, capability)) if known else 'unknown',+ self.driver_version or 'unknown')+ error = None+ if not admitted:+ if known:+ error = ('[CUDA_ARCH_UNSUPPORTED] ' + detail + '. FreeVideo requires '+ 'native BF16 GPU computation (compute capability 8.0 / SM80 or newer). '+ 'This GPU is below that hardware requirement; a driver update cannot add it.')+ else:+ error = ('[CUDA_CAPABILITY_UNKNOWN] Could not determine the CUDA architecture of '+ + detail + '. GPU detection did not return a valid compute capability. '+ 'Retry detection or export the report for the driver query result.')+ return dict(status=status, admitted=admitted, gpu_name=self.gpu_name,+ capability=list(capability), minimum_capability=[8, 0],+ driver_version=self.driver_version, architecture=self.architecture,+ linear_compute=('bf16-weight-only' if capability < (8, 9) else 'native-fp8') if admitted else None,+ validation='Actual linear and attention kernel probes are required before readiness.', error=error)+def to_dict(self):return dict(asdict(self), architecture=self.architecture)diff --git a/freevideo_engine/policy.py b/freevideo_engine/policy.pyindex d0173fb..8fab397 100644--- a/freevideo_engine/policy.py+++ b/freevideo_engine/policy.py@@ -482,8 +482,9 @@ def choose(hardware: Hardware, *, vram_gib=None, ram_gib=None, attention='auto',raise ValueError('Reference token counts must be nonnegative integers')reference_rows += counteffective_tokens = canvas['video_tokens'] + reference_rows if canvas is not None else None- if hardware.capability < (8, 0):- raise ValueError('This engine targets Ampere and newer NVIDIA GPUs.')+ compatibility = hardware.cuda_compatibility()+ if compatibility['error']:+ raise ValueError(compatibility['error'])budget = resource_budget(hardware, vram_gib=vram_gib, ram_gib=ram_gib,gpu_reserve_gib=gpu_reserve_gib, ram_reserve_gib=ram_reserve_gib)gpu_total, ram_total = budget['gpu_capacity_bytes'], budget['ram_capacity_bytes']