Skip to content

Commit 2219427

Browse files
authored
Merge pull request #327 from chaitanya1731/gaudi-fw-upgrade
gaudi: Added Upgrade Gaudi SPI Firmware
2 parents fb06b27 + 39f4054 commit 2219427

File tree

4 files changed

+115
-1
lines changed

4 files changed

+115
-1
lines changed

gaudi/Gaudi-SPI-Firmware-Upgrade.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Upgrade Intel Gaudi SPI Firmware
2+
To upgrade Intel Gaudi SPI Firmware, follow below steps:
3+
4+
## Prerequisites
5+
- Make sure Gaudi drivers are unloaded.
6+
- On Red Hat OpenShift, delete existing deviceConfig Custom Resource. Verify output on the node using below command:
7+
```
8+
$ lsmod | grep habana
9+
10+
```
11+
12+
## SPI Firmware Upgrade
13+
Build the container image with `habanalabs-firmware-odm` tool:
14+
```
15+
$ oc apply -f https://raw.githubusercontent.com/intel/intel-technology-enabling-for-openshift/gaudi/gaudi_spi_fw_upgrade_build.yaml
16+
```
17+
Create service account with required permissions:
18+
```
19+
$ oc create sa gaudi-fw-upgrade-sa -n gaudi-spi-fw-upgrade
20+
$ oc adm policy add-scc-to-user privileged -z gaudi-fw-upgrade-sa -n gaudi-spi-fw-upgrade
21+
```
22+
Deploy and execute the SPI firmware upgrade tool:
23+
```
24+
$ oc apply -f https://raw.githubusercontent.com/intel/intel-technology-enabling-for-openshift/gaudi/gaudi_spi_fw_upgrade_job.yaml
25+
```
26+
27+
Verify Output:
28+
```
29+
$ oc get pods
30+
NAME READY STATUS RESTARTS AGE
31+
gaudi-spi-firmware-upgrade-ndmjp 0/1 Completed 0 10m
32+
```
33+
```
34+
$ oc logs gaudi-spi-firmware-upgrade-ndmjp
35+
.
36+
.
37+
####
38+
#### Finished sending firmware: OK
39+
```
40+
Verify using `hl-smi` tool:
41+
```
42+
sh-5.1$ hl-smi -L | grep SPI
43+
Firmware [SPI] Version : Preboot version hl-gaudi2-1.18.0-fw-53.1.1-sec-9 (Oct 02 2024 - 11:52:39)
44+
Firmware [SPI] Version : Preboot version hl-gaudi2-1.18.0-fw-53.1.1-sec-9 (Oct 02 2024 - 11:52:39)
45+
Firmware [SPI] Version : Preboot version hl-gaudi2-1.18.0-fw-53.1.1-sec-9 (Oct 02 2024 - 11:52:39)
46+
Firmware [SPI] Version : Preboot version hl-gaudi2-1.18.0-fw-53.1.1-sec-9 (Oct 02 2024 - 11:52:39)
47+
Firmware [SPI] Version : Preboot version hl-gaudi2-1.18.0-fw-53.1.1-sec-9 (Oct 02 2024 - 11:52:39)
48+
Firmware [SPI] Version : Preboot version hl-gaudi2-1.18.0-fw-53.1.1-sec-9 (Oct 02 2024 - 11:52:39)
49+
Firmware [SPI] Version : Preboot version hl-gaudi2-1.18.0-fw-53.1.1-sec-9 (Oct 02 2024 - 11:52:39)
50+
Firmware [SPI] Version : Preboot version hl-gaudi2-1.18.0-fw-53.1.1-sec-9 (Oct 02 2024 - 11:52:39)
51+
```

gaudi/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,7 @@ The resources provided are the user interface for customers to claim and consume
116116

117117
| Feature | Resources | Description |
118118
| ------- | --------- | ----------- |
119-
| Habana Gaudi | `habana.ai/gaudi` | Number of Habana Gaudi Card resources ready to claim |
119+
| Habana Gaudi | `habana.ai/gaudi` | Number of Habana Gaudi Card resources ready to claim |
120+
121+
## Upgrade Intel Gaudi SPI Firmware
122+
Refer [Upgrade Intel Gaudi SPI Firmware](/gaudi/Gaudi-SPI-Firmware-Upgrade.md) to upgrade the SPI Firmware on Intel Gaudi.

gaudi/gaudi_spi_fw_upgrade_build.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (c) 2024 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
---
4+
apiVersion: image.openshift.io/v1
5+
kind: ImageStream
6+
metadata:
7+
name: gaudi-spi-fw-upgrade
8+
namespace: gaudi-spi-fw-upgrade
9+
---
10+
kind: BuildConfig
11+
apiVersion: build.openshift.io/v1
12+
metadata:
13+
name: gaudi-spi-fw-upgrade
14+
namespace: gaudi-spi-fw-upgrade
15+
spec:
16+
output:
17+
to:
18+
kind: ImageStreamTag
19+
name: gaudi-spi-fw-upgrade:1.18.0-524
20+
strategy:
21+
type: Docker
22+
source:
23+
type: Dockerfile
24+
dockerfile: >+
25+
ARG
26+
BUILDER=vault.habana.ai/gaudi-docker/1.18.0/rhel9.4/habanalabs/pytorch-installer-2.4.0:1.18.0-524
27+
28+
FROM ${BUILDER} AS builder
29+
30+
RUN echo "[habanalabs]" > /etc/yum.repos.d/habanalabs.repo && \
31+
echo "name=Habana RH9 Linux repo" >> /etc/yum.repos.d/habanalabs.repo && \
32+
echo "baseurl=https://vault.habana.ai/artifactory/rhel/9/9.4" >> /etc/yum.repos.d/habanalabs.repo && \
33+
echo "gpgkey=https://vault.habana.ai/artifactory/api/v2/repositories/rhel/keyPairs/primary/public" >> /etc/yum.repos.d/habanalabs.repo && \
34+
echo "gpgcheck=1" >> /etc/yum.repos.d/habanalabs.repo
35+
36+
RUN yum makecache && dnf install -y habanalabs-firmware-odm
37+
triggers:
38+
- type: ConfigChange
39+
runPolicy: Serial

gaudi/gaudi_spi_fw_upgrade_job.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2024 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
---
4+
apiVersion: batch/v1
5+
kind: Job
6+
metadata:
7+
name: gaudi-spi-firmware-upgrade
8+
namespace: gaudi-spi-fw-upgrade
9+
spec:
10+
template:
11+
metadata:
12+
spec:
13+
restartPolicy: Never
14+
serviceAccountName: gaudi-fw-upgrade-sa
15+
containers:
16+
- name: gaudi-spi-firmware-upgrade
17+
securityContext:
18+
privileged: true
19+
image: image-registry.openshift-image-registry.svc:5000/gaudi-spi-fw-upgrade/gaudi-spi-fw-upgrade:1.18.0-524
20+
command: [ "hl-fw-loader", "-y" ]
21+
imagePullPolicy: Always

0 commit comments

Comments
 (0)