---
title: （硬件配置方案一）配置GPU工作模式和CPU绑定
description: "使用硬件配置方案一时将GPU卡工作模式设置为高性能模式，使GPU运行在最高频率，保持GPU性能处于最优状态。该操作每次系统重启都需重新配置一次。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/2530/armnative/kunpengcpsvideo_20_0056.html
sourcePath: /source/zh/kunpengboostkithistory/2530/armnative/kunpengcpsvideo_20_0056.html
indexId: 9cf1ac078e8dab13cfd0b104fb18b80c87e5075932092c2236bd9a7418840c6177
---
# （硬件配置方案一）配置GPU工作模式和CPU绑定

使用硬件配置方案一时将GPU卡工作模式设置为高性能模式，使GPU运行在最高频率，保持GPU性能处于最优状态。该操作每次系统重启都需重新配置一次。

执行如下命令设置GPU卡工作模式为高性能模式。```
find /sys -name power_dpm_force_performance_level | xargs -I {} sh -c "echo high > '{}'"
```


为了保证CPU资源稳定，需要将GPU驱动进程绑定到空闲核，绑定步骤如下：

1. 查询GPU进程号。
  1 ps -ef |grep gfx

  回显信息如下： 1 2 root 1703 2 1 Aug31 ? 07:31:36 [gfx_0.0.0] root 1739 2 1 Aug31 ? 09:13:08 [gfx_0.0.0]

2. 将第一个GPU进程绑定至空闲核。
  1 taskset -pc 32-33 1703

  回显信息如下： 1 2 pid 1703's current affinity list: 0-127 pid 1703's new affinity list: 32,33

3. 将第二个GPU进程绑定至空闲核。
  1 taskset -pc 64-65 1739

  回显信息如下： 1 2 pid 1739's current affinity list: 0-127 pid 1739's new affinity list: 64,65

  若查询出4个GPU驱动进程，则将前2个驱动进程绑到32-33核，后2个驱动进程绑到64-65核。
