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

cuda-python conda packages should avoid depending on the entire CUDA Toolkit #43

Closed
bdice opened this issue Feb 6, 2023 · 8 comments
Closed

Comments

@bdice
Copy link

bdice commented Feb 6, 2023

Conda packages released for cuda-python to the nvidia channel depend on cuda-toolkit, i.e. the entire CUDA Toolkit.

https://anaconda.org/nvidia/cuda-python/files?version=12.0.0

The cuda-python package should declare dependencies only on components that are actually used, which might be a more limited subset like these, which I found by reading extern from declarations:

@jakirkham
Copy link
Collaborator

Would the cuda-cudart package be sufficient? Or is more needed than that?

@bdice
Copy link
Author

bdice commented Feb 6, 2023

@jakirkham I think building the package requires CUDA headers (so -dev packages for cuda-cudart-dev and cuda-nvrtc-dev). At runtime, perhaps only cuda-cudart and cuda-nvrtc are needed?

The features depending on cudaProfiler.h are not brought in as a dependency of cuda-cudart and thus must be explicitly depended on via cuda-profiler-api at build time.

@leofang
Copy link
Member

leofang commented Feb 6, 2023

cuda-cudart is not needed at runtime, as currently the cudart layer in CUDA Python is a reimplementation of cudart. So just NVRTC.

@jakirkham
Copy link
Collaborator

Thanks all! That sounds reasonable. Let's see if @vzhurba01 & @m3vaz have more thoughts 🙂

@vzhurba01
Copy link
Collaborator

As pointed out, building the package requires CUDA headers. The headers parsed are:

header_dict = {

For building, the headers can be categorized into 3 groups:

  1. Required to build
  2. Optional to enable features
  3. Always enabled

(1) Referenced by extern from, list by @bdice looks complete
(2) Not used right now
(3) cuda_profiler_api.h and graphics APIs (EGL, GL, VDPAU)

For runtime, the requirements are:

  1. NVRTC is needed if you use NVRTC
  2. CUDART is needed if you build kernels referencing some CUDART types

(2) Many types are built-in though, but not all. One of the ported examples/samples encounter such a scenario.

Perhaps (2) can be limited to only the built-in types, and remaining dependency if needed can be added by users?

@bdice
Copy link
Author

bdice commented Feb 8, 2023

I would be happy to keep cudart and nvrtc as “hard” runtime dependencies to ensure the package is fully functional. The main parts I want to strip out are the rest of cuda-toolkit that make it very large, like math libraries.

How should we go about making this change? The conda-forge side can simply use this dependency list. We’ll want to reflect the same set of dependencies for the nvidia channel version and issue a new version (or a new build of the same version).

@vzhurba01
Copy link
Collaborator

Release v12.1.0 trims Conda dependencies to only require NVRTC and CUDART (excluding math libraries). Closing.

@jakirkham
Copy link
Collaborator

Thanks Vlad! 🙏

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

4 participants