目录

目录

屏蔽部分GPU

目录

使用lspci | grep NVIDIA查看:

3b:00.0 VGA compatible controller: NVIDIA Corporation Device 2684 (rev a1)
3b:00.1 Audio device: NVIDIA Corporation Device 22ba (rev a1)
5e:00.0 VGA compatible controller: NVIDIA Corporation Device 2684 (rev a1)
5e:00.1 Audio device: NVIDIA Corporation Device 22ba (rev a1)
86:00.0 VGA compatible controller: NVIDIA Corporation Device 2684 (rev a1)
86:00.1 Audio device: NVIDIA Corporation Device 22ba (rev a1)
af:00.0 VGA compatible controller: NVIDIA Corporation Device 2684 (rev a1)
af:00.1 Audio device: NVIDIA Corporation Device 22ba (rev a1)

或者nvidia-smi查看:

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.161.07             Driver Version: 535.161.07   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce RTX 4090        Off | 00000000:3B:00.0 Off |                  Off |
|  0%   41C    P8              24W / 450W |     26MiB / 24564MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
|   1  NVIDIA GeForce RTX 4090        Off | 00000000:5E:00.0 Off |                  Off |
|  0%   40C    P8              12W / 450W |   1093MiB / 24564MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
|   2  NVIDIA GeForce RTX 4090        Off | 00000000:86:00.0 Off |                  Off |
|  0%   40C    P8               3W / 450W |     14MiB / 24564MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
|   3  NVIDIA GeForce RTX 4090        Off | 00000000:AF:00.0 Off |                  Off |
|  0%   40C    P8               5W / 450W |   3746MiB / 24564MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

可以看到pcie接口具体编号, 根据编号执行以下命令:

# 启用
nvidia-smi drain -p 0000:18:00.0 -m 0
# 禁用
nvidia-smi drain -p 0000:18:00.0 -m 1