Skip to content
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

Require only CUDA wheels (no system CTK) in pip packages #143

Open
bdice opened this issue Jan 24, 2025 · 1 comment
Open

Require only CUDA wheels (no system CTK) in pip packages #143

bdice opened this issue Jan 24, 2025 · 1 comment

Comments

@bdice
Copy link
Contributor

bdice commented Jan 24, 2025

Installing RAPIDS via pip should work with only CUDA wheels, with no requirement for a system CUDA Toolkit (only a driver).

Benefits:

  • This would allow us to shrink our citestwheel CI image significantly.
  • Users would use a single, consistent CTK source for all libraries adjacent to RAPIDS

Work tracked in #35, #137 added support for using CUDA wheels for math libraries. I think we already statically link the runtime in all our wheel builds, which is discussed in #4.

The action items I know of are primarily in RAPIDS dependencies, including cupy and numba-cuda:

This issue should be used to track those items and any other dependencies.

@bdice
Copy link
Contributor Author

bdice commented Mar 4, 2025

I measured the size of a base Ubuntu image with CUDA wheels installed. It is about 3.7GB (compressed) when installing all CUDA wheels on top of Ubuntu 24.04.

For comparison, nvidia/cuda:12.8.0-devel-ubuntu24.04 is 4.83 GB compressed.

There are minor space savings here (23%). I haven't checked what components are different between the two images.

The longer-term benefit for using only CUDA wheels is for people who just want pip install to work on any image. In that future, we can use a base flavor of nvidia/cuda (tiny! <100 MB!) and get everything else in the CUDA Toolkit via pip. Specifically, we won't have to pay for downloading components that we don't depend on in RAPIDS.

Reproduction commands

Save this as Dockerfile in a directory:

FROM ubuntu:24.04
# Update packages and install Python3, pip, and venv
RUN apt-get update && apt-get install -y python3 python3-pip python3-venv
# Create a virtual environment
RUN python3 -m venv /venv
# Activate the virtual environment by updating PATH
ENV PATH="/venv/bin:$PATH"
# Install the NVIDIA dependencies inside the virtual environment
RUN pip install \
    nvidia-cublas-cu12 \
    nvidia-cuda-cccl-cu12 \
    nvidia-cuda-cupti-cu12 \
    nvidia-cuda-cuxxfilt-cu12 \
    nvidia-cuda-nvcc-cu12 \
    nvidia-cuda-nvrtc-cu12 \
    nvidia-cuda-opencl-cu12 \
    nvidia-cuda-profiler-api-cu12 \
    nvidia-cuda-runtime-cu12 \
    nvidia-cuda-sanitizer-api-cu12 \
    nvidia-cufft-cu12 \
    nvidia-curand-cu12 \
    nvidia-cusolver-cu12 \
    nvidia-cusparse-cu12 \
    nvidia-npp-cu12 \
    nvidia-nvfatbin-cu12 \
    nvidia-nvjitlink-cu12 \
    nvidia-nvjpeg-cu12 \
    nvidia-nvml-dev-cu12 \
    nvidia-nvtx-cu12
CMD ["bash"]

Inside that directory, run the following:

docker build -t ubuntu-cuda-pip .
docker save ubuntu-cuda-pip | gzip > ubuntu-cuda-pip.tar.gz
ls -alh ubuntu-cuda-pip.tar.gz

Total size: 3.7G

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant