Skip to content

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.

Linux setup from the GUI downloads missing Git and a C++ compiler privately

Bowen Xuef558abfa72a2
diff --git a/freevideo_engine/bootstrap.py b/freevideo_engine/bootstrap.py
index 6d010b4..ff8f535 100644
--- a/freevideo_engine/bootstrap.py
+++ b/freevideo_engine/bootstrap.py
@@ -362,7 +362,6 @@ def inventory(gpu=None):
'cpu_threads': os.cpu_count(), 'swap_total_bytes': ram.get('swap_total_bytes'),
'swap_free_bytes': ram.get('swap_free_bytes'), 'system_memory': ram,
'compiler': shutil.which('cl' if platform.system() == 'Windows' else 'g++'), 'git': usable_git(),
- **({} if platform.system() == 'Windows' else {'make': shutil.which('make')}),
'git_found': shutil.which('git'), **detection}
@@ -523,10 +522,6 @@ def prepare_end(ui, success=True):
ui.end(PREPARE_KEY, success=success)
-def missing_sage_tools(snapshot):
- return ([] if snapshot.get('compiler') else ['g++']) + ([] if snapshot.get('make', True) else ['make'])
-
-
def plan(args, *, local_progress=None, stage=None):
root = args.root.expanduser().resolve()
warnings = []
@@ -579,17 +574,6 @@ def plan(args, *, local_progress=None, stage=None):
errors.append(compatibility['error'])
snapshot['cuda_compatibility'] = compatibility
# A missing or too old Git is replaced by FreeVideo's own.
- if not windows_target:
- # ./setup.sh installs these before planning; the desktop launcher names the command instead.
- missing = missing_sage_tools(snapshot)
- if missing:
- from .system import linux_tools_command
- command = linux_tools_command(missing)
- warnings.append('Missing %s, needed to build GPU acceleration for this GPU. %s, then check again.' % (
- ' and '.join(missing), 'In a terminal, run: ' + command if command else
- 'Ask your administrator to install them'))
- logging.getLogger(__name__).warning('%s Skipping Sage2 source compilation; '
- 'continuing with cudnn/torch-flash attention.', warnings[-1])
if offline_installation(root):
# Its sources carry no Git history and its Python is the package's.
errors.append('This folder holds an installation from offline packages; automatic installation does not change it. '
@@ -1797,11 +1781,6 @@ class Installer:
def install_sage(self, uv, python):
if self.system == 'Windows':
return self.install_sage_windows(uv, python)
- missing = missing_sage_tools(self.plan['inventory'])
- if missing:
- self.ui.write('Missing %s; skipping Sage2 source compilation and continuing with '
- 'cudnn/torch-flash attention.\n' % ' and '.join(missing))
- return None
code = ('import json,platform,sys,torch; print(json.dumps(dict('
'python="cp"+str(sys.version_info.major)+str(sys.version_info.minor), '
'torch=str(torch.__version__),cuda=torch.version.cuda,cxx11_abi=torch.compiled_with_cxx11_abi(), '
@@ -1866,7 +1845,11 @@ class Installer:
"""
spec = json.loads((PACKAGE / 'gcc_linux.json').read_text(encoding='utf-8'))
below = spec['host_compiler_below'].get(cuda)
- choice = host_compiler_choice(below, self.env['PATH'], self.env) if below else {}
+ # Without any system g++, FreeVideo's own compiler builds Sage2.
+ if not shutil.which('g++', path=self.env['PATH']):
+ choice = None
+ else:
+ choice = host_compiler_choice(below, self.env['PATH'], self.env) if below else {}
if choice is None:
return {'env': None, 'identity': 'conda-forge gcc ' + spec['version']}
cxx = choice.get('CXX', 'g++')
@@ -1897,6 +1880,13 @@ class Installer:
shutil.rmtree(explicit.parent, ignore_errors=True)
micromamba.unlink(missing_ok=True)
self.command('portable-gcc-check', [compilers['CXX'], '--version'])
+ # The same compiler under its plain names, for tools that look for gcc (Triton builds its launcher with it).
+ links = self.root / 'tools' / 'gcc-bin'
+ links.mkdir(parents=True, exist_ok=True)
+ for name, target in (('gcc', compilers['CC']), ('cc', compilers['CC']), ('g++', compilers['CXX'])):
+ if not (links / name).is_symlink() or Path(os.readlink(links / name)) != target:
+ (links / name).unlink(missing_ok=True)
+ (links / name).symlink_to(target)
return {key: str(path) for key, path in compilers.items()}
def install_sage_windows(self, uv, python):
diff --git a/freevideo_engine/comfy_environment.py b/freevideo_engine/comfy_environment.py
index f3d1625..c795b8d 100644
--- a/freevideo_engine/comfy_environment.py
+++ b/freevideo_engine/comfy_environment.py
@@ -1,5 +1,6 @@
"""Keep ComfyUI process configuration out of managed engine children."""
import os
+import shutil
from pathlib import Path
import sys
@@ -34,6 +35,10 @@ def isolated_environment(root, source, environ=None):
env.pop(name, None)
env.update(FREEVIDEO_HOME=str(root), FREEVIDEO_PROXY_MODE=proxy_mode, PYTHONPATH=str(source), PYTHONNOUSERSITE='1',
PYTHONUTF8='1', PYTHONIOENCODING='utf-8', NO_COLOR='1', FREEVIDEO_UI_EVENTS='1')
+ # Without a system compiler, tools that build at run time (Triton) use the one FreeVideo installed.
+ private = Path(root) / 'tools' / 'gcc-bin' / 'gcc'
+ if os.name != 'nt' and 'CC' not in env and private.exists() and not shutil.which('gcc', path=env.get('PATH')):
+ env['CC'] = str(private)
from .triton_compat import temporary_environment
# Pruning sys.prefix above also prunes the frozen launcher's static curl.
# Restore its fallback for managed Python after isolating Python packages.
diff --git a/scripts/bootstrap_linux.sh b/scripts/bootstrap_linux.sh
index 6257f83..37acff7 100644
--- a/scripts/bootstrap_linux.sh
+++ b/scripts/bootstrap_linux.sh
@@ -130,13 +130,17 @@ fv_system_deps() {
fv_note 'System package step (existing Python and drivers are not replaced):'
((${#refresh[@]} == 0)) || { printf ' '; printf '%q ' "${privilege[@]}" "${refresh[@]}"; printf '\n'; } >&2
{ printf ' '; printf '%q ' "${privilege[@]}" "${install[@]}"; printf '\n'; } >&2
+ local command_line
+ command_line="$(printf '%q ' "${privilege[@]}" "${install[@]}")"
if (( fv_readonly )); then
fv_fail 'Check only: no system packages installed. Run ./setup.sh to install the missing tools.'
return 1
fi
if (( ! fv_allow_system )); then
if [[ ! -t 0 ]]; then
- fv_fail 'System packages need approval. Run interactively, or add --install-system-deps to a reviewed unattended setup.'
+ # A desktop launcher has no terminal to ask in, so name the command to run by hand.
+ fv_fail "缺少基础工具:${fv_missing[*]}。请在终端运行以下命令,然后重新安装:${command_line% }"
+ fv_note "Missing basic tools: ${fv_missing[*]}. Run this in a terminal, then install again: ${command_line% }"
return 1
fi
printf 'Install these missing system packages? [Y/n] / 回车安装以上基础工具,n 取消: ' >&2
@@ -375,7 +379,8 @@ freevideo_bootstrap_linux() {
[[ -n "${all_proxy:-}" || -z "${ALL_PROXY:-}" ]] || export all_proxy="$ALL_PROXY"
[[ -n "${no_proxy:-}" || -z "${NO_PROXY:-}" ]] || export no_proxy="$NO_PROXY"
if [[ "$mode" == setup ]] && (( ! fv_readonly )); then
- fv_missing_tools git curl g++ make tar gzip sha256sum flock
+ # Git and a C++ compiler are downloaded privately by the installer when the machine has none.
+ fv_missing_tools curl tar gzip sha256sum flock
fv_system_deps || return 1
fi
if (( found )); then