Package: nvidiacheck
Monitors NVIDIA GPU information and log the data into a pandas DataFrame - Windows only.pip install nvidiacheckTested against Windows 10 / Python 3.10 / AnacondaParameters:savepath(str,optional):ThefilepathtosavethelogdataasaCSVfile.Ifprovided,thedatawillbesaveduponKeyboardInterrupt.sleeptime(int,optional):Thetimeinterval(inseconds)betweeneachdatalogging.Returns:pandas.DataFrame:ADataFramecontainingtheloggedNVIDIAGPUinformationwiththefollowingcolumns:-index:GPUindex.-name:GPUname.-memory.total[MiB]:TotalGPUmemoryinMiB(Mebibytes).-memory.used[MiB]:UsedGPUmemoryinMiB(Mebibytes).-memory.free[MiB]:FreeGPUmemoryinMiB(Mebibytes).-temperature.gpu:GPUtemperatureinCelsius.-pstate:GPUperformancestate.-utilization.gpu[%]:GPUutilizationpercentage.-utilization.memory[%]:Memoryutilizationpercentage.-timestamp:Timestampintheformat"YYYY_MM_DD_HH_MM_SS".Description:ThisfunctionusestheNVIDIASystemManagementInterface(nvidia-smi)toqueryGPUinformation,includingmemoryusage,temperature,performancestate,andutilization.Thedataiscollectedinreal-timeandloggedintoapandasDataFrame.TheloggingcontinuesindefinitelyuntilaKeyboardInterrupt(usuallytriggeredbypressingCtrl+C).Ifthe'savepath'parameterisprovided,thecollectedGPUinformationwillbesavedtoaCSVfilewhenthemonitoringisinterruptedbytheuser(KeyboardInterrupt).Note:ThisfunctionisintendedforsystemswithNVIDIAGPUsonWindowsandrequiresthenvidia-smi.exeexecutabletobeavailableinthesystempath.Example:fromnvidiacheckimportnvidia_log# Start monitoring NVIDIA GPU and display the real-time lognvidia_log()# Start monitoring NVIDIA GPU and save the log data to a CSV filenvidia_log(savepath="gpu_log.csv")# Start monitoring NVIDIA GPU with a custom time interval between logs (e.g., 2 seconds)nvidia_log(sleeptime=2)indexnamememory.total[MiB]memory.used[MiB]memory.free[MiB]temperature.gpupstateutilization.gpu[%]utilization.memory[%]timestamp00NVIDIAGeForceRTX2060SUPER8192MiB1321MiB6697MiB45P816%5%2023_07_18_11_52_55indexnamememory.total[MiB]memory.used[MiB]memory.free[MiB]temperature.gpupstateutilization.gpu[%]utilization.memory[%]timestamp10NVIDIAGeForceRTX2060SUPER8192MiB1321MiB6697MiB44P817%6%2023_07_18_11_52_56indexnamememory.total[MiB]memory.used[MiB]memory.free[MiB]temperature.gpupstateutilization.gpu[%]utilization.memory[%]timestamp20NVIDIAGeForceRTX2060SUPER8192MiB1321MiB6697MiB44P82%4%2023_07_18_11_52_57indexnamememory.total[MiB]memory.used[MiB]memory.free[MiB]temperature.gpupstateutilization.gpu[%]utilization.memory[%]timestamp30NVIDIAGeForceRTX2060SUPER8192MiB1321MiB6697MiB44P84%5%2023_07_18_11_52_58indexnamememory.total[MiB]memory.used[MiB]memory.free[MiB]temperature.gpupstateutilization.gpu[%]utilization.memory[%]timestamp40NVIDIAGeForceRTX2060SUPER8192MiB1321MiB6697MiB46P222%1%2023_07_18_11_52_59indexnamememory.total[MiB]memory.used[MiB]memory.free[MiB]temperature.gpupstateutilization.gpu[%]utilization.memory[%]timestamp50NVIDIAGeForceRTX2060SUPER8192MiB1320MiB6698MiB45P80%0%2023_07_18_11_53_00indexnamememory.total[MiB]memory.used[MiB]memory.free[MiB]temperature.gpupstateutilization.gpu[%]utilization.memory[%]timestamp60NVIDIAGeForceRTX2060SUPER8192MiB1320MiB6698MiB45P82%4%2023_07_18_11_53_01indexnamememory.total[MiB]memory.used[MiB]memory.free[MiB]temperature.gpupstateutilization.gpu[%]utilization.memory[%]timestamp70NVIDIAGeForceRTX2060SUPER8192MiB1320MiB6698MiB44P812%5%2023_07_18_11_53_02indexnamememory.total[MiB]memory.used[MiB]memory.free[MiB]temperature.gpupstateutilization.gpu[%]utilization.memory[%]timestamp80NVIDIAGeForceRTX2060SUPER8192MiB1320MiB6698MiB44P83%4%2023_07_18_11_53_03