问题描述:我有一个程序(app),需要用到显卡来跑。原本的部署方式 是直接修改程序的配置文件来指定要用到的显卡。
这是我服务器的显卡信息:总共3卡 分别是 0卡 ,1卡和2卡。
[root@k8s-rancher1 etc]# nvidia-smi Sat Sep 4 12:50:17 2021 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 460.84 Driver Version: 460.84 CUDA Version: 11.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 GeForce GTX 1070 Off | 00000000:02:00.0 Off | N/A | | 21% 37C P0 37W / 180W | 0MiB / 8119MiB | 0% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ | 1 GeForce GTX 1070 Off | 00000000:03:00.0 Off | N/A | | 24% 46C P5 13W / 180W | 0MiB / 8119MiB | 0% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ | 2 GeForce GTX 1070 Off | 00000000:04:00.0 Off | N/A | | 24% 48C P5 16W / 180W | 0MiB / 8119MiB | 2% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+