Stop redefining structs and types for Graphics APIs #488
Labels
breaking
Breaking changes are introduced
cuda.bindings
Everything related to the cuda.bindings module
enhancement
Any code-related improvements
triage
Needs the team's attention
Milestone
When the Driver and Runtime bindings are generated, we redefine the types from headers:
We do this so that source builds don't have to depend on system headers for "vdpau/vdpau.h", "OpenGL/gl.h", "EGL/egl.h" and "EGL/eglext.h". The consequence of depending on them are the build systems and users will need to install
pyopengl
andlibvdpau-dev
before proceeding with a source build.This issue proposes that we stop redefining these types, require users to fulfill this source build dependency and use the types by importing them from the headers. This is a breaking change.
This issue is motivated from the triage of changing Runtime to statically link to
libcudart_static
for issue #100. The goal for that issue is to completely remove all re-implementations of CUDA Runtime in cuda_bindings/cuda/bindings/_lib/cyruntime. The problem is that redefined types are not type-compatible with the graphics APIs in the static library, therefore a subset of these APIs will continue to be re-implemented and we won't be able to fully clean this up. The silver-lining though is that these APIs should be stable, so no maintenance cost is expected in future releases.Making this change has another benefit. Historically, we once had all Driver types redefined but that did not allow Cython users to interoperate between the types that they import and the CUDA Python Driver types. Therefore by having graphics types get defined by the header would extend that use-case to here as well. However, no know user is utilizing this use-case.
Final note is for Windows, the VDPAU are the only headers not distributed as part of a CTK will therefore need to be removed as part of a Tempita platform check. This change is trivial and would remove APIs that would have never worked on Windows anyways (VDPAU is a Unix only library).
P.S.
For future reference, one of the types needs to change to:
but there were still errors to be resolved in the Python layer so this might not be the final form.
The text was updated successfully, but these errors were encountered: