NVIDIA / NVIDIA/cuda-python

Make `cuda-bindings` buildable against CTK wheels?

Aperta
#692 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

cuda.bindings P1 packaging
Lingua principale
Cython
Stelle
3.4k
Fork
329
Merge medio
1g 23h
PR unite (30g)
116

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia confrontando la configurazione di build di cuda-python con il pyproject.toml di nvmath-python indicato e l’approccio di builder/utils.py. Determina se un’installazione dai sorgenti pip-wheel-only può individuare gli header CTK senza CUDA_PATH; il lavoro è completato quando pip install . riesce senza un ambiente CTK locale.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
build-system
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.