Detailed explanation of NVIDIA-SMI series commands (6) - device modification options (1)

DEVICE MODIFICATION OPTIONS

This article is a detailed explanation of the NVIDIA-SMI series commands. The sixth - device modification options (1), introduces and demonstrates the nvidia-smi device modification option parameters -pm (persistent mode on/off), -e (ECC on/off), - p (reset ECC error count).

The command to modify the GPU device, the list of supported parameters is as follows:

    -pm,  --persistence-mode=   设置持久性模式: 0/DISABLED, 1/ENABLED
    -e,   --ecc-config=         切换 ECC 支持: 0/DISABLED, 1/ENABLED
    -p,   --reset-ecc-errors=   重置 ECC 错误计数: 0/VOLATILE, 1/AGGREGATE
    -c,   --compute-mode=       为计算应用程序设置模式:
                                0/DEFAULT, 1/EXCLUSIVE_PROCESS,
                                2/PROHIBITED
          --gom=                设置 GPU 操作模式:
                                0/ALL_ON, 1/COMPUTE, 2/LOW_DP
    -r    --gpu-reset           触发 GPU 的重置。
                                可用于在需要重启机器的情况下重置 GPU 硬件状态。
                                如果发生双位 ECC 错误,通常很有用。
                                重置操作不能保证在所有情况下都有效,应谨慎使用。
    -vm   --virt-mode=          切换 GPU 虚拟化模式:
                                将 GPU 虚拟化模式设置为 3/VGPU 或 4/VSGA。
                                GPU 的虚拟化模式只能在它运行在管理程序上时设置。
    -lgc  --lock-gpu-clocks=    将指定的一对 <minGpuClock,maxGpuClock> 时钟
                                频率取值范围(例如 1500,1500),设置为需锁定
                                的 GPU 时钟频率的范围(以 MHz 为单位)。 
                                无论 GPU 上是否存在正在运行的应用程序,设置此项
                                将取代applications-clocks并生效。
                                输入也可以是一个单一的期望时钟值
                                (例如 <GpuClockValue>)。
    -rgc  --reset-gpu-clocks    重置 GPU 时钟频率到默认值。
    -lmc  --lock-memory-clocks=     将指定的一对 <minMemClock,maxMemClock> 时钟
                                    频率取值范围(例如 5100,5100) ,设置为需锁定
                                    的 GPU 内存时钟频率的范围(以 MHz 为单位)。
                                    输入也可以是一个单一的期望时钟值
                                    (例如<MemClockValue>).
    -rmc  --reset-memory-clocks    重置 GPU 内存时钟频率到默认值。
    -ac   --applications-clocks= 将指定的一对 <memory,graphics> 时钟
                                    频率值(例如 2000,800) ,设置为 GPU 上
                                    运行的应用程序的memory和graphics时钟
                                    频率值(以 MHz 为单位)。
    -rac  --reset-applications-clocks     重置应用程序时钟到默认值。
    -pl   --power-limit=        以瓦特为单位指定最大电源管理限制。
    -cc   --cuda-clocks=        覆盖或恢复默认 CUDA 时钟频率。
                                在覆盖模式下,GPU 在运行 CUDA 应用程序时
                                时钟频率更高。 仅适用于从 Volta 系列开始的
                                受支持设备。 需要管理员权限。
                                0/RESTORE_DEFAULT, 1/OVERRIDE
    -am   --accounting-mode=    启用或禁用记帐模式: 0/DISABLED, 1/ENABLED
    -caa  --clear-accounted-apps    清除缓冲区中所有已记账的进程pid信息。
          --auto-boost-default= 将默认自动增强策略设置为 0/DISABLED 
                                或 1/ENABLED,仅在最后一个提升客户端
                                退出后强制执行更改。
          --auto-boost-permission=  允许非管理员/root 对自动增强模式进行控制:
                                0/UNRESTRICTED, 1/RESTRICTED
    -mig  --multi-instance-gpu= 启用或禁用多实例 GPU: 0/DISABLED, 1/ENABLED
                                需要 root 权限.
    -gtt  --gpu-target-temp=    以摄氏度为单位设置 GPU 的 GPU 目标温度。
                                需要管理员权限

-pm set persistent mode

Sets the persistence mode of the target GPU.

Sustained mode is energy-intensive, but takes less time when new GPU applications are launched. When persistence mode is enabled, the NVIDIA driver remains loaded even when no active client (eg X11 or nvidia-smi) is present. This minimizes driver loading delays associated with running related applications such as CUDA programs. Linux only. See the (GPU Properties) section for a description of persistence modes.

Notice:

Root privileges are required.

Affects all GPUs unless a single GPU is specified with the -i parameter.

The effect of this action is immediate.

But it doesn't persist across host reboots.

Persistence mode will default to "disabled" after each host reboot.

Only available on Linux.

Value range: 0/DISABLED, 1/ENABLED

Run the example:

Example of running in open mode:

nvidia-smi -pm 1

image

Example of running off mode:

nvidia-smi -pm 0

image

-e Enable or disable ECC error checking and correction techniques

Set the ECC mode for the target GPU.

NVIDIA GPU 可以为各种类型的 ECC 错误提供错误计数。一些 ECC 错误是单位或双位错误,其中单位错误已得到纠正,而双位错误则无法纠正。纹理内存错误可以通过重新发送来纠正,或者如果重新发送失败则无法纠正。这些错误在两个时间尺度(易失性和聚合)中可用。单比特 ECC 错误由硬件自动纠正,不会导致数据损坏。检测到双位错误但未更正。有关发生双位错误时计算应用程序行为的信息,请参阅 Web 上的 ECC 文档。易失性错误计数器跟踪自上次驱动程序加载以来检测到的错误数。聚合错误计数无限期地持续存在,因此充当整个生命周期计数器。有关ECC的描述,请参阅(GPU 属性)部分。。

注意:

需要root权限。

除非使用 -i 参数指定单个 GPU,否则将影响所有 GPU。

此设置在下次重启后生效,并且是persistent.only。

取值范围:0/DISABLED, 1/ENABLED

运行示例:

开启ECC运行示例:

nvidia-smi -e 1

image

上图中执行开启指令之后,提示需要重启才能生效。Volatile Uncorr. ECC 对应的位置的off*说明此设置项已更改,需要重启才能生效。

输入reboot重启主机之后,再执行nvidia-smi查询:

image

可以看到Volatile Uncorr. ECC 对应的位置的0,说明ECC已开启,且当前检测到0个ECC错误。如果想查询ECC相关的详尽信息,可以用NVIDIA-SMI系列命令详解(4)-选择性查询选项(1) 中介绍的选择性查询命令查询详解数据,各参数含义参见第四章,命令示例如下:

nvidia-smi --format=csv,noheader --query-gpu=ecc.errors.corrected.volatile.device_memory,ecc.errors.corrected.volatile.dram,ecc.errors.corrected.volatile.register_file,ecc.errors.corrected.volatile.l1_cache,ecc.errors.corrected.volatile.l2_cache,ecc.errors.corrected.volatile.texture_memory,ecc.errors.corrected.volatile.cbu,ecc.errors.corrected.volatile.sram,ecc.errors.corrected.volatile.total,ecc.errors.corrected.aggregate.device_memory,ecc.errors.corrected.aggregate.dram,ecc.errors.corrected.aggregate.register_file,ecc.errors.corrected.aggregate.l1_cache,ecc.errors.corrected.aggregate.l2_cache,ecc.errors.corrected.aggregate.texture_memory,ecc.errors.corrected.aggregate.cbu,ecc.errors.corrected.aggregate.sram,ecc.errors.corrected.aggregate.total,ecc.errors.uncorrected.volatile.device_memory,ecc.errors.uncorrected.volatile.dram,ecc.errors.uncorrected.volatile.register_file,ecc.errors.uncorrected.volatile.l1_cache,ecc.errors.uncorrected.volatile.l2_cache,ecc.errors.uncorrected.volatile.texture_memory,ecc.errors.uncorrected.volatile.cbu,ecc.errors.uncorrected.volatile.sram,ecc.errors.uncorrected.volatile.total,ecc.errors.uncorrected.aggregate.device_memory,ecc.errors.uncorrected.aggregate.dram,ecc.errors.uncorrected.aggregate.register_file,ecc.errors.uncorrected.aggregate.l1_cache,ecc.errors.uncorrected.aggregate.l2_cache,ecc.errors.uncorrected.aggregate.texture_memory,ecc.errors.uncorrected.aggregate.cbu,ecc.errors.uncorrected.aggregate.sram,ecc.errors.uncorrected.aggregate.total

image

关闭ECC运行示例:

nvidia-smi -e 0

image

-p 重置 ECC 错误计数器为0

重置目标 GPU 的 ECC 错误计数器。

NVIDIA GPU 可以为各种类型的 ECC 错误提供错误计数。一些 ECC 错误是单位或双位错误,其中单位错误已得到纠正,而双位错误则无法纠正。纹理内存错误可以通过重新发送来纠正,或者如果重新发送失败则无法纠正。这些错误在两个时间尺度(易失性VOLATILE和聚合AGGREGATE)中可用。单比特 ECC 错误由硬件自动纠正,不会导致数据损坏。检测到双位错误但未更正。有关发生双位错误时计算应用程序行为的信息,请参阅 Web 上的 ECC 文档。易失性错误计数器跟踪自上次驱动程序加载以来检测到的错误数。聚合错误计数无限期地持续存在,因此充当整个生命周期计数器。 有关 ECC 错误计数器类型的说明,请参阅(GPU 属性)部分。

注意:

需要root权限。

除非使用 -i 参数指定单个 GPU,否则将影响所有 GPU。

此操作的效果是立竿见影的。

取值范围:0|VOLATILE , 1|AGGREGATE

运行示例:

重置 AGGREGATE 聚合 ECC 计数为 0 运行示例:

nvidia-smi -p 1

可以使用 NVIDIA-SMI 系列命令详解(4)-选择性查询选项(1) 中介绍的选择性查询命令查询的 AGGREGATE 聚合 ECC计数数据,各参数含义参见第四章,查询聚合 ECC 计数数据的命令示例如下:

nvidia-smi --format=csv,noheader --query-gpu=ecc.errors.corrected.aggregate.device_memory,ecc.errors.corrected.aggregate.dram,ecc.errors.corrected.aggregate.register_file,ecc.errors.corrected.aggregate.l1_cache,ecc.errors.corrected.aggregate.l2_cache,ecc.errors.corrected.aggregate.texture_memory,ecc.errors.corrected.aggregate.cbu,ecc.errors.corrected.aggregate.sram,ecc.errors.corrected.aggregate.total,,ecc.errors.uncorrected.aggregate.device_memory,ecc.errors.uncorrected.aggregate.dram,ecc.errors.uncorrected.aggregate.register_file,ecc.errors.uncorrected.aggregate.l1_cache,ecc.errors.uncorrected.aggregate.l2_cache,ecc.errors.uncorrected.aggregate.texture_memory,ecc.errors.uncorrected.aggregate.cbu,ecc.errors.uncorrected.aggregate.sram,ecc.errors.uncorrected.aggregate.total

image.png

重置 VOLATILE 易失性 ECC 计数为 0 运行示例:

nvidia-smi -p 0

可以使用 NVIDIA-SMI 系列命令详解(4)-选择性查询选项(1) 中介绍的选择性查询命令查询的 VOLATILE 易失性 ECC计数数据,各参数含义参见第四章,查询易失性 ECC 计数数据的命令示例如下:

nvidia-smi --format=csv,noheader --query-gpu=ecc.errors.corrected.volatile.device_memory,ecc.errors.corrected.volatile.dram,ecc.errors.corrected.volatile.register_file,ecc.errors.corrected.volatile.l1_cache,ecc.errors.corrected.volatile.l2_cache,ecc.errors.corrected.volatile.texture_memory,ecc.errors.corrected.volatile.cbu,ecc.errors.corrected.volatile.sram,ecc.errors.corrected.volatile.total,ecc.errors.uncorrected.volatile.device_memory,ecc.errors.uncorrected.volatile.dram,ecc.errors.uncorrected.volatile.register_file,ecc.errors.uncorrected.volatile.l1_cache,ecc.errors.uncorrected.volatile.l2_cache,ecc.errors.uncorrected.volatile.texture_memory,ecc.errors.uncorrected.volatile.cbu,ecc.errors.uncorrected.volatile.sram,ecc.errors.uncorrected.volatile.total

image

附加选项

-i 显示单个指定GPU的数据

-i, --id=ID

显示单个指定 GPU 的数据。指定的 id 可能是驱动程序返回的自然枚举中 GPU 的从 0 开始的索引、GPU 的板序列号、GPU 的 UUID 或 GPU 的 PCI 总线 ID(如 domain:bus:device.function in hex)。建议需要一致性的用户使用 UUID 或 PCI 总线 ID,因为设备枚举顺序不能保证在重新启动之间保持一致,并且板序列号可能在同一板上的多个 GPU 之间共享。

Guess you like

Origin juejin.im/post/7120480686837858334