NVIDIA / cuda-python

CUDA Python Low-level Bindings
https://nvidia.github.io/cuda-python/
Other
886 stars 74 forks source link

RFC: Statically link to cudart #100

Open leofang opened 2 months ago

leofang commented 2 months ago

Currently CUDA Python has a Cython-based reimplementation of CUDA runtime on top of the CUDA driver APIs. This is significant effort in terms of maintenance, requiring a lot of engineering time, as we have to catch up with every new cudart APIs indefinitely.

This RFC reflects the team's plan that we will switch to statically linking to cudart on all platforms (Linux & Windows) instead, starting from the next CUDA major release. That is, for cuda-python X.Y.Z we statically link to libcudart_static.a on Linux (or cudart_static.lib on Windows) from CUDA Toolkit X.Y.Z.

By doing this, the benefits include:

Please let us know if this could be a concern to your project, as we do not anticipate any issue or any user-visible effects. Thanks!

vyasr commented 2 weeks ago

Presumably since this is static linking it completely gets around the original issues that led to the reimplementation of the runtime, which IIRC was something to do with cudart DLL load orders on Windows?

vyasr commented 2 weeks ago

https://github.com/NVIDIA/cuda-python/issues/16#issuecomment-1018880404 looks like it