pytorch 查看GPU信息

阅读: 评论:0

pytorch 查看GPU信息

pytorch 查看GPU信息

参考:

  1. torch.cuda用法
  2. 服务器GPU状态查询

1.先激活虚拟环境

conda activate yolov7_wxf

2.进入该环境中

$ python
Python 3.8.0 (default, Nov  6 2019, 21:49:08) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> print(torch.__version__)
1.8.1
// 查看GPU 能否使用
>>> torch.cuda.is_available()
True
// 查看显卡的数量
>>> print(torch.cuda.device_count())
2
// 查看显卡的系列
>>> print(_device_name(0))
Tesla T4
>>> print(torch.cuda.current_device())
0
# 查看GPU的容量
>>> _device_capability(device=0)
(7, 5)
// 查看当前cuda流
>>> torch.cuda.current_stream(device=0)
<torch.cuda.Stream device=cuda:0 cuda_stream=0x0>
// 查看显卡的属性
>>> print(_device_properties(0))
_CudaDeviceProperties(name='Tesla T4', major=7, minor=5, total_memory=15109MB, multi_processor_count=40)
>>> num = torch.cuda.device_count()
>>> infos = [_device_properties(i) for i in range(num)]
>>> print(infos)
[_CudaDeviceProperties(name='Tesla T4', major=7, minor=5, total_memory=15109MB, multi_processor_count=40), 
_CudaDeviceProperties(name='Tesla T4', major=7, minor=5, total_memory=15109MB, multi_processor_count=40)]
  1. nvidia-smi -i 0 -q 查看显卡所有信息
    -i 后面是显卡索引
nvidia-smi -i 0 -q==============NVSMI LOG==============Timestamp                                 : Mon Aug 15 08:57:45 2022
Driver Version                            : 470.141.03
CUDA Version                              : 11.4Attached GPUs                             : 2
GPU 00000000:03:00.0Product Name                          : Tesla T4Product Brand                         : NVIDIADisplay Mode                          : EnabledDisplay Active                        : DisabledPersistence Mode                      : DisabledMIG ModeCurrent                           : N/APending                           : N/AAccounting Mode                       : DisabledAccounting Mode Buffer Size           : 4000Driver ModelCurrent                           : N/APending                           : N/ASerial Number                         : 1325021113102GPU UUID                              : GPU-e7b126ca-6e16-3cd4-a183-57fdaf803c4cMinor Number                          : 0VBIOS Version                         : 90.04.96.00.9FMultiGPU Board                        : NoBoard ID                              : 0x300GPU Part Number                       : 900-2G183-0000-000Module ID                             : 0Inforom VersionImage Version                     : G183.0200.00.02OEM Object                        : 1.1ECC Object                        : 5.0Power Management Object           : N/AGPU Operation ModeCurrent                           : N/APending                           : N/AGSP Firmware Version                  : N/AGPU Virtualization ModeVirtualization Mode               : NoneHost VGPU Mode                    : N/AIBMNPURelaxed Ordering Mode             : N/APCIBus                               : 0x03Device                            : 0x00Domain                            : 0x0000Device Id                         : 0x1EB810DEBus Id                            : 00000000:03:00.0Sub System Id                     : 0x12A210DEGPU Link InfoPCIe GenerationMax                       : 3Current                   : 3Link WidthMax                       : 16xCurrent                   : 8xBridge ChipType                          : N/AFirmware                      : N/AReplays Since Reset               : 0Replay Number Rollovers           : 0Tx Throughput                     : 320000 KB/sRx Throughput                     : 2462000 KB/sFan Speed                             : N/APerformance State                     : P0Clocks Throttle ReasonsIdle                              : Not ActiveApplications Clocks Setting       : Not ActiveSW Power Cap                      : Not ActiveHW Slowdown                       : Not ActiveHW Thermal Slowdown           : Not ActiveHW Power Brake Slowdown       : Not ActiveSync Boost                        : Not ActiveSW Thermal Slowdown               : ActiveDisplay Clock Setting             : Not ActiveFB Memory UsageTotal                             : 15109 MiBUsed                              : 11797 MiBFree                              : 3312 MiBBAR1 Memory UsageTotal                             : 256 MiBUsed                              : 5 MiBFree                              : 251 MiBCompute Mode                          : DefaultUtilizationGpu                               : 99 %Memory                            : 22 %Encoder                           : 0 %Decoder                           : 0 %Encoder StatsActive Sessions                   : 0Average FPS                       : 0Average Latency                   : 0FBC StatsActive Sessions                   : 0Average FPS                       : 0Average Latency                   : 0Ecc ModeCurrent                           : EnabledPending                           : EnabledECC ErrorsVolatileSRAM Correctable              : 0SRAM Uncorrectable            : 0DRAM Correctable              : 0DRAM Uncorrectable            : 0AggregateSRAM Correctable              : 0SRAM Uncorrectable            : 0DRAM Correctable              : 0DRAM Uncorrectable            : 0Retired PagesSingle Bit ECC                    : 0Double Bit ECC                    : 0Pending Page Blacklist            : NoRemapped Rows                         : N/ATemperatureGPU Current Temp                  : 86 CGPU Shutdown Temp                 : 96 CGPU Slowdown Temp                 : 93 CGPU Max Operating Temp            : 85 CGPU Target Temperature            : N/AMemory Current Temp               : N/AMemory Max Operating Temp         : N/APower ReadingsPower Management                  : SupportedPower Draw                        : 52.15 WPower Limit                       : 70.00 WDefault Power Limit               : 70.00 WEnforced Power Limit              : 70.00 WMin Power Limit                   : 60.00 WMax Power Limit                   : 70.00 WClocksGraphics                          : 300 MHzSM                                : 300 MHzMemory                            : 5000 MHzVideo                             : 540 MHzApplications ClocksGraphics                          : 585 MHzMemory                            : 5001 MHzDefault Applications ClocksGraphics                          : 585 MHzMemory                            : 5001 MHzMax ClocksGraphics                          : 1590 MHzSM                                : 1590 MHzMemory                            : 5001 MHzVideo                             : 1470 MHzMax Customer Boost ClocksGraphics                          : 1590 MHzClock PolicyAuto Boost                        : N/AAuto Boost Default                : N/AVoltageGraphics                          : N/AProcessesGPU instance ID                   : N/ACompute instance ID               : N/AProcess ID                        : 1241Type                          : GName                          : /usr/lib/xorg/XorgUsed GPU Memory               : 4 MiBGPU instance ID                   : N/ACompute instance ID               : N/AProcess ID                        : 1932Type                          : GName                          : /usr/lib/xorg/XorgUsed GPU Memory               : 4 MiBGPU instance ID                   : N/ACompute instance ID               : N/AProcess ID                        : 26683Type                          : CName                          : /home/ls/anaconda3/envs/yolov7_wxf/bin/pythonUsed GPU Memory               : 11783 MiB

本文发布于:2024-02-08 13:43:15,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170737105967626.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:信息   pytorch   GPU
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23