[PR #52] [MERGED] feat(core/libcudart): add Python bindings for CUDA Runtime APIs #137

Closed
opened 2026-05-05 03:26:34 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/XuehaiPan/nvitop/pull/52
Author: @XuehaiPan
Created: 12/27/2022
Status: Merged
Merged: 12/28/2022
Merged by: @XuehaiPan

Base: mainHead: libcudart


📝 Commits (3)

  • b856a6e feat(core/libcudart): add Python bindings for CUDA Runtime APIs
  • e9ed6d1 docs(core/libcudart): update documentation for libcudart
  • 945f2c6 feat(core/device): add method cuda_compute_capability

📊 Changes

9 files changed (+940 additions, -98 deletions)

View changed files

📝 README.md (+94 -89)
docs/source/core/libcudart.rst (+8 -0)
📝 docs/source/index.rst (+1 -0)
📝 docs/source/spelling_wordlist.txt (+1 -0)
📝 nvitop/__init__.py (+1 -1)
📝 nvitop/core/__init__.py (+2 -1)
📝 nvitop/core/device.py (+48 -4)
📝 nvitop/core/libcuda.py (+64 -3)
nvitop/core/libcudart.py (+721 -0)

📄 Description

Issue Type

  • Improvement/feature implementation

Runtime Environment

  • Operating system and version: Ubuntu 20.04 LTS
  • Terminal emulator and version: GNOME Terminal 3.36.2
  • Python version: 3.11.1
  • NVML version (driver version): 525.60.11
  • nvitop version or commit: 0.11.0
  • python-ml-py version: 11.515.75
  • Locale: en_US.UTF-8

Description

Add Python bindings for CUDA Runtime APIs (cudart) and add method cuda_runtime_version().

Motivation and Context

Support to detect the CUDA runtime version.

In [1]: from nvitop import *

In [2]: Device.driver_version()
Out[2]: '525.60.11'

In [3]: Device.cuda_driver_version()
Out[3]: '12.0'

In [4]: Device.max_cuda_version()
Out[4]: '12.0'

In [5]: Device.cuda_runtime_version()
Out[5]: '11.8'
$ LD_LIBRARY_PATH="/usr/local/cuda-10.2/lib64:${LD_LIBRARY_PATH}" python3 -c 'from nvitop import Device; print(Device.cuda_runtime_version())'
10.2

$ LD_LIBRARY_PATH="/usr/local/cuda-11.1/lib64:${LD_LIBRARY_PATH}" python3 -c 'from nvitop import Device; print(Device.cuda_runtime_version())'
11.1

$ LD_LIBRARY_PATH="/usr/local/cuda-11.3/lib64:${LD_LIBRARY_PATH}" python3 -c 'from nvitop import Device; print(Device.cuda_runtime_version())'
11.3

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/XuehaiPan/nvitop/pull/52 **Author:** [@XuehaiPan](https://github.com/XuehaiPan) **Created:** 12/27/2022 **Status:** ✅ Merged **Merged:** 12/28/2022 **Merged by:** [@XuehaiPan](https://github.com/XuehaiPan) **Base:** `main` ← **Head:** `libcudart` --- ### 📝 Commits (3) - [`b856a6e`](https://github.com/XuehaiPan/nvitop/commit/b856a6ed1bf885fe801f1091e662136bff4d0d62) feat(core/libcudart): add Python bindings for CUDA Runtime APIs - [`e9ed6d1`](https://github.com/XuehaiPan/nvitop/commit/e9ed6d1ab0d647e4ebe8273b87570acdfcbe104c) docs(core/libcudart): update documentation for `libcudart` - [`945f2c6`](https://github.com/XuehaiPan/nvitop/commit/945f2c6b1752e11cdb7dde3e65971401499fc0d6) feat(core/device): add method `cuda_compute_capability` ### 📊 Changes **9 files changed** (+940 additions, -98 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+94 -89) ➕ `docs/source/core/libcudart.rst` (+8 -0) 📝 `docs/source/index.rst` (+1 -0) 📝 `docs/source/spelling_wordlist.txt` (+1 -0) 📝 `nvitop/__init__.py` (+1 -1) 📝 `nvitop/core/__init__.py` (+2 -1) 📝 `nvitop/core/device.py` (+48 -4) 📝 `nvitop/core/libcuda.py` (+64 -3) ➕ `nvitop/core/libcudart.py` (+721 -0) </details> ### 📄 Description #### Issue Type <!-- Pick relevant types and delete the rest --> - Improvement/feature implementation #### Runtime Environment <!-- Details of your runtime environment --> - Operating system and version: Ubuntu 20.04 LTS - Terminal emulator and version: GNOME Terminal 3.36.2 - Python version: `3.11.1` - NVML version (driver version): `525.60.11` - `nvitop` version or commit: `0.11.0` - `python-ml-py` version: `11.515.75` - Locale: `en_US.UTF-8` #### Description <!-- Describe the changes in detail --> Add Python bindings for CUDA Runtime APIs (`cudart`) and add method `cuda_runtime_version()`. #### Motivation and Context <!-- Why are these changes required? --> <!-- What problems do these changes solve? --> <!-- Link to relevant issues --> Support to detect the CUDA runtime version. ```python In [1]: from nvitop import * In [2]: Device.driver_version() Out[2]: '525.60.11' In [3]: Device.cuda_driver_version() Out[3]: '12.0' In [4]: Device.max_cuda_version() Out[4]: '12.0' In [5]: Device.cuda_runtime_version() Out[5]: '11.8' ``` ```console $ LD_LIBRARY_PATH="/usr/local/cuda-10.2/lib64:${LD_LIBRARY_PATH}" python3 -c 'from nvitop import Device; print(Device.cuda_runtime_version())' 10.2 $ LD_LIBRARY_PATH="/usr/local/cuda-11.1/lib64:${LD_LIBRARY_PATH}" python3 -c 'from nvitop import Device; print(Device.cuda_runtime_version())' 11.1 $ LD_LIBRARY_PATH="/usr/local/cuda-11.3/lib64:${LD_LIBRARY_PATH}" python3 -c 'from nvitop import Device; print(Device.cuda_runtime_version())' 11.3 ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 03:26:34 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/nvitop#137
No description provided.