can not import nvidia_smi

Viewed 895

I'm tending to collect my GPU status during my python code is running. I need to import nvidia_smi in my code to do this. but even by installing it by pip install nvidia_smi hit this error: No module named 'nvidia_smi'

Any Idea?

1 Answers

I found the answer here just pip install nvidia-ml-py3:

and:

import nvidia_smi

nvidia_smi.nvmlInit()
handle = nvidia_smi.nvmlDeviceGetHandleByIndex(0)
Related