nvidia显卡Tesla查看GPU使用情况

使用命令nvidia-smi可以查看nvidia显卡Tesla查看GPU使用情况。

例如:

[root@localhost ~]# nvidia-smi -a

==============NVSMI LOG==============

Timestamp                           : Sat May 10 13:19:20 2014
Driver Version                      : 331.67

Attached GPUs                       : 2
GPU 0000:03:00.0
    Product Name                    : Tesla K10.G1.8GB
    Display Mode                    : Disabled
    Display Active                  : Disabled
    Persistence Mode                : Disabled
    Accounting Mode                 : Disabled
    Accounting Mode Buffer Size     : 128
    Driver Model
        Current                     : N/A
        Pending                     : N/A
    Serial Number                   : 0325112060091
    GPU UUID                        : GPU-ce2c3f63-68b1-fba8-c5c2-83ebda82bc88
    Minor Number                    : 0
    VBIOS Version                   : 80.04.59.00.1B
    Inforom Version
        Image Version               : 2055.0200.01.04
        OEM Object                  : 1.1
        ECC Object                  : 2.0
        Power Management Object     : N/A
    GPU Operation Mode
        Current                     : N/A
        Pending                     : N/A
    PCI
        Bus                         : 0x03
        Device                      : 0x00
        Domain                      : 0x0000
        Device Id                   : 0x118F10DE
        Bus Id                      : 0000:03:00.0
        Sub System Id               : 0x097010DE
        GPU Link Info
            PCIe Generation
                Max                 : 3
                Current             : 3
            Link Width
                Max                 : 16x
                Current             : 16x
        Bridge Chip
            Type                    : PLX
            Firmware                : 0xF0470F00
    Fan Speed                       : N/A
    Performance State               : P0
    Clocks Throttle Reasons
        Idle                        : Not Active
        Applications Clocks Setting : Not Active
        SW Power Cap                : Not Active
        HW Slowdown                 : Not Active
        Unknown                     : Not Active
    FB Memory Usage
        Total                       : 3583 MiB
        Used                        : 9 MiB
        Free                        : 3574 MiB
    BAR1 Memory Usage
        Total                       : 256 MiB
        Used                        : 2 MiB
        Free                        : 254 MiB
    Compute Mode                    : Default
    Utilization
        Gpu                         : 0 %
        Memory                      : 0 %
    Ecc Mode
        Current                     : Enabled
        Pending                     : Enabled
    ECC Errors
        Volatile
            Single Bit            
                Device Memory       : 0
                Register File       : N/A
                L1 Cache            : N/A
                L2 Cache            : N/A
                Texture Memory      : N/A
                Total               : 0
            Double Bit            
                Device Memory       : 0
                Register File       : N/A
                L1 Cache            : N/A
                L2 Cache            : N/A
                Texture Memory      : N/A
                Total               : 0
        Aggregate
            Single Bit            
                Device Memory       : 0
                Register File       : N/A
                L1 Cache            : N/A
                L2 Cache            : N/A
                Texture Memory      : N/A
                Total               : 0
            Double Bit            
                Device Memory       : 0
                Register File       : N/A
                L1 Cache            : N/A
                L2 Cache            : N/A
                Texture Memory      : N/A
                Total               : 0
    Retired Pages
        Single Bit ECC              : N/A
        Double Bit ECC              : N/A
        Pending                     : N/A
    Temperature
        Gpu                         : 39 C
    Power Readings
        Power Management            : Supported
        Power Draw                  : 42.29 W
        Power Limit                 : 117.50 W
        Default Power Limit         : 117.50 W
        Enforced Power Limit        : 117.50 W
        Min Power Limit             : 85.00 W
        Max Power Limit             : 125.00 W
    Clocks
        Graphics                    : 745 MHz
        SM                          : 745 MHz
        Memory                      : 2500 MHz
    Applications Clocks
        Graphics                    : 745 MHz
        Memory                      : 2500 MHz
    Default Applications Clocks
        Graphics                    : 745 MHz
        Memory                      : 2500 MHz
    Max Clocks
        Graphics                    : 745 MHz
        SM                          : 745 MHz
        Memory                      : 2500 MHz
    Compute Processes               : None

GPU 0000:04:00.0
    Product Name                    : Tesla K10.G1.8GB
    Display Mode                    : Disabled
    Display Active                  : Disabled
    Persistence Mode                : Disabled
    Accounting Mode                 : Disabled
    Accounting Mode Buffer Size     : 128
    Driver Model
        Current                     : N/A
        Pending                     : N/A
    Serial Number                   : 0325112060091
    GPU UUID                        : GPU-f90b88ef-c884-a61f-25dd-dbedb8529941
    Minor Number                    : 1
    VBIOS Version                   : 80.04.59.00.1C
    Inforom Version
        Image Version               : 2055.0200.01.04
        OEM Object                  : 1.1
        ECC Object                  : 2.0
        Power Management Object     : N/A
    GPU Operation Mode
        Current                     : N/A
        Pending                     : N/A
    PCI
        Bus                         : 0x04
        Device                      : 0x00
        Domain                      : 0x0000
        Device Id                   : 0x118F10DE
        Bus Id                      : 0000:04:00.0
        Sub System Id               : 0x097010DE
        GPU Link Info
            PCIe Generation
                Max                 : 3
                Current             : 3
            Link Width
                Max                 : 16x
                Current             : 16x
        Bridge Chip
            Type                    : PLX
            Firmware                : 0xF0470F00
    Fan Speed                       : N/A
    Performance State               : P0
    Clocks Throttle Reasons
        Idle                        : Not Active
        Applications Clocks Setting : Not Active
        SW Power Cap                : Not Active
        HW Slowdown                 : Not Active
        Unknown                     : Not Active
    FB Memory Usage
        Total                       : 3583 MiB
        Used                        : 9 MiB
        Free                        : 3574 MiB
    BAR1 Memory Usage
        Total                       : 256 MiB
        Used                        : 2 MiB
        Free                        : 254 MiB
    Compute Mode                    : Default
    Utilization
        Gpu                         : 0 %
        Memory                      : 0 %
    Ecc Mode
        Current                     : Enabled
        Pending                     : Enabled
    ECC Errors
        Volatile
            Single Bit            
                Device Memory       : 0
                Register File       : N/A
                L1 Cache            : N/A
                L2 Cache            : N/A
                Texture Memory      : N/A
                Total               : 0
            Double Bit            
                Device Memory       : 0
                Register File       : N/A
                L1 Cache            : N/A
                L2 Cache            : N/A
                Texture Memory      : N/A
                Total               : 0
        Aggregate
            Single Bit            
                Device Memory       : 0
                Register File       : N/A
                L1 Cache            : N/A
                L2 Cache            : N/A
                Texture Memory      : N/A
                Total               : 0
            Double Bit            
                Device Memory       : 0
                Register File       : N/A
                L1 Cache            : N/A
                L2 Cache            : N/A
                Texture Memory      : N/A
                Total               : 0
    Retired Pages
        Single Bit ECC              : N/A
        Double Bit ECC              : N/A
        Pending                     : N/A
    Temperature
        Gpu                         : 32 C
    Power Readings
        Power Management            : Supported
        Power Draw                  : 34.86 W
        Power Limit                 : 117.50 W
        Default Power Limit         : 117.50 W
        Enforced Power Limit        : 117.50 W
        Min Power Limit             : 85.00 W
        Max Power Limit             : 125.00 W
    Clocks
        Graphics                    : 745 MHz
        SM                          : 745 MHz
        Memory                      : 2500 MHz
    Applications Clocks
        Graphics                    : 745 MHz
        Memory                      : 2500 MHz
    Default Applications Clocks
        Graphics                    : 745 MHz
        Memory                      : 2500 MHz
    Max Clocks
        Graphics                    : 745 MHz
        SM                          : 745 MHz
        Memory                      : 2500 MHz
    Compute Processes               : None



转载于:https://my.oschina.net/zhangxu0512/blog/262932

### nvidia-smi 显示 GPU 利用率为 0 的原因及解决方案 当 `nvidia-smi` 命令显示 GPU 利用率为 0 或者无法正常通信时,这可能是由多种因素引起的。以下是可能的原因及其对应的解决方案: #### 可能原因一:NVIDIA 驱动未正确安装或运行 如果遇到错误提示:“NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and run.” 这表明当前系统中的 NVIDIA 驱动程序未能成功启动或者版本过低[^1]。 **解决方案** - 更新至最新的官方稳定版 NVIDIA 驱动; - 卸载现有驱动并重新安装新版本; - 检查 BIOS 设置确保启用了集成/独立显卡选项; - 对于云服务提供商提供的虚拟机实例,考虑选用带有预装 GRID 驱动的镜像来简化配置过程[^3]; #### 可能原因二:持久化模式设置不当影响统计准确性 某些情况下,默认开启的持久化模式可能会干扰到实际性能监控数据采集工作,在 K80 和 Tesla M40 上尤为明显[^4]。 **解决方案** 可以通过执行以下命令关闭持久化线程: ```bash sudo nvidia-persistenced --exit-on-detach ``` #### 可能原因三:应用程序本身并未充分利用GPU资源 即使硬件层面一切正常,但如果正在运行的应用并没有有效利用起 GPU 资源,则自然会看到较低甚至为零的占用情况。 **确认方法** 可以尝试通过编写简单的 CUDA 测试代码验证是否能够触发更高的负载水平: ```cpp #include <cuda_runtime.h> int main(){ float *d_A; cudaMalloc(&d_A, sizeof(float)*1e7); cudaMemcpy(d_A, NULL, sizeof(float)*1e7,cudaMemcpyHostToDevice ); cudaFree(d_A); } ``` 编译并运行上述 C++ 程序后再次观察 `nvidia-smi` 输出的变化趋势。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值