Using nx-gzip in your Red Hat OpenShift Container Platform on IBM Power to accelerate GZip performance

Cross post from https://community.ibm.com/community/user/blogs/paul-bastide/2025/06/09/using-nx-gzip-in-your-red-hat-openshift-container

The Power10 processor features an on-chip accelerator that is called the nest accelerator unit (NX unit). The coprocessor features that are available on the Power10 processor are similar to the features of the Power9 processor. These coprocessors provide specialized functions, such as the Industry-standard Gzip compression and decompressionRandom number generation and AES and Secure Hash Algorithm (SHA) cryptography.

Block diagram of the NX unit

This article outlines how to use nx-gzip in a non-privileged container in Red Hat OpenShift Container Platform on IBM Power. You must have deployed a cluster with workers with a processor compatibility of IBM Power 10 or higher. The Active Memory Expansion feature must be licensed.

Build the power-gzip selftest binary

The test binary is used to show the feature is working and you can use the selftest and sample code to integrate in your environment.

  1. Login to the PowerVM instance running Red Hat Enterprise Linux 9
  2. Install required build binaries
dnf install make git gcc zlib-devel vim util-linux-2.37.4-11.el9.ppc64le -y
  1. Setup the Clone repository
git clone https://github.com/libnxz/power-gzip
cd power-gzip/
  1. Run the tests
./configure 
cd selftests
make
  1. Find the created test files
# ls g*test -al
-rwxr-xr-x. 1 root root 74992 Jun  9 08:24 gunz_test
-rwxr-xr-x. 1 root root 74888 Jun  9 08:24 gzfht_test

You are ready to test it.

Setup the NX-GZip test deployment

Download the examples repository and setup kustomization, and configure cri-o so you can deploy and use /dev/crypto/nx-gzip in a container.

  1. Install Kustomization tool for the deployment
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"  | bash
sudo mv kustomize /usr/local/bin
kustomize -h
  1. Clone the ocp4-power-workload-tools repository
git clone https://github.com/IBM/ocp4-power-workload-tools
cd ocp4-power-workload-tools
  1. Configure the worker nodes to use /dev/crypto/nx-gzip as an allowed_device.
oc apply -f ocp4-power-workload-tools/manifests/nx-gzip/99-worker-crio-nx-gzip.yaml
  1. Export kubeconfig using export KUBECONFIG=~/.kube/config
  2. Setup the nx-gzip test Pod as below
cd manifests/nx-gzip
kustomize build . | oc apply -f - 
  1. Resulting running pod as below
# oc get pod -n nx-gzip-demo
NAME               READY   STATUS    RESTARTS   AGE
nx-gzip-ds-2mlmh   1/1     Running   0          3s

You are ready to test nx-gzip.

To test with Privileged mode, you can use nx-gzip-privileged.

Copy the Test artifact into the running Pod and Run the Test Artifact

  1. Copy the above created executable files to the running pod
# oc cp gzfht_test nx-gzip-ds-2mlmh:/nx-test/
  1. Access the pod shell and confirm the Model name is Power10 or higher.
# oc rsh nx-gzip-ds-2mlmh
sh-5.1# lscpu | grep Model
Model name:                           POWER10 (architected), altivec supported
Model:                                2.0 (pvr 0080 0200)
  1. Create a test file for testing
sh-5.1# dd if=/dev/random of=/nx-test/test bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00431494 s, 243 MB/s
sh-5.1#

  1. Run the tests in pod
sh-5.1# /nx-test/gzfht_test /nx-test/test
file /nx-test/test read, 1048576 bytes
compressed 1048576 to 1105994 bytes total, crc32 checksum = a094fbab
sh-5.1# echo $?
0

If it shows as compressed and the return code is 0 and as above then its considered as PASS.

You’ve seen how the nx-gzip works in Pod. You can also combine with the Node Feature Discovery to label each Node Resource with cpu-coprocessor.nx_gzip=true

Thank you for your time and good luck.

Reference

  1. IBM Power10 Scale Out Servers Technical Overview S1012, S1014, S1022s, S1022 and S1024
  2. Exploitation of In-Core Acceleration of POWER Processors for AIX
  3. POWER NX zlib compliant library
  4. Db2: Hardware accelerated backup and log file compression

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *