NVIDIA / NVIDIA/cuda-python

Make `cuda-bindings` buildable against CTK wheels?

Offen
#692 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

cuda.bindings P1 packaging
Vorherrschende Sprache
Cython
Sterne
3.4k
Forks
329
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
116

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die Build-Konfiguration von cuda-python mit der referenzierten pyproject.toml und dem Ansatz in builder/utils.py von nvmath-python zu vergleichen. Ermittle, ob eine pip-wheel-only-Quellinstallation die CTK-Header ohne CUDA_PATH finden kann; die Aufgabe ist abgeschlossen, wenn pip install . ohne eine lokale CTK-Umgebung erfolgreich ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
build-system
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.