Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nvidia-smi function #12

Merged
merged 1 commit into from
Jan 22, 2025
Merged

Add nvidia-smi function #12

merged 1 commit into from
Jan 22, 2025

Conversation

welteki
Copy link
Member

@welteki welteki commented Jan 22, 2025

Description

Add nvidi-smi function to the store.

Invoking the function returns the NVIDIA System Management Interface (nvidia-smi) info.

How has this been tested

Ran the function locally using docker with the nvidia container runtime.

 docker run --rm -it -p 8080:8080 \
  --runtime=nvidia \
  --gpus all \
  ghcr.io/openfaas/nvidia-smi:latest 
curl -i 127.0.0.1:8080
HTTP/1.1 200 OK
X-Duration-Seconds: 0.044398
Date: Wed, 22 Jan 2025 15:44:22 GMT
Content-Length: 1778
Content-Type: text/plain; charset=utf-8

Wed Jan 22 15:44:22 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 565.57.01              Driver Version: 565.57.01      CUDA Version: 12.7     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce GT 1030         On  |   00000000:01:00.0 Off |                  N/A |
| 35%   26C    P8             N/A /   19W |       2MiB /   2048MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |

@alexellis
Copy link
Member

I'd rather this were an nvidia-smi function, even if it is derived from ubuntu. It will be more discoverable and I don't see a need for an ubuntu base like the alpine one at this time. Can you change it please?

@welteki welteki changed the title Add ubuntu function Add nvidia-smi function Jan 22, 2025
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
Copy link
Member

@alexellis alexellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexellis alexellis merged commit 4ec071c into openfaas:master Jan 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants