主机软件

CUDA Driver APICUDA Driver API

CUDA Driver API 是 NVIDIA CUDA 驱动的用户空间组件。 提供了类似 C 标准库的工具函数:例如,用于在 GPU 设备上分配 内存 的函数 cuMalloc

CUDA 工具包。CUDA Driver API 位于应用程序或其他工具包组件与 GPU 之间。改编自《Professional CUDA C Programming Guide》。

很少有 CUDA 程序直接使用 CUDA Driver API,大多数情况下开发者会选择更易用的 CUDA Runtime API。请参阅 CUDA Driver API 文档中的 章节

CUDA Driver API 通常不进行静态链接,而是动态链接,在 Linux 系统上,其典型动态库名称为 libcuda.so

CUDA Driver API 具有二进制兼容性:针对旧版 CUDA Driver API 编译的应用程序,可在安装新版本 CUDA Driver API 的系统上运行。也就是说,操作系统的二进制加载器可以加载新版 CUDA Driver API,而程序功能保持不变。

关于 CUDA C/C++ 应用程序的详细信息,请参阅 NVIDIA 的 CUDA C/C++ 最佳实践指南

需要注意的是,CUDA Driver API 是闭源的,您可以在 此处 找到其文档。

尽管使用较少,但存在一些项目试图提供或使用 CUDA Driver API 的开源替代方案,例如 LibreCudatinygrad。详情请参阅其源代码

英文原文(Modal GPU Glossary)

The CUDA Driver API is the userspace component of the NVIDIA CUDA drivers. It provides utilities familiar to users of the C standard library: a cuMalloc function for allocating memory on GPU devices, for example.

Very few CUDA programs are written to directly use the CUDA Driver API. They instead use the CUDA Runtime API. See this section of the CUDA Driver API docs.

The CUDA Driver API is generally not linked statically. Instead, it is linked dynamically, typically under the name libcuda.so on Linux systems.

The CUDA Driver API is binary-compatible: an application compiled against old versions of the CUDA Driver API can run on systems with newer versions of the CUDA Driver API. That is, the operating system's binary loader may load a newer version of the CUDA Driver API and the program will function the same.

For details on distributing CUDA C/C++ applications, see the CUDA C/C++ Best Practices Guide from NVIDIA.

The CUDA Driver API is closed source. You can find its documentation here.

Though they are not commonly used, there are projects that attempt to provide or use open source alternatives to the CUDA Driver API, like LibreCuda and tinygrad. See their source code for details.

相关词条

本词条改编自 Modal GPU Glossary(CC BY 4.0)· 中文翻译 miter6/gpu-glossary-zh,MAE 整理排版。