# GPUドライバーをインストールする

ユーザーは、統合GPUサポートを備えたFPT Kubernetes Engineクラスターに、好みのGPUドライバーをインストールできます。

{% stepper %}
{% step %}

#### ステップ1: ドライバーインストールを「ユーザーインストール」に設定したGPUクラスターを作成する

*ドライバーインストールを「ユーザーインストール」に設定してクラスターを作成する*
{% endstep %}

{% step %}
GPUドライバーのバージョンを参照してください：

* リリースノート：[https://docs.nvidia.com/datacenter/tesla/index.html ](https://docs.nvidia.com/datacenter/tesla/index.html)<https://docs.nvidia.com/datacenter/tesla/drivers/releases.json>
* ドキュメント：<https://docs.nvidia.com/datacenter/tesla/drivers/index.html>
* インストーラー: <https://download.nvidia.com/XFree86/Linux-x86_64/>

お客様は下記のDaemonSet Driverインストールを参照できます:

```
# Copyright 2023 FPT CLOUD - PaaS
# worker.fptcloud/type=gpu

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fptcloud-gpu-driver-installer
  namespace: kube-system
  labels:
    k8s-app: gpu-driver
spec:
  selector:
    matchLabels:
      k8s-app: gpu-driver
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        name: nvidia-driver-installer
        k8s-app: gpu-driver
    spec:
      priorityClassName: system-node-critical
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: worker.fptcloud/type
                operator: In
                values: ["gpu"]
      tolerations:
      - operator: "Exists"
      containers:
        - image: docker.io/alpine:3.13
          name: nvidia-driver-installer
          command:
            - 'nsenter'
            - '-t'
            - '1'
            - '-m'
            - '-u'
            - '-i'
            - '-n'
            - '--'
            - 'bash'
            - '-l'
            - '-c'
            - 'curl -Ls https://raw.githubusercontent.com/fci-xplat/fke-config/main/fptcloud-gpu-driver-installer.sh | bash -s -- -p admin'
          resources:
            requests:
              cpu: 150m
          env:
          - name: NVIDIA_DRIVER_VERSION
            value: "535.54.03"
          - name: NVIDIA_TOOLKIT_INSTALL
            value: "true"
          imagePullPolicy: IfNotPresent
          securityContext:
            privileged: true
            allowPrivilegeEscalation: true
      hostPID: true
      hostNetwork: true
      hostIPC: true
```

環境変数パラメータ:

* **NVIDIA\_DRIVER\_VERSION:** ドライバーバージョン
* **NVIDIA\_TOOLKIT\_INSTALL:** 「true」 または 『false』（デフォルトは 「true」）。ツールキットを自動インストールするかどうか。

fptcloud DaemonSet を K8s クラスターに適用するには、次のコマンドを使用します:

```
kubectl apply -f https://raw.githubusercontent.com/fci-xplat/fke-config/main/fptcloud-gpu-driver-installer.yaml
```

デーモンセットのポッドの状態を確認する

`kubectl get pod -n kube-system | grep 「gpu-driver」`

```
NAME                                                 READY   STATUS    RESTARTS        AGE
fptcloud-gpu-driver-installer-7tj55                  1/1     Running   0               2d17h
```

デーモンセット fptcloud-gpu-driver-installer は、ワーカーグループ内のすべてのワーカー（ラベル worker.fptcloud/type: gpu を持つ）にポッドをスケジューリングし、ドライバー/ツールキットをインストールします。

* インストーラーのインストール完了を確認するには、fptcloud-gpu-driver-installer-7tj55 ポッドのログを確認してください。

`kubectl logs fptcloud-gpu-driver-installer-7tj55 -n kube-system`

* インストールが成功した場合、以下のようなログが表示されます。インストールプロセスには通常数分かかります。

```
Verifying Nvidia installation... DONE. 
Clean Nvidia installation... DONE.
```

{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ai-docs.fptcloud.com/ai-factory-guideline-jp/fpt-gpu-cloud/gpu-cluster/gpu-cluster-managed-k8s-with-gpu-virtual-machine/gaidochtoriaru/gpudoraibwoinsutrusuru.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
