InteropUnityCUDA: A Tool for Interoperability Between Unity and CUDA
Université de Poitiers, XLIM, Poitiers, France
Software: Practice and Experience, 2025
DOI:10.1002/spe.3414
Introduction: Unity is a powerful and versatile tool for creating real-time experiments. It includes a built-in compute shader language, a C-like programming language designed for massively parallel General-Purpose GPU (GPGPU) computing. However, as Unity is primarily developed for multi-platform game creation, its compute shader language has several limitations, including the lack of multi-GPU computation support and incomplete mathematical libraries. Contribution: To address these limitations, GPU manufacturers have developed specialized programming models, such as CUDA and HIP, which enable developers to leverage the full computational power of modern GPUs. This article introduces an open-source tool designed to bridge the gap between Unity and CUDA, allowing developers to integrate CUDA’s capabilities within Unity-based projects. Methods: The proposed solution establishes an interoperability framework that facilitates communication between Unity and CUDA. The tool is designed to efficiently transfer data, execute CUDA kernels, and retrieve results, ensuring seamless integration into Unity’s rendering and computation pipeline. Results: Our tool extends Unity’s capabilities by enabling CUDA-based computations, overcoming the inherent limitations of Unity’s compute shader language. This integration allows developers to exploit multi-GPU architectures, leverage advanced mathematical functions, and enhance computational performance for real-time applications.
April 27, 2025 by hgpu