Skip to content

Latest commit

 

History

History
 
 

llm-performance

llm 框架对比

nvidia-ml-py3、pynvml

pip install nvidia-ml-py psutil
from pynvml import *

def print_gpu_utilization():
    nvmlInit()
    handle = nvmlDeviceGetHandleByIndex(0)
    info = nvmlDeviceGetMemoryInfo(handle)
    print(f"GPU memory occupied: {info.used//1024**2} MB.")