Make `cuda-bindings` buildable against CTK wheels?
还没有人认领这个 Issue。
- 主要语言
- Cython
- 星标
- 3.4k
- 派生
- 329
- 平均合并
- 1 天 21 小时
- 30 天内合并 PR
- 113
描述
The meaning of the title is that pip install . from source can work without a local CTK environment (no need to set CUDA_PATH and all that). Everything is purely pip-wheel based.
This is actually doable, I just don't believe there is a serious use case because we really want users to not build from source, nor do I want to spend my time on enabling it, but I can be convinced. Anyway it's worth writing this up somewhere in the public.
The whole thing relies on the fact that building bindings just need a host compiler; no NVCC is needed. The steps is as follows:
- We list needed CTK wheels in the
[build-system.requires]session. They will provide the needed headers. - Since
setuptoolsdoes not provide a way for us to programmatically query the path to the isolated build environment at build time, we search the potential paths based on the assumption thatsys.pathmust be updated forsetuptoolsto find the build env. - We pass
<build env path>tosetuptoolsso that the CUDA headers can be found by gcc/msvc.
I enabled this for nvmath-python and it did worked like a charm, but the situation was a lot simpler than driver/runtime modules that we have here.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,将 cuda-python 的构建配置与所引用的 nvmath-python pyproject.toml 以及 builder/utils.py 中的方法进行比较。确定仅使用 pip-wheel-only 的源代码安装是否能够在没有 CUDA_PATH 的情况下找到 CTK 头文件;完成标准是:在没有本地 CTK 环境的情况下,pip install . 能够成功执行。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- build-system
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100