CUDA Graphics API Interoperability via Address Mapping
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing systems require inefficient data copying and buffer allocation when transitioning between graphics and compute APIs, hindering system performance by necessitating multiple buffer allocations and copies.
Innovation Solution
A method that registers a memory buffer for address mapping, allowing multiple APIs to access it, and uses semaphore mechanisms for synchronization, enabling direct access and exclusive usage without additional buffer allocation or data copying.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If data is copied from compute API memory to host memory and then to graphics API objects, then interoperability between APIs is achieved, but system performance deteriorates due to multiple buffer allocations and data copies
Solution Approach 1:
The patent merges the memory spaces of multiple APIs by mapping graphics API objects into the CUDA address space, allowing both graphics and compute APIs to access the same memory buffer directly without copying data between separate buffers
Solution Approach 2:
The patent introduces address mapping as an intermediary mechanism that translates between different API address spaces, enabling direct access to shared memory buffers while maintaining compatibility with multiple API interfaces
2Adaptability or versatility
If multiple buffers are allocated for compute and graphics operations, then API interoperability is enabled, but device complexity increases
Solution Approach 1:
The patent makes memory buffers universal by enabling them to be accessed by multiple APIs simultaneously through address mapping, eliminating the need for separate buffers for different API operations
Solution Approach 2:
The patent combines multiple API-specific buffers into a single shared memory space that can be accessed by both graphics and compute APIs, reducing the number of buffers from three to one
3Adaptability or versatility
If data is copied between compute API and graphics API buffers, then interoperability is achieved, but execution speed decreases
Solution Approach 1:
The patent enables continuous access to the same data by both graphics and compute APIs without interrupting the data flow through copying operations, maintaining uninterrupted execution pipelines
Solution Approach 2:
The patent merges the data paths of compute and graphics operations into a single shared memory buffer, eliminating the sequential copy operations that previously slowed down execution
Data Source
AI summary
One embodiment of the present invention sets forth a method for sharing graphics objects between a compute unified device architecture (CUDA) application programming interface (API) and a graphics API. The CUDA API includes calls used to alias graphics objects allocated by the graphics API and, subsequently, synchronize accesses to the graphics objects. When an application program emits a “register” call that targets a particular graphics object, the CUDA API ensures that the graphics object is in the device memory, and maps the graphics object into the CUDA address space. Subsequently, when the application program emits “map” and “unmap” calls, the CUDA API respectively enables and disables accesses to the graphics object through the CUDA API. Further, the CUDA API uses semaphores to synchronize accesses to the shared graphics object. Finally, when the application program emits an “unregister” call, the CUDA API configures the computing system to disregard interoperability constraints.


