Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

103 lines
1.8 KiB
Plaintext

# RDC REST API
## Overview
This REST API provides functionalities to:
- Discover available GPUs on a node.
- Configure and manage GPU monitoring queries.
- Retrieve GPU metrics based on configured queries.
The API is built using Flask and interacts with the RDC library to monitor GPU usage and performance metrics.
## Installation
### Prerequisites
- Python 3.x
- Flask
- RDC Library (`librdc_bootstrap.so` must be available and accessible)
### Install Dependencies
```sh
pip install flask
```
## Running the API
1. Ensure `librdc_bootstrap.so` is in the library path:
```sh
export LD_LIBRARY_PATH=/path/to/librdc_bootstrap.so:$LD_LIBRARY_PATH
```
2. Run the API:
```sh
python rdc_rest_api.py
```
The API will start and listen on `http://0.0.0.0:50052`.
## API Endpoints
### 1. Discover GPUs
**GET** `/rdc/discovery`
#### Response:
```json
{
"0": "GPU Name",
"1": "GPU Name"
}
```
### 2. Create Query Criteria
**POST** `/rdc/query_criteria`
#### Request Body:
```json
{
"gpu_index": [0,1],
"metrics": ["RDC_FI_GPU_CLOCK", "RDC_FI_GPU_TEMP"]
}
```
#### Response:
```json
{
"query_id": "G-1-F-2"
}
```
### 3. Get Query Criteria
**GET** `/rdc/query_criteria/<query_id>`
#### Response:
```json
{
"gpu_index": [0,1],
"metrics": ["RDC_FI_GPU_CLOCK", "RDC_FI_GPU_TEMP"],
"query_id": "G-1-F-2"
}
```
### 4. Delete Query Criteria
**DELETE** `/rdc/query_criteria/<query_id>`
#### Response:
```json
{
"message": "Deleted successfully"
}
```
### 5. Retrieve GPU Metrics
**GET** `/rdc/gpu_metrics/<query_id>`
#### Response:
```json
[
{
"gpu_index": 0,
"RDC_FI_GPU_CLOCK": 1450,
"RDC_FI_GPU_TEMP": 32
},
{
"gpu_index": 1,
"RDC_FI_GPU_CLOCK": 736,
"RDC_FI_GPU_TEMP": 35
}
]
```
## Notes
- Ensure `librdc_bootstrap.so` is properly linked.
- The API should be run on a system with RDC installed and GPUs accessible.