github.com/alibaba/sealer@v0.8.6-0.20220430115802-37a2bdaa8173/docs/site/src/zh/advanced/gpu-cloudimage.md (about)

     1  # GPU CloudImage
     2  
     3  ## Preparation
     4  
     5  1. Install nvidia driver on your host.
     6  2. Install the latest version of sealer on your host.
     7  
     8  ## How to build it
     9  
    10  We provide GPU base image in our official registry
    11  named `registry.cn-qingdao.aliyuncs.com/sealer-io/kubernetes-nvidia:v1.19.8`.you can use is directly. meanwhile, we
    12  provide the build context in the applications' directory. it can be adjusted it per your request.
    13  
    14  Run below command to rebuild it.
    15  
    16  `sealer build -f Kubefile -t registry.cn-qingdao.aliyuncs.com/sealer-io/kubernetes-nvidia:v1.19.8 -m lite .`
    17  
    18  ## How to apply it
    19  
    20  1. Modify the Clusterfile according to your infra environment,here is the Clusterfile for example.
    21  
    22  ```yaml
    23  apiVersion: sealer.cloud/v2
    24  kind: Cluster
    25  metadata:
    26    name: default-kubernetes-cluster
    27  spec:
    28    image: registry.cn-qingdao.aliyuncs.com/sealer-io/kubernetes-nvidia:v1.19.8
    29    ssh:
    30      passwd: xxx
    31    hosts:
    32      - ips: [ 192.168.0.2,192.168.0.3,192.168.0.4 ]
    33        roles: [ master ]
    34      - ips: [ 192.168.0.5 ]
    35        roles: [ node ]
    36  ```
    37  
    38  2. Run command `sealer apply -f Clusterfile` to apply the GPU cluster. it will take few minutes.
    39  
    40  ## How to check the result
    41  
    42  1. Check the pod status to run `kubectl get pods -n kube-system nvidia-device-plugin`, you can find the pod in Running
    43     status.
    44  2. Get the node details to run `kubectl describe node`, if `nvidia.com/gpu` shows on 'Allocated resources' section,you
    45     get a k8s cluster with GPU.