NVIDIA / NVIDIA/cuda-python

Make `cuda-bindings` buildable against CTK wheels?

Đang mở
#692 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

cuda.bindings P1 packaging
Ngôn ngữ chính
Cython
Star
3.4k
Fork
329
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
116

Mô tả

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 setuptools does 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 that sys.path must be updated for setuptools to find the build env.
  • We pass <build env path> to setuptools so 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách so sánh cấu hình build của cuda-python với pyproject.toml được tham chiếu của nvmath-python và cách tiếp cận trong builder/utils.py. Xác định xem việc cài đặt từ mã nguồn pip-wheel-only có thể tìm thấy các header CTK mà không cần CUDA_PATH hay không; được xem là hoàn thành khi pip install . thành công mà không có môi trường CTK cục bộ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
build-system
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.