1.k8s集群使用GPU问题
首先需要安装 nvidia-container-runtime
yum install nvidia-container-runtime
然后修改 /etc/docker/daemon.json 文件,添加以下内容
"default-runtime": "nvidia",
"runtimes": {
"nvidia": {
"path": "/usr/bin/nvidia-container-runtime",
"runtimeArgs": []
}
},
然后重新载入daemon并重启docker
systemctl daemon-reload
systemctl restart docker
最后安装 k8s插件 nvidia-device-plugin
nvidia-device-plugin.yml
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0