-
Notifications
You must be signed in to change notification settings - Fork 7.4k
feat: control CUDA deps #11355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: control CUDA deps #11355
Conversation
- Pre-install CPU-only PyTorch to avoid GPU version (saves ~4-5GB) - Add BUILD_MINERU build arg for optional mineru installation - Modify pip_install_torch() to default to CPU-only PyTorch - Update entrypoint to handle CPU-only PyTorch for mineru - Add comprehensive documentation for CUDA optimizations Benefits: - Reduces image size from ~6-8GB to ~2-3GB (60-70% reduction) - Eliminates massive CUDA package downloads during build/runtime - Maintains full functionality with CPU processing - Optional GPU support via GPU_PYTORCH=true environment variable - Significantly faster build times and reduced bandwidth usage Fixes: Docker image downloading tons of CUDA packages unnecessarily
- Fix uv pip install syntax to use --python flag instead of incorrect venv activation - Add proper CPU-only PyTorch installation in main and mineru environments - Update entrypoint scripts to check for pre-installed packages first - Ensure proper fallback to runtime installation when needed The previous commit only included documentation files, this commit adds the actual implementation.
Signed-off-by: Björn thorwirth <[email protected]>
|
srry .. firs request was accident .. now it's tested |
| return 1 | ||
| else | ||
| echo "[mineru] installed: ${MINERU_EXECUTABLE}" | ||
| return 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @moonstruxx
Thank you for your contribution. This looks good to me.
But I think here it should return 0 to indicate that MinerU has been installed successfully. Returning a non-zero value will cause the program to fail unexpectedly. However, since we have the restart: on-failure strategy, it will succeed on the next try.
I personally recommend changing it to express the correct semantic meaning. However, as I said, it doesn't really matter. It's up to you.
Cheers.

What problem does this PR solve?
Benefits:
Fixes: Docker image downloading tons of CUDA packages unnecessarily
Type of change