Morpheous Data Generation #1075
-
Hello I have installed Morpheous using docker and it is running succesfully on my centos os system. but i am unable to generate the data set. How to generate the data set from nvidia-smi command as the data given in examples has 176 columns ? is there any way apart from NETQ agent to generate that data set. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Hi @shubh0155! Thanks for reaching out to us - just a few more details to help us dig in please:
|
Beta Was this translation helpful? Give feedback.
-
@shubh0155 and @ABHIPATEL98 Can you try the following script to generate a dataset from your local GPUs? It uses import time
import pandas as pd
from pynvml.smi import NVSMI_QUERY_GPU
from pynvml.smi import nvidia_smi
# Output name
output_file = "nvsmi.json"
# Interval
interval_ms = 1000
query_opts = NVSMI_QUERY_GPU.copy()
# Remove the timestamp and supported clocks from the query
del query_opts["timestamp"]
del query_opts["supported-clocks"]
nvsmi = nvidia_smi.getInstance()
with open(output_file, "w", encoding="UTF-8") as f:
while (True):
dq = nvsmi.DeviceQuery(list(query_opts.values()))
output_dicts = []
# Flatten the GPUs to allow for a new row per GPU
for gpu in dq["gpu"]:
single_gpu = dq.copy()
# overwrite the gpu list with a single gpu
single_gpu["gpu"] = gpu
output_dicts.append(single_gpu)
df = pd.json_normalize(output_dicts, record_prefix="nvidia_smi_log")
# Rename the id column to match the XML converted output from NetQ
df.rename(columns={"gpu.id": "gpu.@id", "count": "attached_gpus"}, inplace=True)
df.rename(columns=lambda x: "nvidia_smi_log" + "." + x, inplace=True)
# Add the current timestamp
df.insert(0, "timestamp", time.time())
df.to_json(f, orient="records", lines=True)
f.flush()
time.sleep(interval_ms / 1000.0) This will write a new entry to the output file once per second until you press Ctrl+C to exit. |
Beta Was this translation helpful? Give feedback.
-
Dear @mdemoret-nv Thank you for your valuable assistance and guidance with the script to generate a dataset from local GPUs. Your expertise and prompt response were truly appreciated. Your script worked perfectly, to give us an idea about the required data set and we have requested for the NETQ access to proceed ahead . Your contributions to the community are commendable, and I'm grateful for your support. |
Beta Was this translation helpful? Give feedback.
-
Dear @mdemoret-nv Thank you for your response. We have run the script you provided and it is working fine. However, most of the values are coming back as N/A. When we give the generated data from the script to the "abp_nvsmi_detection" model, it produces an error: "Inference Rate[Complete]: 0 inf [00:00, ? inf/s]". The error message indicates that the model is missing the "nvidia_smi_log.gpu.pci.tx_util" column. Since NetQ is not open source, we are unable to generate new sample data for the ABP nvsmi detection example. Is there any other alternative way to do this? |
Beta Was this translation helpful? Give feedback.
@shubh0155 and @ABHIPATEL98 Can you try the following script to generate a dataset from your local GPUs? It uses
nvidia-ml
which is the same library used bynvidia-smi
. You will need to installnvidia-ml-py3
andpandas
for this script to work.