What is the recommended way of distributing CUDA dependent packages?

There is an issue with the large size of manylinux wheels that depend on the cuda libraries. For example, the size of a small package (< 2 MB) increases to over 400MB after auditwheel repair bundles libcudart, libcublas, and libcusparse libraries to the wheel. The large size prevents uploading wheel to pypi due to the 100MB size limit.

There seems to be an ongoing discussion on the GPU. However, at the moment, what is a practical way of distributing cuda-dependent packages?

As a workaround, is it possible to exclude cuda libraries from the wheel and require cuda to be installed by the user end? If viable, is this a reasonable solution?

I am not sure how to prevent auditwheel to bundle some libraries. I found this discussion suggesting making libraries a part of the platform, but it is not clear to me how to do so. Any suggestions are welcome.

1 Like


You could dynamically load these CUDA libraries using dlopen instead of explicitly link against them.

In that case, users are required to install a specific CUDA version on their system. I think this is reasonable since popular packages like TensorFlow are working this way.

You can find an example in this project Iā€™m working on. We faced a similar issue after hitting the PyPI upload limit.

1 Like