v0.8.6 - REAL fix: stdlib bundling + lazy gpu_filters (tested in .exe)
v0.8.6 — TESTED in the real .exe environment this time
What I did differently
Built a console-mode test .exe and added a hidden CLI command vid2dataset gpu-test that runs the full GPU activation sequence and prints what works / what fails. Iterated against the actual .exe environment until every step passed:
activate_runtime: ok=True
torch=2.5.1+cu121 from cache
cuda available: True
device: NVIDIA GeForce RTX 3090
matmul OK: sum=5037.38
device_summary: GPU pipeline: CUDA on NVIDIA GeForce RTX 3090
pipeline available: True
BatchSSIMFilter constructed OK
[OK] === GPU runtime fully working ===
Why v0.8.5 still failed
The error you got — ImportError: No module named 'timeit' — wasn't reproducible in my .venv tests because real Python has the entire stdlib available. The PyInstaller .exe is different: when --exclude-module torch removes torch from the import graph, PyInstaller stops tracing what torch imports. So 159 stdlib modules torch needs (timeit, unittest.mock, multiprocessing.connection, asyncio.events, ...) were missing from the .exe bundle.
之前的測試是在真 Python 跑,stdlib 完整所以看不到問題。.exe 用 PyInstaller bundle,因為 torch 被 exclude,PyInstaller 也把 torch 用到的 stdlib 一起丟掉,所以 timeit 等模組消失。這次直接在 .exe 裡面測。
Three fixes
-
build_exe.pybundles 159 stdlib modules as--hidden-import. List was AST-scanned from torch + numpy + sympy + the other cache deps to find every stdlib reference. Includestimeit,unittest.mock,multiprocessing.connection,concurrent.futures.process, etc. -
gpu_filterslazy-imports torch. Previously_HAS_TORCH = Falsewas baked at module load time (beforeactivate_runtime()). After activation, the False stayed cached ->is_gpu_pipeline_available()returned False even with working CUDA. Now uses_ensure_torch()which re-checks on every call. -
New diagnostic command
vid2dataset gpu-test(also works in the .exe — just spawn a console). Prints exactly what loads, what fails, what CUDA reports. Use this if you hit any future activation issue.
Status
- v0.8.3 — discovered mirror race bug, fixed it, missed numpy / stdlib issues
- v0.8.4 — claimed numpy fix but the edit silently failed
- v0.8.5 — added cache-append + retry logic, but PyInstaller stdlib issue made it still fail in .exe
- v0.8.6 — actually verified end-to-end in the real .exe environment
Update
- Check for Updates in the app, or download below
- Tick GPU 加速
- Cache will redownload (RUNTIME_VERSION bumped). After ~10min download, GPU should activate
- If anything still fails: open a console and run
vid2dataset.exe gpu-test, send me the output
Download
- vid2dataset.exe (151 MB)