Repository: NVIDIA/hpc-container-maker

Issue:
Support for DOCA-OFED Building Block
I've been exploring the available building blocks in HPCCM and noticed that there isn’t a dedicated building block for DOCA-OFED.
Given the recent NVIDIA MLNX_OFED to DOCA-OFED transition (as documented in the [NVIDIA DOCA Documentation](https://docs.nvidia.com/doca/sdk/nvidia+mlnx_ofed+to+doca-ofed+transition+guide/index.html)) it would be useful to have a corresponding building block for DOCA-OFED in HPCCM.

The transition guide explains that DOCA-OFED is designed as a 1-to-1 substitute for MLNX_OFED — providing the same kernel drivers, user space libraries, and management tools — but I am guessing this is in terms of functionality. 

So, is support for a doca-ofed building block planned or needed at all?

Hints from issue comments:
@samcmill: In most cases, the `ofed` building block can be used to install the distro OFED packages (aka inbox).  

I can look at adding a `doca_ofed` building block.

Solution patch:
diff --git a/docs/building_blocks.md b/docs/building_blocks.md
index 273c5e7..0fd27ea 100644
--- a/docs/building_blocks.md
+++ b/docs/building_blocks.md
@@ -246,7 +246,7 @@ repository.  For versions of Boost older than 1.63.0, the
 SourceForge repository should be used.  The default is False.
 
 - __version__: The version of Boost source to download.  The default
-value is `1.76.0`.
+value is `1.87.0`.
 
 __Examples__
 
@@ -635,6 +635,68 @@ Stage0 += c
 Stage1 += c.runtime()
 ```
 
+# doca_ofed
+```python
+doca_ofed(self, **kwargs)
+```
+The `doca_ofed` building block downloads and installs the [NVIDIA
+DOCA Software Framework](https://developer.nvidia.com/networking/doca).
+
+__Parameters__
+
+
+- __annotate__: Boolean flag to specify whether to include annotations
+(labels).  The default is False.
+
+- __archlabel__: The CPU architecture label assigned by Mellanox to the
+package repository.  The default value is `x86_64` for x86_64
+processors and `arm64-sbsa` for aarch64 processors.
+
+- __oslabel__: The Linux distribution label assigned by Mellanox to the
+package repository.  For Ubuntu, the default value is
+`ubuntuXX.04` where `XX` is derived from the base image.  For
+RHEL-base Linux distributions, the default value is `rhelX.Y`
+where `X.Y` is `9.2` for RHEL 9.x and `8.6` for RHEL 8.x.
+
+- __ospackages__: List of OS packages to install prior to installing
+DOCA OFED.  The default values are `ca-certificates`, `gnupg`, and
+`wget`.
+
+- __packages__: List of packages to install from Mellanox OFED.  For
+Ubuntu, the default values are `ibverbs-providers`,
+`ibverbs-utils` `libibmad-dev`, `libibmad5`, `libibumad3`,
+`libibumad-dev`, `libibverbs-dev` `libibverbs1`, `librdmacm-dev`,
+and `librdmacm1`.  For RHEL-based Linux distributions, the default
+values are `libibumad`, `libibverbs`, `libibverbs-utils`,
+`librdmacm`, `rdma-core`, and `rdma-core-devel`.
+
+- __version__: The version of DOCA OFED to download.  The default value
+is `2.10.0`.
+
+__Examples__
+
+
+```python
+doca_ofed(version='2.10.0')
+```
+
+
+## runtime
+```python
+doca_ofed.runtime(self, _from=u'0')
+```
+Generate the set of instructions to install the runtime specific
+components from a build in a previous stage.
+
+__Examples__
+
+
+```python
+d = doca_ofed(...)
+Stage0 += d
+Stage1 += d.runtime()
+```
+
 # fftw
 ```python
 fftw(self, **kwargs)
@@ -3196,7 +3258,7 @@ the default GNU toolchain.
 
 - __version__: The version of the HPC SDK to use.  Note when `package`
 is set the version is determined automatically from the package
-file name.  The default value is `24.9`.
+file name.  The default value is `25.1`.
 
 __Examples__
 
diff --git a/hpccm/building_blocks/__init__.py b/hpccm/building_blocks/__init__.py
index a14502d..53fc65f 100644
--- a/hpccm/building_blocks/__init__.py
+++ b/hpccm/building_blocks/__init__.py
@@ -23,6 +23,7 @@
            'charm',
            'cmake',
            'conda',
+           'doca_ofed',
            'fftw',
            'gdrcopy',
            'generic_autotools',
@@ -78,6 +79,7 @@
 from hpccm.building_blocks.charm import charm
 from hpccm.building_blocks.cmake import cmake
 from hpccm.building_blocks.conda import conda
+from hpccm.building_blocks.doca_ofed import doca_ofed
 from hpccm.building_blocks.fftw import fftw
 from hpccm.building_blocks.gdrcopy import gdrcopy
 from hpccm.building_blocks.generic_autotools import generic_autotools
diff --git a/hpccm/building_blocks/boost.py b/hpccm/building_blocks/boost.py
index 72f26b8..4f58141 100644
--- a/hpccm/building_blocks/boost.py
+++ b/hpccm/building_blocks/boost.py
@@ -82,7 +82,7 @@ class boost(bb_base, hpccm.templates.envvars, hpccm.templates.ldconfig,
     SourceForge repository should be used.  The default is False.
 
     version: The version of Boost source to download.  The default
-    value is `1.76.0`.
+    value is `1.87.0`.
 
     # Examples
 
@@ -103,14 +103,14 @@ def __init__(self, **kwargs):
 
         self.__b2_opts = kwargs.get('b2_opts', [])
         self.__baseurl = kwargs.get('baseurl',
-                                    'https://boostorg.jfrog.io/artifactory/main/release/__version__/source')
+                                    'https://archives.boost.io/release/__version__/source')
         self.__bootstrap_opts = kwargs.get('bootstrap_opts', [])
         self.__ospackages = kwargs.get('ospackages', [])
         self.__parallel = kwargs.get('parallel', '$(nproc)')
         self.__prefix = kwargs.get('prefix', '/usr/local/boost')
         self.__python = kwargs.get('python', False)
         self.__sourceforge = kwargs.get('sourceforge', False)
-        self.__version = kwargs.get('version', '1.76.0')
+        self.__version = kwargs.get('version', '1.87.0')
 
         self.__commands = [] # Filled in by __setup()
         self.__wd = kwargs.get('wd', hpccm.config.g_wd) # working directory
diff --git a/hpccm/building_blocks/doca_ofed.py b/hpccm/building_blocks/doca_ofed.py
new file mode 100644
index 0000000..1989412
--- /dev/null
+++ b/hpccm/building_blocks/doca_ofed.py
@@ -0,0 +1,179 @@
+# Copyright (c) 2025, 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
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# pylint: disable=invalid-name, too-few-public-methods
+
+"""DOCA OFED building block"""
+
+from __future__ import absolute_import
+from __future__ import unicode_literals
+from __future__ import print_function
+
+from packaging.version import Version
+import posixpath
+
+import hpccm.config
+import hpccm.templates.annotate
+
+from hpccm.building_blocks.base import bb_base
+from hpccm.building_blocks.packages import packages
+from hpccm.common import cpu_arch, linux_distro
+from hpccm.primitives.comment import comment
+from hpccm.primitives.label import label
+
+class doca_ofed(bb_base, hpccm.templates.annotate, hpccm.templates.rm,
+                hpccm.templates.tar, hpccm.templates.wget):
+    """The `doca_ofed` building block downloads and installs the [NVIDIA
+    DOCA Software Framework](https://developer.nvidia.com/networking/doca).
+
+    # Parameters
+
+    annotate: Boolean flag to specify whether to include annotations
+    (labels).  The default is False.
+
+    archlabel: The CPU architecture label assigned by Mellanox to the
+    package repository.  The default value is `x86_64` for x86_64
+    processors and `arm64-sbsa` for aarch64 processors.
+
+    oslabel: The Linux distribution label assigned by Mellanox to the
+    package repository.  For Ubuntu, the default value is
+    `ubuntuXX.04` where `XX` is derived from the base image.  For
+    RHEL-base Linux distributions, the default value is `rhelX.Y`
+    where `X.Y` is `9.2` for RHEL 9.x and `8.6` for RHEL 8.x.
+
+    ospackages: List of OS packages to install prior to installing
+    DOCA OFED.  The default values are `ca-certificates`, `gnupg`, and
+    `wget`.
+
+    packages: List of packages to install from Mellanox OFED.  For
+    Ubuntu, the default values are `ibverbs-providers`,
+    `ibverbs-utils` `libibmad-dev`, `libibmad5`, `libibumad3`,
+    `libibumad-dev`, `libibverbs-dev` `libibverbs1`, `librdmacm-dev`,
+    and `librdmacm1`.  For RHEL-based Linux distributions, the default
+    values are `libibumad`, `libibverbs`, `libibverbs-utils`,
+    `librdmacm`, `rdma-core`, and `rdma-core-devel`.
+
+    version: The version of DOCA OFED to download.  The default value
+    is `2.10.0`.
+
+    # Examples
+
+    ```python
+    doca_ofed(version='2.10.0')
+    ```
+
+    """
+
+    def __init__(self, **kwargs):
+        """Initialize building block"""
+
+        super(doca_ofed, self).__init__(**kwargs)
+
+        self.__archlabel = kwargs.get('archlabel', '') # Filled in by __cpu_arch
+        self.__key = 'https://linux.mellanox.com/public/repo/doca/GPG-KEY-Mellanox.pub'
+        self.__oslabel = kwargs.get('oslabel', '') # Filled in by __distro
+        self.__ospackages = kwargs.get('ospackages',
+                                       ['ca-certificates', 'gnupg', 'wget'])
+        self.__packages = kwargs.get('packages', []) # Filled in by __distro
+        self.__version = kwargs.get('version', '2.10.0')
+
+        # Add annotation
+        self.add_annotation('version', self.__version)
+
+        # Set the CPU architecture specific parameters
+        self.__cpu_arch()
+
+        # Set the Linux distribution specific parameters
+        self.__distro()
+
+        # Fill in container instructions
+        self.__instructions()
+
+    def __instructions(self):
+        """Fill in container instructions"""
+
+        self += comment('DOCA OFED version {}'.format(self.__version))
+
+        self += packages(ospackages=self.__ospackages)
+
+        self += packages(
+            apt_keys=[self.__key],
+            apt_repositories=['deb [signed-by=/usr/share/keyrings/{3}] https://linux.mellanox.com/public/repo/doca/{0}/{1}/{2}/ ./'.format(self.__version, self.__oslabel, self.__archlabel, posixpath.basename(self.__key).replace('.pub', '.gpg'))],
+            ospackages=self.__packages,
+            yum_keys=[self.__key],
+            yum_repositories=['https://linux.mellanox.com/public/repo/doca/{0}/{1}/{2}'.format(self.__version, self.__oslabel, self.__archlabel)])
+
+        self += label(metadata=self.annotate_step())
+
+    def __cpu_arch(self):
+        """Based on the CPU architecture, set values accordingly.  A user
+           specified value overrides any defaults."""
+
+        if not self.__archlabel:
+            if hpccm.config.g_cpu_arch == cpu_arch.AARCH64:
+                self.__archlabel = 'arm64-sbsa'
+            elif hpccm.config.g_cpu_arch == cpu_arch.X86_64:
+                self.__archlabel = 'x86_64'
+            else: # pragma: no cover
+                raise RuntimeError('Unknown CPU architecture')
+
+    def __distro(self):
+        """Based on the Linux distribution, set values accordingly.  A user
+           specified value overrides any defaults."""
+
+        if hpccm.config.g_linux_distro == linux_distro.UBUNTU:
+            if not self.__oslabel:
+                if hpccm.config.g_linux_version >= Version('24.0'):
+                    self.__oslabel = 'ubuntu24.04'
+                elif hpccm.config.g_linux_version >= Version('22.0'):
+                    self.__oslabel = 'ubuntu22.04'
+                else:
+                    self.__oslabel = 'ubuntu20.04'
+
+            if not self.__packages:
+                self.__packages = ['libibverbs1', 'libibverbs-dev',
+                                   'ibverbs-providers', 'ibverbs-utils',
+                                   'libibmad5',  'libibmad-dev',
+                                   'libibumad3', 'libibumad-dev',
+                                   'librdmacm-dev', 'librdmacm1']
+
+        elif hpccm.config.g_linux_distro == linux_distro.CENTOS:
+            if not self.__oslabel:
+                if hpccm.config.g_linux_version >= Version('9.0'):
+                    self.__oslabel = 'rhel9.2'
+                else:
+                    self.__oslabel = 'rhel8.6'
+
+            if not self.__packages:
+                    self.__packages = ['libibverbs', 'libibverbs-utils',
+                                       'libibumad', 'librdmacm',
+                                       'rdma-core', 'rdma-core-devel']
+
+        else: # pragma: no cover
+            raise RuntimeError('Unknown Linux distribution')
+
+    def runtime(self, _from='0'):
+        """Generate the set of instructions to install the runtime specific
+        components from a build in a previous stage.
+
+        # Examples
+
+        ```python
+        d = doca_ofed(...)
+        Stage0 += d
+        Stage1 += d.runtime()
+        ```
+        """
+
+        return str(self)
diff --git a/hpccm/building_blocks/nvhpc.py b/hpccm/building_blocks/nvhpc.py
index aa5cd9f..ad3abd0 100644
--- a/hpccm/building_blocks/nvhpc.py
+++ b/hpccm/building_blocks/nvhpc.py
@@ -117,7 +117,7 @@ class nvhpc(bb_base, hpccm.templates.downloader, hpccm.templates.envvars,
 
     version: The version of the HPC SDK to use.  Note when `package`
     is set the version is determined automatically from the package
-    file name.  The default value is `24.9`.
+    file name.  The default value is `25.1`.
 
     # Examples
 
@@ -175,7 +175,7 @@ def __init__(self, **kwargs):
         self.__tarball = kwargs.get('tarball', False)
         self.__toolchain = kwargs.get('toolchain', None)
         self.__url = kwargs.get('url', None)
-        self.__version = kwargs.get('version', '24.9')
+        self.__version = kwargs.get('version', '25.1')
         self.__wd = kwargs.get('wd', hpccm.config.g_wd) # working directory
         self.__year = '' # Filled in by __get_version()
 
diff --git a/pydocmd.yml b/pydocmd.yml
index 04b48e7..364a2f1 100644
--- a/pydocmd.yml
+++ b/pydocmd.yml
@@ -13,6 +13,7 @@ generate:
   - hpccm.building_blocks.charm+
   - hpccm.building_blocks.cmake+
   - hpccm.building_blocks.conda+
+  - hpccm.building_blocks.doca_ofed+
   - hpccm.building_blocks.fftw+
   - hpccm.building_blocks.gdrcopy+
   - hpccm.building_blocks.generic_autotools+


Test patch:
diff --git a/test/test_boost.py b/test/test_boost.py
index c82a89c..043bb9c 100644
--- a/test/test_boost.py
+++ b/test/test_boost.py
@@ -37,7 +37,7 @@ def test_defaults_ubuntu(self):
         """Default boost building block"""
         b = boost()
         self.assertEqual(str(b),
-r'''# Boost version 1.76.0
+r'''# Boost version 1.87.0
 RUN apt-get update -y && \
     DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
         bzip2 \
@@ -46,11 +46,11 @@ def test_defaults_ubuntu(self):
         wget \
         zlib1g-dev && \
     rm -rf /var/lib/apt/lists/*
-RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2 && \
-    mkdir -p /var/tmp && tar -x -f /var/tmp/boost_1_76_0.tar.bz2 -C /var/tmp -j && \
-    cd /var/tmp/boost_1_76_0 && ./bootstrap.sh --prefix=/usr/local/boost --without-libraries=python && \
+RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.bz2 && \
+    mkdir -p /var/tmp && tar -x -f /var/tmp/boost_1_87_0.tar.bz2 -C /var/tmp -j && \
+    cd /var/tmp/boost_1_87_0 && ./bootstrap.sh --prefix=/usr/local/boost --without-libraries=python && \
     ./b2 -j$(nproc) -q install && \
-    rm -rf /var/tmp/boost_1_76_0.tar.bz2 /var/tmp/boost_1_76_0
+    rm -rf /var/tmp/boost_1_87_0.tar.bz2 /var/tmp/boost_1_87_0
 ENV LD_LIBRARY_PATH=/usr/local/boost/lib:$LD_LIBRARY_PATH''')
 
     @centos
@@ -59,7 +59,7 @@ def test_defaults_centos(self):
         """Default boost building block"""
         b = boost()
         self.assertEqual(str(b),
-r'''# Boost version 1.76.0
+r'''# Boost version 1.87.0
 RUN yum install -y \
         bzip2 \
         bzip2-devel \
@@ -68,11 +68,11 @@ def test_defaults_centos(self):
         which \
         zlib-devel && \
     rm -rf /var/cache/yum/*
-RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2 && \
-    mkdir -p /var/tmp && tar -x -f /var/tmp/boost_1_76_0.tar.bz2 -C /var/tmp -j && \
-    cd /var/tmp/boost_1_76_0 && ./bootstrap.sh --prefix=/usr/local/boost --without-libraries=python && \
+RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.bz2 && \
+    mkdir -p /var/tmp && tar -x -f /var/tmp/boost_1_87_0.tar.bz2 -C /var/tmp -j && \
+    cd /var/tmp/boost_1_87_0 && ./bootstrap.sh --prefix=/usr/local/boost --without-libraries=python && \
     ./b2 -j$(nproc) -q install && \
-    rm -rf /var/tmp/boost_1_76_0.tar.bz2 /var/tmp/boost_1_76_0
+    rm -rf /var/tmp/boost_1_87_0.tar.bz2 /var/tmp/boost_1_87_0
 ENV LD_LIBRARY_PATH=/usr/local/boost/lib:$LD_LIBRARY_PATH''')
 
     @ubuntu
@@ -90,7 +90,7 @@ def test_python(self):
         wget \
         zlib1g-dev && \
     rm -rf /var/lib/apt/lists/*
-RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2 && \
+RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://archives.boost.io/release/1.72.0/source/boost_1_72_0.tar.bz2 && \
     mkdir -p /var/tmp && tar -x -f /var/tmp/boost_1_72_0.tar.bz2 -C /var/tmp -j && \
     cd /var/tmp/boost_1_72_0 && ./bootstrap.sh --prefix=/usr/local/boost  && \
     ./b2 -j$(nproc) -q install && \
@@ -134,7 +134,7 @@ def test_ldconfig(self):
         wget \
         zlib1g-dev && \
     rm -rf /var/lib/apt/lists/*
-RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://boostorg.jfrog.io/artifactory/main/release/1.68.0/source/boost_1_68_0.tar.bz2 && \
+RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://archives.boost.io/release/1.68.0/source/boost_1_68_0.tar.bz2 && \
     mkdir -p /var/tmp && tar -x -f /var/tmp/boost_1_68_0.tar.bz2 -C /var/tmp -j && \
     cd /var/tmp/boost_1_68_0 && ./bootstrap.sh --prefix=/usr/local/boost --without-libraries=python && \
     ./b2 -j$(nproc) -q install && \
@@ -156,7 +156,7 @@ def test_bootstrap_opts(self):
         wget \
         zlib1g-dev && \
     rm -rf /var/lib/apt/lists/*
-RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2 && \
+RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://archives.boost.io/release/1.72.0/source/boost_1_72_0.tar.bz2 && \
     mkdir -p /var/tmp && tar -x -f /var/tmp/boost_1_72_0.tar.bz2 -C /var/tmp -j && \
     cd /var/tmp/boost_1_72_0 && ./bootstrap.sh --prefix=/usr/local/boost --with-libraries=atomic,chrono && \
     ./b2 -j$(nproc) -q install && \
@@ -177,7 +177,7 @@ def test_b2_opts(self):
         wget \
         zlib1g-dev && \
     rm -rf /var/lib/apt/lists/*
-RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2 && \
+RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://archives.boost.io/release/1.72.0/source/boost_1_72_0.tar.bz2 && \
     mkdir -p /var/tmp && tar -x -f /var/tmp/boost_1_72_0.tar.bz2 -C /var/tmp -j && \
     cd /var/tmp/boost_1_72_0 && ./bootstrap.sh --prefix=/usr/local/boost --without-libraries=python && \
     ./b2 cxxflags="-std=c++14" -j$(nproc) -q install && \
diff --git a/test/test_doca_ofed.py b/test/test_doca_ofed.py
new file mode 100644
index 0000000..84ed2b9
--- /dev/null
+++ b/test/test_doca_ofed.py
@@ -0,0 +1,211 @@
+# Copyright (c) 2025, 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
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# pylint: disable=invalid-name, too-few-public-methods, bad-continuation
+
+"""Test cases for the mlnx_ofed module"""
+
+from __future__ import unicode_literals
+from __future__ import print_function
+
+import logging # pylint: disable=unused-import
+import unittest
+
+from helpers import aarch64, centos8, docker, rockylinux9, ubuntu20, ubuntu22, ubuntu24, x86_64
+
+from hpccm.building_blocks.doca_ofed import doca_ofed
+
+class Test_doca_ofed(unittest.TestCase):
+    def setUp(self):
+        """Disable logging output messages"""
+        logging.disable(logging.ERROR)
+
+    @x86_64
+    @ubuntu20
+    @docker
+    def test_defaults_ubuntu20(self):
+        """Default doca_ofed building block"""
+        doca = doca_ofed()
+        self.assertMultiLineEqual(str(doca),
+r'''# DOCA OFED version 2.10.0
+RUN apt-get update -y && \
+    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+        ca-certificates \
+        gnupg \
+        wget && \
+    rm -rf /var/lib/apt/lists/*
+RUN mkdir -p /usr/share/keyrings && \
+    rm -f /usr/share/keyrings/GPG-KEY-Mellanox.gpg && \
+    wget -qO - https://linux.mellanox.com/public/repo/doca/GPG-KEY-Mellanox.pub | gpg --dearmor -o /usr/share/keyrings/GPG-KEY-Mellanox.gpg && \
+    echo "deb [signed-by=/usr/share/keyrings/GPG-KEY-Mellanox.gpg] https://linux.mellanox.com/public/repo/doca/2.10.0/ubuntu20.04/x86_64/ ./" >> /etc/apt/sources.list.d/hpccm.list && \
+    apt-get update -y && \
+    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+        ibverbs-providers \
+        ibverbs-utils \
+        libibmad-dev \
+        libibmad5 \
+        libibumad-dev \
+        libibumad3 \
+        libibverbs-dev \
+        libibverbs1 \
+        librdmacm-dev \
+        librdmacm1 && \
+    rm -rf /var/lib/apt/lists/*''')
+
+    @aarch64
+    @ubuntu22
+    @docker
+    def test_defaults_ubuntu22(self):
+        """Default doca_ofed building block"""
+        doca = doca_ofed()
+        self.assertMultiLineEqual(str(doca),
+r'''# DOCA OFED version 2.10.0
+RUN apt-get update -y && \
+    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+        ca-certificates \
+        gnupg \
+        wget && \
+    rm -rf /var/lib/apt/lists/*
+RUN mkdir -p /usr/share/keyrings && \
+    rm -f /usr/share/keyrings/GPG-KEY-Mellanox.gpg && \
+    wget -qO - https://linux.mellanox.com/public/repo/doca/GPG-KEY-Mellanox.pub | gpg --dearmor -o /usr/share/keyrings/GPG-KEY-Mellanox.gpg && \
+    echo "deb [signed-by=/usr/share/keyrings/GPG-KEY-Mellanox.gpg] https://linux.mellanox.com/public/repo/doca/2.10.0/ubuntu22.04/arm64-sbsa/ ./" >> /etc/apt/sources.list.d/hpccm.list && \
+    apt-get update -y && \
+    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+        ibverbs-providers \
+        ibverbs-utils \
+        libibmad-dev \
+        libibmad5 \
+        libibumad-dev \
+        libibumad3 \
+        libibverbs-dev \
+        libibverbs1 \
+        librdmacm-dev \
+        librdmacm1 && \
+    rm -rf /var/lib/apt/lists/*''')
+
+    @x86_64
+    @ubuntu24
+    @docker
+    def test_defaults_ubuntu24(self):
+        """Default doca_ofed building block"""
+        doca = doca_ofed()
+        self.assertMultiLineEqual(str(doca),
+r'''# DOCA OFED version 2.10.0
+RUN apt-get update -y && \
+    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+        ca-certificates \
+        gnupg \
+        wget && \
+    rm -rf /var/lib/apt/lists/*
+RUN mkdir -p /usr/share/keyrings && \
+    rm -f /usr/share/keyrings/GPG-KEY-Mellanox.gpg && \
+    wget -qO - https://linux.mellanox.com/public/repo/doca/GPG-KEY-Mellanox.pub | gpg --dearmor -o /usr/share/keyrings/GPG-KEY-Mellanox.gpg && \
+    echo "deb [signed-by=/usr/share/keyrings/GPG-KEY-Mellanox.gpg] https://linux.mellanox.com/public/repo/doca/2.10.0/ubuntu24.04/x86_64/ ./" >> /etc/apt/sources.list.d/hpccm.list && \
+    apt-get update -y && \
+    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+        ibverbs-providers \
+        ibverbs-utils \
+        libibmad-dev \
+        libibmad5 \
+        libibumad-dev \
+        libibumad3 \
+        libibverbs-dev \
+        libibverbs1 \
+        librdmacm-dev \
+        librdmacm1 && \
+    rm -rf /var/lib/apt/lists/*''')
+
+    @x86_64
+    @rockylinux9
+    @docker
+    def test_defaults_rockylinux9(self):
+        """Default doca_ofed building block"""
+        doca = doca_ofed()
+        self.assertMultiLineEqual(str(doca),
+r'''# DOCA OFED version 2.10.0
+RUN yum install -y \
+        ca-certificates \
+        gnupg \
+        wget && \
+    rm -rf /var/cache/yum/*
+RUN rpm --import https://linux.mellanox.com/public/repo/doca/GPG-KEY-Mellanox.pub && \
+    yum install -y dnf-utils && \
+    yum-config-manager --add-repo https://linux.mellanox.com/public/repo/doca/2.10.0/rhel9.2/x86_64 && \
+    yum install -y \
+        libibumad \
+        libibverbs \
+        libibverbs-utils \
+        librdmacm \
+        rdma-core \
+        rdma-core-devel && \
+    rm -rf /var/cache/yum/*''')
+
+    @x86_64
+    @centos8
+    @docker
+    def test_defaults_rockylinux8(self):
+        """Default doca_ofed building block"""
+        doca = doca_ofed()
+        self.assertMultiLineEqual(str(doca),
+r'''# DOCA OFED version 2.10.0
+RUN yum install -y \
+        ca-certificates \
+        gnupg \
+        wget && \
+    rm -rf /var/cache/yum/*
+RUN rpm --import https://linux.mellanox.com/public/repo/doca/GPG-KEY-Mellanox.pub && \
+    yum install -y dnf-utils && \
+    yum-config-manager --add-repo https://linux.mellanox.com/public/repo/doca/2.10.0/rhel8.6/x86_64 && \
+    yum install -y \
+        libibumad \
+        libibverbs \
+        libibverbs-utils \
+        librdmacm \
+        rdma-core \
+        rdma-core-devel && \
+    rm -rf /var/cache/yum/*''')
+
+    @x86_64
+    @ubuntu24
+    @docker
+    def test_runtime(self):
+        """Runtime"""
+        doca = doca_ofed(version='2.10.0')
+        r = doca.runtime()
+        self.assertMultiLineEqual(r,
+r'''# DOCA OFED version 2.10.0
+RUN apt-get update -y && \
+    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+        ca-certificates \
+        gnupg \
+        wget && \
+    rm -rf /var/lib/apt/lists/*
+RUN mkdir -p /usr/share/keyrings && \
+    rm -f /usr/share/keyrings/GPG-KEY-Mellanox.gpg && \
+    wget -qO - https://linux.mellanox.com/public/repo/doca/GPG-KEY-Mellanox.pub | gpg --dearmor -o /usr/share/keyrings/GPG-KEY-Mellanox.gpg && \
+    echo "deb [signed-by=/usr/share/keyrings/GPG-KEY-Mellanox.gpg] https://linux.mellanox.com/public/repo/doca/2.10.0/ubuntu24.04/x86_64/ ./" >> /etc/apt/sources.list.d/hpccm.list && \
+    apt-get update -y && \
+    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+        ibverbs-providers \
+        ibverbs-utils \
+        libibmad-dev \
+        libibmad5 \
+        libibumad-dev \
+        libibumad3 \
+        libibverbs-dev \
+        libibverbs1 \
+        librdmacm-dev \
+        librdmacm1 && \
+    rm -rf /var/lib/apt/lists/*''')
diff --git a/test/test_nvhpc.py b/test/test_nvhpc.py
index 127e4e1..a96182b 100644
--- a/test/test_nvhpc.py
+++ b/test/test_nvhpc.py
@@ -39,7 +39,7 @@ def test_defaults_ubuntu(self):
         """Default HPC SDK building block"""
         n = nvhpc(eula=True)
         self.assertMultiLineEqual(str(n),
-r'''# NVIDIA HPC SDK version 24.9
+r'''# NVIDIA HPC SDK version 25.1
 RUN apt-get update -y && \
     DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
         ca-certificates \
@@ -52,12 +52,12 @@ def test_defaults_ubuntu(self):
     echo "deb [signed-by=/usr/share/keyrings/DEB-GPG-KEY-NVIDIA-HPC-SDK.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /" >> /etc/apt/sources.list.d/hpccm.list && \
     apt-get update -y && \
     DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
-        nvhpc-24-9-cuda-multi && \
+        nvhpc-25-1-cuda-multi && \
     rm -rf /var/lib/apt/lists/*
-ENV CPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nvshmem/include:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nccl/include:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/extras/qd/include/qd:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/math_libs/include:$CPATH \
-    LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nvshmem/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nccl/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/math_libs/lib64:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/cuda/lib64:$LD_LIBRARY_PATH \
-    MANPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/man:$MANPATH \
-    PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nvshmem/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nccl/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/profilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/cuda/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/mpi/bin:$PATH''')
+ENV CPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/nvshmem/include:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/nccl/include:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/compilers/extras/qd/include/qd:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/math_libs/include:$CPATH \
+    LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/nvshmem/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/nccl/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/math_libs/lib64:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/compilers/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/cuda/lib64:$LD_LIBRARY_PATH \
+    MANPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/compilers/man:$MANPATH \
+    PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/nvshmem/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/nccl/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/profilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/compilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/cuda/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/mpi/bin:$PATH''')
 
     @x86_64
     @centos
@@ -66,19 +66,19 @@ def test_defaults_centos(self):
         """Default HPC SDK building block"""
         n = nvhpc(eula=True)
         self.assertMultiLineEqual(str(n),
-r'''# NVIDIA HPC SDK version 24.9
+r'''# NVIDIA HPC SDK version 25.1
 RUN yum install -y \
         ca-certificates && \
     rm -rf /var/cache/yum/*
 RUN yum install -y yum-utils && \
     yum-config-manager --add-repo https://developer.download.nvidia.com/hpc-sdk/rhel/nvhpc.repo && \
     yum install -y \
-        nvhpc-cuda-multi-24.9 && \
+        nvhpc-cuda-multi-25.1 && \
     rm -rf /var/cache/yum/*
-ENV CPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nvshmem/include:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nccl/include:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/extras/qd/include/qd:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/math_libs/include:$CPATH \
-    LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nvshmem/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nccl/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/math_libs/lib64:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/cuda/lib64:$LD_LIBRARY_PATH \
-    MANPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/man:$MANPATH \
-    PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nvshmem/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/nccl/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/profilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/cuda/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/mpi/bin:$PATH''')
+ENV CPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/nvshmem/include:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/nccl/include:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/compilers/extras/qd/include/qd:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/math_libs/include:$CPATH \
+    LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/nvshmem/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/nccl/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/math_libs/lib64:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/compilers/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/cuda/lib64:$LD_LIBRARY_PATH \
+    MANPATH=/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/compilers/man:$MANPATH \
+    PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/nvshmem/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/nccl/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/profilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/compilers/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/cuda/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/mpi/bin:$PATH''')
 
     @x86_64
     @centos
@@ -218,10 +218,10 @@ def test_runtime_ubuntu(self):
         libnuma1 \
         openssh-client && \
     rm -rf /var/lib/apt/lists/*
-COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/REDIST/compilers/lib/* /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/lib/
-COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/mpi /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/mpi
-ENV LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/mpi/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/lib:$LD_LIBRARY_PATH \
-    PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/mpi/bin:$PATH''')
+COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/25.1/REDIST/compilers/lib/* /opt/nvidia/hpc_sdk/Linux_x86_64/25.1/compilers/lib/
+COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/mpi /opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/mpi
+ENV LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/mpi/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/compilers/lib:$LD_LIBRARY_PATH \
+    PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/mpi/bin:$PATH''')
 
     @x86_64
     @centos
@@ -241,11 +241,11 @@ def test_runtime_centos(self):
         numactl-libs \
         openssh-clients && \
     rm -rf /var/cache/yum/*
-COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/REDIST/comm_libs/11.8/nccl/lib/libnccl.so /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/11.8/nccl/lib/libnccl.so
-COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/REDIST/compilers/lib/* /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/lib/
-COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/REDIST/math_libs/11.8/lib64/libcufft.so.10 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/math_libs/11.8/lib64/libcufft.so.10
-COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/REDIST/math_libs/11.8/lib64/libcublas.so.11 /opt/nvidia/hpc_sdk/Linux_x86_64/24.9/math_libs/11.8/lib64/libcublas.so.11
-ENV LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/comm_libs/11.8/nccl/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/math_libs/11.8/lib64:$LD_LIBRARY_PATH''')
+COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/25.1/REDIST/comm_libs/11.8/nccl/lib/libnccl.so /opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/11.8/nccl/lib/libnccl.so
+COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/25.1/REDIST/compilers/lib/* /opt/nvidia/hpc_sdk/Linux_x86_64/25.1/compilers/lib/
+COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/25.1/REDIST/math_libs/11.8/lib64/libcufft.so.10 /opt/nvidia/hpc_sdk/Linux_x86_64/25.1/math_libs/11.8/lib64/libcufft.so.10
+COPY --from=0 /opt/nvidia/hpc_sdk/Linux_x86_64/25.1/REDIST/math_libs/11.8/lib64/libcublas.so.11 /opt/nvidia/hpc_sdk/Linux_x86_64/25.1/math_libs/11.8/lib64/libcublas.so.11
+ENV LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/comm_libs/11.8/nccl/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/compilers/lib:/opt/nvidia/hpc_sdk/Linux_x86_64/25.1/math_libs/11.8/lib64:$LD_LIBRARY_PATH''')
 
     @x86_64
     @ubuntu