can not import nvidia_smi
Asked Answered
T

1

5

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?

Templet answered 14/5, 2022 at 7:4 Comment(0)
T
11

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

and:

import nvidia_smi

nvidia_smi.nvmlInit()
handle = nvidia_smi.nvmlDeviceGetHandleByIndex(0)
Templet answered 14/5, 2022 at 7:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.