NVIDIA GPUDirect Remote Direct Memory Access (RDMA)
NVIDIA GPUDirect Remote Direct Memory Access (RDMA) allows for an application in one computer to directly access the memory of another computer without needing access through the operating system. This provides the ability to bypass kernel intervention in the process, freeing up resources and greatly reducing the CPU overhead normally needed to process network communications. This is useful for distributing GPU-accelerated workloads across clusters. And because RDMA is so suited toward high bandwidth and low latency applications, this makes it ideal for big data and machine learning applications.
There are currently three configuration methods for NVIDIA GPUDirect RDMA:
- Shared device
- This method allows for an NVIDIA GPUDirect RDMA device to be shared among multiple pods on the OpenShift Container Platform worker node where the device is exposed.
- Host device
- This method provides direct physical Ethernet access on the worker node by creating an additional host network on a pod. A plugin allows the network device to be moved from the host network namespace to the network namespace on the pod.
- SR-IOV legacy device
- The Single Root IO Virtualization (SR-IOV) method can share a single network device, such as an Ethernet adapter, with multiple pods. SR-IOV segments the device, recognized on the host node as a physical function (PF), into multiple virtual functions (VFs). The VF is used like any other network device.
Each of these methods can be used across either the NVIDIA GPUDirect RDMA over Converged Ethernet (RoCE) or Infiniband infrastructures, providing an aggregate total of six methods of configuration.
NVIDIA GPUDirect RDMA prerequisites
All methods of NVIDIA GPUDirect RDMA configuration require the installation of specific Operators. Use the following steps to install the Operators:
- Install the Node Feature Discovery Operator.
- Install the SR-IOV Operator.
- Install the NVIDIA Network Operator (NVIDIA documentation).
- Install the NVIDIA GPU Operator (NVIDIA documentation).
Disabling the IRDMA kernel module
On some systems, including the DellR750xa, the IRDMA kernel module creates problems for the NVIDIA Network Operator when unloading and loading the DOCA drivers. Use the following procedure to disable the module.
Procedure
-
Generate the following machine configuration file by running the following command:
$ cat <<EOF > 99-machine-config-blacklist-irdma.yamlExample outputapiVersion: machineconfiguration.openshift.io/v1kind: MachineConfigmetadata:labels:machineconfiguration.openshift.io/role: workername: 99-worker-blacklist-irdmaspec:kernelArguments:- "module_blacklist=irdma" -
Create the machine configuration on the cluster and wait for the nodes to reboot by running the following command:
$ oc create -f 99-machine-config-blacklist-irdma.yamlExample outputmachineconfig.machineconfiguration.openshift.io/99-worker-blacklist-irdma created -
Validate in a debug pod on each node that the module has not loaded by running the following command:
$ oc debug node/nvd-srv-32.nvidia.eng.rdu2.dc.redhat.comStarting pod/nvd-srv-32nvidiaengrdu2dcredhatcom-debug-btfj2 ...To use host binaries, run `chroot /host`Pod IP: 10.6.135.11If you don't see a command prompt, try pressing enter.sh-5.1# chroot /hostsh-5.1# lsmod|grep irdmash-5.1#
Creating persistent naming rules
In some cases, device names won’t persist following a reboot. For example, on R760xa systems Mellanox devices might be renamed after a reboot. You can avoid this problem by using a MachineConfig to set persistence.
Procedure
-
Gather the MAC address names from the worker nodes for the node into a file and provide names for the interfaces that need to persist. This example uses the file
70-persistent-net.rulesand stashes the details in it.$ cat <<EOF > 70-persistent-net.rulesSUBSYSTEM=="net",ACTION=="add",ATTR{address}=="b8:3f:d2:3b:51:28",ATTR{type}=="1",NAME="ibs2f0"SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="b8:3f:d2:3b:51:29",ATTR{type}=="1",NAME="ens8f0np0"SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="b8:3f:d2:f0:36:d0",ATTR{type}=="1",NAME="ibs2f0"SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="b8:3f:d2:f0:36:d1",ATTR{type}=="1",NAME="ens8f0np0"EOF -
Convert that file into a base64 string without line breaks and set the output to the variable
PERSIST:$ PERSIST=`cat 70-persistent-net.rules| base64 -w 0`$ echo $PERSISTU1VCU1lTVEVNPT0ibmV0IixBQ1RJT049PSJhZGQiLEFUVFJ7YWRkcmVzc309PSJiODozZjpkMjozYjo1MToyOCIsQVRUUnt0eXBlfT09IjEiLE5BTUU9ImliczJmMCIKU1VCU1lTVEVNPT0ibmV0IixBQ1RJT049PSJhZGQiLEFUVFJ7YWRkcmVzc309PSJiODozZjpkMjozYjo1MToyOSIsQVRUUnt0eXBlfT09IjEiLE5BTUU9ImVuczhmMG5wMCIKU1VCU1lTVEVNPT0ibmV0IixBQ1RJT049PSJhZGQiLEFUVFJ7YWRkcmVzc309PSJiODozZjpkMjpmMDozNjpkMCIsQVRUUnt0eXBlfT09IjEiLE5BTUU9ImliczJmMCIKU1VCU1lTVEVNPT0ibmV0IixBQ1RJT049PSJhZGQiLEFUVFJ7YWRkcmVzc309PSJiODozZjpkMjpmMDozNjpkMSIsQVRUUnt0eXBlfT09IjEiLE5BTUU9ImVuczhmMG5wMCIK -
Create a machine configuration and set the base64 encoding in the custom resource file by running the following command:
$ cat <<EOF > 99-machine-config-udev-network.yamlapiVersion: machineconfiguration.openshift.io/v1kind: MachineConfigmetadata:labels:machineconfiguration.openshift.io/role: workername: 99-machine-config-udev-networkspec:config:ignition:version: 3.2.0storage:files:- contents:source: data:text/plain;base64,$PERSISTfilesystem: rootmode: 420path: /etc/udev/rules.d/70-persistent-net.rules -
Create the machine configuration on the cluster by running the following command. After running the command, the expected output shows
machineconfig.machineconfiguration.openshift.io/99-machine-config-udev-network created.$ oc create -f 99-machine-config-udev-network.yaml -
Use the
get mcpcommand to view the machine configuration status:$ oc get mcpExample outputNAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGEmaster rendered-master-9adfe851c2c14d9598eea5ec3df6c187 True False False 1 1 1 0 6h21mworker rendered-worker-4568f1b174066b4b1a4de794cf538fee False True False 2 0 0 0 6h21m
The nodes will reboot and when the updating field returns to false, you can validate on the nodes by looking at the devices in a debug pod.
Configuring the NFD Operator
The Node Feature Discovery (NFD) Operator manages the detection of hardware features and configuration in an OpenShift Container Platform cluster by labeling the nodes with hardware-specific information. NFD labels the host with node-specific attributes, such as PCI cards, kernel, operating system version, and so on.
Prerequisites
- You have installed the NFD Operator.
.Procedure 1. Validate that the Operator is installed and running by looking at the pods in the openshift-nfd namespace by running the following command: terminal $ oc get pods -n openshift-nfd terminal title="Example output" NAME READY STATUS RESTARTS AGE nfd-controller-manager-8698c88cdd-t8gbc 2/2 Running 0 2m 1. With the NFD controller running, generate the NodeFeatureDiscovery instance and add it to the cluster.
The `ClusterServiceVersion` specification for NFD Operator provides default values, including the NFD operand image that is part of the Operator payload. Retrieve its value by running the following command:
```terminal
$ NFD_OPERAND_IMAGE=`echo $(oc get csv -n openshift-nfd -o json | jq -r '.items[0].metadata.annotations["alm-examples"]') | jq -r '.[] | select(.kind == "NodeFeatureDiscovery") | .spec.operand.image'`
```
1. Optional: Add entries to the default `deviceClassWhiteList` field, to support more network adapters, such as the NVIDIA BlueField DPUs.
```terminal
apiVersion: nfd.openshift.io/v1
kind: NodeFeatureDiscovery
metadata:
name: nfd-instance
namespace: openshift-nfd
spec:
instance: ''
operand:
image: '${NFD_OPERAND_IMAGE}'
servicePort: 12000
prunerOnDelete: false
topologyUpdater: false
workerConfig:
configData: |
core:
sleepInterval: 60s
sources:
pci:
deviceClassWhitelist:
- "02"
- "03"
- "0200"
- "0207"
- "12"
deviceLabelFields:
- "vendor"
```
1. Create the 'NodeFeatureDiscovery` instance by running the following command:
```terminal
$ oc create -f nfd-instance.yaml
```
```terminal title="Example output"
nodefeaturediscovery.nfd.openshift.io/nfd-instance created
```
1. Validate that the instance is up and running by looking at the pods under the `openshift-nfd` namespace by running the following command:
```terminal
$ oc get pods -n openshift-nfd
```
```terminal title="Example output"
NAME READY STATUS RESTARTS AGE
nfd-controller-manager-7cb6d656-jcnqb 2/2 Running 0 4m
nfd-gc-7576d64889-s28k9 1/1 Running 0 21s
nfd-master-b7bcf5cfd-qnrmz 1/1 Running 0 21s
nfd-worker-96pfh 1/1 Running 0 21s
nfd-worker-b2gkg 1/1 Running 0 21s
nfd-worker-bd9bk 1/1 Running 0 21s
nfd-worker-cswf4 1/1 Running 0 21s
nfd-worker-kp6gg 1/1 Running 0 21s
```
1. Wait a short period of time and then verify that NFD has added labels to the node. The NFD labels are prefixed with `feature.node.kubernetes.io`, so you can easily filter them.
```terminal
$ oc get node -o json | jq '.items[0].metadata.labels | with_entries(select(.key | startswith("feature.node.kubernetes.io")))'
{
"feature.node.kubernetes.io/cpu-cpuid.ADX": "true",
"feature.node.kubernetes.io/cpu-cpuid.AESNI": "true",
"feature.node.kubernetes.io/cpu-cpuid.AVX": "true",
"feature.node.kubernetes.io/cpu-cpuid.AVX2": "true",
"feature.node.kubernetes.io/cpu-cpuid.CETSS": "true",
"feature.node.kubernetes.io/cpu-cpuid.CLZERO": "true",
"feature.node.kubernetes.io/cpu-cpuid.CMPXCHG8": "true",
"feature.node.kubernetes.io/cpu-cpuid.CPBOOST": "true",
"feature.node.kubernetes.io/cpu-cpuid.EFER_LMSLE_UNS": "true",
"feature.node.kubernetes.io/cpu-cpuid.FMA3": "true",
"feature.node.kubernetes.io/cpu-cpuid.FP256": "true",
"feature.node.kubernetes.io/cpu-cpuid.FSRM": "true",
"feature.node.kubernetes.io/cpu-cpuid.FXSR": "true",
"feature.node.kubernetes.io/cpu-cpuid.FXSROPT": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBPB": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBRS": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBRS_PREFERRED": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBRS_PROVIDES_SMP": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBS": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBSBRNTRGT": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBSFETCHSAM": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBSFFV": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBSOPCNT": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBSOPCNTEXT": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBSOPSAM": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBSRDWROPCNT": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBSRIPINVALIDCHK": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBS_FETCH_CTLX": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBS_OPFUSE": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBS_PREVENTHOST": "true",
"feature.node.kubernetes.io/cpu-cpuid.INT_WBINVD": "true",
"feature.node.kubernetes.io/cpu-cpuid.INVLPGB": "true",
"feature.node.kubernetes.io/cpu-cpuid.LAHF": "true",
"feature.node.kubernetes.io/cpu-cpuid.LBRVIRT": "true",
"feature.node.kubernetes.io/cpu-cpuid.MCAOVERFLOW": "true",
"feature.node.kubernetes.io/cpu-cpuid.MCOMMIT": "true",
"feature.node.kubernetes.io/cpu-cpuid.MOVBE": "true",
"feature.node.kubernetes.io/cpu-cpuid.MOVU": "true",
"feature.node.kubernetes.io/cpu-cpuid.MSRIRC": "true",
"feature.node.kubernetes.io/cpu-cpuid.MSR_PAGEFLUSH": "true",
"feature.node.kubernetes.io/cpu-cpuid.NRIPS": "true",
"feature.node.kubernetes.io/cpu-cpuid.OSXSAVE": "true",
"feature.node.kubernetes.io/cpu-cpuid.PPIN": "true",
"feature.node.kubernetes.io/cpu-cpuid.PSFD": "true",
"feature.node.kubernetes.io/cpu-cpuid.RDPRU": "true",
"feature.node.kubernetes.io/cpu-cpuid.SEV": "true",
"feature.node.kubernetes.io/cpu-cpuid.SEV_64BIT": "true",
"feature.node.kubernetes.io/cpu-cpuid.SEV_ALTERNATIVE": "true",
"feature.node.kubernetes.io/cpu-cpuid.SEV_DEBUGSWAP": "true",
"feature.node.kubernetes.io/cpu-cpuid.SEV_ES": "true",
"feature.node.kubernetes.io/cpu-cpuid.SEV_RESTRICTED": "true",
"feature.node.kubernetes.io/cpu-cpuid.SEV_SNP": "true",
"feature.node.kubernetes.io/cpu-cpuid.SHA": "true",
"feature.node.kubernetes.io/cpu-cpuid.SME": "true",
"feature.node.kubernetes.io/cpu-cpuid.SME_COHERENT": "true",
"feature.node.kubernetes.io/cpu-cpuid.SPEC_CTRL_SSBD": "true",
"feature.node.kubernetes.io/cpu-cpuid.SSE4A": "true",
"feature.node.kubernetes.io/cpu-cpuid.STIBP": "true",
"feature.node.kubernetes.io/cpu-cpuid.STIBP_ALWAYSON": "true",
"feature.node.kubernetes.io/cpu-cpuid.SUCCOR": "true",
"feature.node.kubernetes.io/cpu-cpuid.SVM": "true",
"feature.node.kubernetes.io/cpu-cpuid.SVMDA": "true",
"feature.node.kubernetes.io/cpu-cpuid.SVMFBASID": "true",
"feature.node.kubernetes.io/cpu-cpuid.SVML": "true",
"feature.node.kubernetes.io/cpu-cpuid.SVMNP": "true",
"feature.node.kubernetes.io/cpu-cpuid.SVMPF": "true",
"feature.node.kubernetes.io/cpu-cpuid.SVMPFT": "true",
"feature.node.kubernetes.io/cpu-cpuid.SYSCALL": "true",
"feature.node.kubernetes.io/cpu-cpuid.SYSEE": "true",
"feature.node.kubernetes.io/cpu-cpuid.TLB_FLUSH_NESTED": "true",
"feature.node.kubernetes.io/cpu-cpuid.TOPEXT": "true",
"feature.node.kubernetes.io/cpu-cpuid.TSCRATEMSR": "true",
"feature.node.kubernetes.io/cpu-cpuid.VAES": "true",
"feature.node.kubernetes.io/cpu-cpuid.VMCBCLEAN": "true",
"feature.node.kubernetes.io/cpu-cpuid.VMPL": "true",
"feature.node.kubernetes.io/cpu-cpuid.VMSA_REGPROT": "true",
"feature.node.kubernetes.io/cpu-cpuid.VPCLMULQDQ": "true",
"feature.node.kubernetes.io/cpu-cpuid.VTE": "true",
"feature.node.kubernetes.io/cpu-cpuid.WBNOINVD": "true",
"feature.node.kubernetes.io/cpu-cpuid.X87": "true",
"feature.node.kubernetes.io/cpu-cpuid.XGETBV1": "true",
"feature.node.kubernetes.io/cpu-cpuid.XSAVE": "true",
"feature.node.kubernetes.io/cpu-cpuid.XSAVEC": "true",
"feature.node.kubernetes.io/cpu-cpuid.XSAVEOPT": "true",
"feature.node.kubernetes.io/cpu-cpuid.XSAVES": "true",
"feature.node.kubernetes.io/cpu-hardware_multithreading": "false",
"feature.node.kubernetes.io/cpu-model.family": "25",
"feature.node.kubernetes.io/cpu-model.id": "1",
"feature.node.kubernetes.io/cpu-model.vendor_id": "AMD",
"feature.node.kubernetes.io/kernel-config.NO_HZ": "true",
"feature.node.kubernetes.io/kernel-config.NO_HZ_FULL": "true",
"feature.node.kubernetes.io/kernel-selinux.enabled": "true",
"feature.node.kubernetes.io/kernel-version.full": "5.14.0-427.35.1.el9_4.x86_64",
"feature.node.kubernetes.io/kernel-version.major": "5",
"feature.node.kubernetes.io/kernel-version.minor": "14",
"feature.node.kubernetes.io/kernel-version.revision": "0",
"feature.node.kubernetes.io/memory-numa": "true",
"feature.node.kubernetes.io/network-sriov.capable": "true",
"feature.node.kubernetes.io/pci-102b.present": "true",
"feature.node.kubernetes.io/pci-10de.present": "true",
"feature.node.kubernetes.io/pci-10de.sriov.capable": "true",
"feature.node.kubernetes.io/pci-15b3.present": "true",
"feature.node.kubernetes.io/pci-15b3.sriov.capable": "true",
"feature.node.kubernetes.io/rdma.available": "true",
"feature.node.kubernetes.io/rdma.capable": "true",
"feature.node.kubernetes.io/storage-nonrotationaldisk": "true",
"feature.node.kubernetes.io/system-os_release.ID": "rhcos",
"feature.node.kubernetes.io/system-os_release.OPENSHIFT_VERSION": "4.17",
"feature.node.kubernetes.io/system-os_release.OSTREE_VERSION": "417.94.202409121747-0",
"feature.node.kubernetes.io/system-os_release.RHEL_VERSION": "9.4",
"feature.node.kubernetes.io/system-os_release.VERSION_ID": "4.17",
"feature.node.kubernetes.io/system-os_release.VERSION_ID.major": "4",
"feature.node.kubernetes.io/system-os_release.VERSION_ID.minor": "17"
}
```
1. Confirm there is a network device that is discovered:
```terminal
$ oc describe node | grep -E 'Roles|pci' | grep pci-15b3
feature.node.kubernetes.io/pci-15b3.present=true
feature.node.kubernetes.io/pci-15b3.sriov.capable=true
feature.node.kubernetes.io/pci-15b3.present=true
feature.node.kubernetes.io/pci-15b3.sriov.capable=true
```
Configuring the SR-IOV Operator
Single root I/O virtualization (SR-IOV) enhances the performance of NVIDIA GPUDirect RDMA by providing sharing across multiple pods from a single device.
Prerequisites
- You have installed the SR-IOV Operator.
Procedure
-
Validate that the Operator is installed and running by looking at the pods in the
openshift-sriov-network-operatornamespace by running the following command:$ oc get pods -n openshift-sriov-network-operatorExample outputNAME READY STATUS RESTARTS AGEsriov-network-operator-7cb6c49868-89486 1/1 Running 0 22s -
For the default
SriovOperatorConfigCR to work with the MLNX_OFED container, run this command to update the following values:apiVersion: sriovnetwork.openshift.io/v1kind: SriovOperatorConfigmetadata:name: defaultnamespace: openshift-sriov-network-operatorspec:enableInjector: trueenableOperatorWebhook: truelogLevel: 2 -
Create the resource on the cluster by running the following command:
$ oc create -f sriov-operator-config.yamlExample outputsriovoperatorconfig.sriovnetwork.openshift.io/default created -
Patch the sriov-operator so the MOFED container can work with it by running the following command:
$ oc patch sriovoperatorconfig default --type=merge -n openshift-sriov-network-operator --patch '{ "spec": { "configDaemonNodeSelector": { "network.nvidia.com/operator.mofed.wait": "false", "node-role.kubernetes.io/worker": "", "feature.node.kubernetes.io/pci-15b3.sriov.capable": "true" } } }'Example outputsriovoperatorconfig.sriovnetwork.openshift.io/default patched
Configuring the NVIDIA network Operator
The NVIDIA network Operator manages NVIDIA networking resources and networking related components such as drivers and device plugins to enable NVIDIA GPUDirect RDMA workloads.
Prerequisites
- You have installed the NVIDIA network Operator.
Procedure
-
Validate that the network Operator is installed and running by confirming the controller is running in the
nvidia-network-operatornamespace by running the following command:$ oc get pods -n nvidia-network-operatorExample outputNAME READY STATUS RESTARTS AGEnvidia-network-operator-controller-manager-6f7d6956cd-fw5wg 1/1 Running 0 5m -
With the Operator running, create the
NicClusterPolicycustom resource file. The device you choose depends on your system configuration. In this example, the Infiniband interfaceibs2f0is hard coded and is used as the shared NVIDIA GPUDirect RDMA device.apiVersion: mellanox.com/v1alpha1kind: NicClusterPolicymetadata:name: nic-cluster-policyspec:nicFeatureDiscovery:image: nic-feature-discoveryrepository: ghcr.io/mellanoxversion: v0.0.1docaTelemetryService:image: doca_telemetryrepository: nvcr.io/nvidia/docaversion: 1.16.5-doca2.6.0-hostrdmaSharedDevicePlugin:config: |{"configList": [{"resourceName": "rdma_shared_device_ib","rdmaHcaMax": 63,"selectors": {"ifNames": ["ibs2f0"]}},{"resourceName": "rdma_shared_device_eth","rdmaHcaMax": 63,"selectors": {"ifNames": ["ens8f0np0"]}}]}image: k8s-rdma-shared-dev-pluginrepository: ghcr.io/mellanoxversion: v1.5.1secondaryNetwork:ipoib:image: ipoib-cnirepository: ghcr.io/mellanoxversion: v1.2.0nvIpam:enableWebhook: falseimage: nvidia-k8s-ipamrepository: ghcr.io/mellanoxversion: v0.2.0ofedDriver:readinessProbe:initialDelaySeconds: 10periodSeconds: 30forcePrecompiled: falseterminationGracePeriodSeconds: 300livenessProbe:initialDelaySeconds: 30periodSeconds: 30upgradePolicy:autoUpgrade: truedrain:deleteEmptyDir: trueenable: trueforce: truetimeoutSeconds: 300podSelector: ''maxParallelUpgrades: 1safeLoad: falsewaitForCompletion:timeoutSeconds: 0startupProbe:initialDelaySeconds: 10periodSeconds: 20image: doca-driverrepository: nvcr.io/nvidia/mellanoxversion: 24.10-0.7.0.0-0env:- name: UNLOAD_STORAGE_MODULESvalue: "true"- name: RESTORE_DRIVER_ON_POD_TERMINATIONvalue: "true"- name: CREATE_IFNAMES_UDEVvalue: "true" -
Create the
NicClusterPolicycustom resource on the cluster by running the following command:$ oc create -f network-sharedrdma-nic-cluster-policy.yamlExample outputnicclusterpolicy.mellanox.com/nic-cluster-policy created -
Validate the
NicClusterPolicyby running the following command in the DOCA/MOFED container:$ oc get pods -n nvidia-network-operatorExample outputNAME READY STATUS RESTARTS AGEdoca-telemetry-service-hwj65 1/1 Running 2 160mkube-ipoib-cni-ds-fsn8g 1/1 Running 2 160mmofed-rhcos4.16-9b5ddf4c6-ds-ct2h5 2/2 Running 4 160mnic-feature-discovery-ds-dtksz 1/1 Running 2 160mnv-ipam-controller-854585f594-c5jpp 1/1 Running 2 160mnv-ipam-controller-854585f594-xrnp5 1/1 Running 2 160mnv-ipam-node-xqttl 1/1 Running 2 160mnvidia-network-operator-controller-manager-5798b564cd-5cq99 1/1 Running 2 5d23hrdma-shared-dp-ds-p9vvg 1/1 Running 0 85m -
rshinto themofedcontainer to check the status by running the following command:$ MOFED_POD=$(oc get pods -n nvidia-network-operator -o name | grep mofed)$ oc rsh -n nvidia-network-operator -c mofed-container ${MOFED_POD}sh-5.1# ofed_info -sExample outputOFED-internal-24.07-0.6.1:sh-5.1# ibdev2netdev -vExample output0000:0d:00.0 mlx5_0 (MT41692 - 900-9D3B4-00EN-EA0) BlueField-3 E-series SuperNIC 400GbE/NDR single port QSFP112, PCIe Gen5.0 x16 FHHL, Crypto Enabled, 16GB DDR5, BMC, Tall Bracket fw 32.42.1000 port 1 (ACTIVE) ==> ibs2f0 (Up)0000:a0:00.0 mlx5_1 (MT41692 - 900-9D3B4-00EN-EA0) BlueField-3 E-series SuperNIC 400GbE/NDR single port QSFP112, PCIe Gen5.0 x16 FHHL, Crypto Enabled, 16GB DDR5, BMC, Tall Bracket fw 32.42.1000 port 1 (ACTIVE) ==> ens8f0np0 (Up) -
Create a
IPoIBNetworkcustom resource file:apiVersion: mellanox.com/v1alpha1kind: IPoIBNetworkmetadata:name: example-ipoibnetworkspec:ipam: |{"type": "whereabouts","range": "192.168.6.225/28","exclude": ["192.168.6.229/30","192.168.6.236/32"]}master: ibs2f0networkNamespace: default -
Create the
IPoIBNetworkresource on the cluster by running the following command:$ oc create -f ipoib-network.yamlExample outputipoibnetwork.mellanox.com/example-ipoibnetwork created -
Create a
MacvlanNetworkcustom resource file for your other interface:apiVersion: mellanox.com/v1alpha1kind: MacvlanNetworkmetadata:name: rdmashared-netspec:networkNamespace: defaultmaster: ens8f0np0mode: bridgemtu: 1500ipam: '{"type": "whereabouts", "range": "192.168.2.0/24", "gateway": "192.168.2.1"}' -
Create the resource on the cluster by running the following command:
$ oc create -f macvlan-network.yamlExample outputmacvlannetwork.mellanox.com/rdmashared-net created
Configuring the GPU Operator
The GPU Operator automates the management of the NVIDIA drivers, device plugins for GPUs, the NVIDIA Container Toolkit, and other components required for GPU provisioning.
Prerequisites
- You have installed the GPU Operator.
Procedure
-
Check that the Operator pod is running to look at the pods under the namespace by running the following command:
$ oc get pods -n nvidia-gpu-operatorExample outputNAME READY STATUS RESTARTS AGEgpu-operator-b4cb7d74-zxpwq 1/1 Running 0 32s -
Create a GPU cluster policy custom resource file similar to the following example:
apiVersion: nvidia.com/v1kind: ClusterPolicymetadata:name: gpu-cluster-policyspec:vgpuDeviceManager:enabled: truemigManager:config:default: all-disabledname: default-mig-parted-configenabled: trueoperator:defaultRuntime: crioinitContainer: {}runtimeClass: nvidiause_ocp_driver_toolkit: truedcgm:enabled: truegfd:enabled: truedcgmExporter:config:name: ''serviceMonitor:enabled: trueenabled: truecdi:default: falseenabled: falsedriver:licensingConfig:nlsEnabled: trueconfigMapName: ''certConfig:name: ''rdma:enabled: falsekernelModuleConfig:name: ''upgradePolicy:autoUpgrade: truedrain:deleteEmptyDir: falseenable: falseforce: falsetimeoutSeconds: 300maxParallelUpgrades: 1maxUnavailable: 25%podDeletion:deleteEmptyDir: falseforce: falsetimeoutSeconds: 300waitForCompletion:timeoutSeconds: 0repoConfig:configMapName: ''virtualTopology:config: ''enabled: trueuseNvidiaDriverCRD: falseuseOpenKernelModules: truedevicePlugin:config:name: ''default: ''mps:root: /run/nvidia/mpsenabled: truegdrcopy:enabled: truekataManager:config:artifactsDir: /opt/nvidia-gpu-operator/artifacts/runtimeclassesmig:strategy: singlesandboxDevicePlugin:enabled: truevalidator:plugin:env:- name: WITH_WORKLOADvalue: 'false'nodeStatusExporter:enabled: truedaemonsets:rollingUpdate:maxUnavailable: '1'updateStrategy: RollingUpdatesandboxWorkloads:defaultWorkload: containerenabled: falsegds:enabled: trueimage: nvidia-fsversion: 2.20.5repository: nvcr.io/nvidia/cloud-nativevgpuManager:enabled: falsevfioManager:enabled: truetoolkit:installDir: /usr/local/nvidiaenabled: true -
When the GPU
ClusterPolicycustom resource has generated, create the resource on the cluster by running the following command:$ oc create -f gpu-cluster-policy.yamlExample outputclusterpolicy.nvidia.com/gpu-cluster-policy created -
Validate that the Operator is installed and running by running the following command:
$ oc get pods -n nvidia-gpu-operatorExample outputNAME READY STATUS RESTARTS AGEgpu-feature-discovery-d5ngn 1/1 Running 0 3m20sgpu-feature-discovery-z42rx 1/1 Running 0 3m23sgpu-operator-6bb4d4b4c5-njh78 1/1 Running 0 4m35snvidia-container-toolkit-daemonset-bkh8l 1/1 Running 0 3m20snvidia-container-toolkit-daemonset-c4hzm 1/1 Running 0 3m23snvidia-cuda-validator-4blvg 0/1 Completed 0 106snvidia-cuda-validator-tw8sl 0/1 Completed 0 112snvidia-dcgm-exporter-rrw4g 1/1 Running 0 3m20snvidia-dcgm-exporter-xc78t 1/1 Running 0 3m23snvidia-dcgm-nvxpf 1/1 Running 0 3m20snvidia-dcgm-snj4j 1/1 Running 0 3m23snvidia-device-plugin-daemonset-fk2xz 1/1 Running 0 3m23snvidia-device-plugin-daemonset-wq87j 1/1 Running 0 3m20snvidia-driver-daemonset-416.94.202410211619-0-ngrjg 4/4 Running 0 3m58snvidia-driver-daemonset-416.94.202410211619-0-tm4x6 4/4 Running 0 3m58snvidia-node-status-exporter-jlzxh 1/1 Running 0 3m57snvidia-node-status-exporter-zjffs 1/1 Running 0 3m57snvidia-operator-validator-l49hx 1/1 Running 0 3m20snvidia-operator-validator-n44nn 1/1 Running 0 3m23s -
Optional: When you have verified the pods are running, remote shell into the NVIDIA driver daemonset pod and confirm that the NVIDIA modules are loaded. Specifically, ensure the
nvidia_peermemis loaded.$ oc rsh -n nvidia-gpu-operator $(oc -n nvidia-gpu-operator get pod -o name -l app.kubernetes.io/component=nvidia-driver)sh-4.4# lsmod|grep nvidiaExample outputnvidia_fs 327680 0nvidia_peermem 24576 0nvidia_modeset 1507328 0video 73728 1 nvidia_modesetnvidia_uvm 6889472 8nvidia 8810496 43 nvidia_uvm,nvidia_peermem,nvidia_fs,gdrdrv,nvidia_modesetib_uverbs 217088 3 nvidia_peermem,rdma_ucm,mlx5_ibdrm 741376 5 drm_kms_helper,drm_shmem_helper,nvidia,mgag200 -
Optional: Run the
nvidia-smiutility to show the details about the driver and the hardware:
sh-4.4# nvidia-smi
```terminal title="Example output"
Wed Nov 6 22:03:53 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.90.07 Driver Version: 550.90.07 CUDA Version: 12.4 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA A40 On | 00000000:61:00.0 Off | 0 |
| 0% 37C P0 88W / 300W | 1MiB / 46068MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
| 1 NVIDIA A40 On | 00000000:E1:00.0 Off | 0 |
| 0% 28C P8 29W / 300W | 1MiB / 46068MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| No running processes found |
+-----------------------------------------------------------------------------------------+
```
-
While you are still in the driver pod, set the GPU clock to maximum using the
nvidia-smicommand:$ oc rsh -n nvidia-gpu-operator nvidia-driver-daemonset-416.94.202410172137-0-ndhzcsh-4.4# nvidia-smi -i 0 -lgc $(nvidia-smi -i 0 --query-supported-clocks=graphics --format=csv,noheader,nounits | sort -h | tail -n 1)Example outputGPU clocks set to "(gpuClkMin 1740, gpuClkMax 1740)" for GPU 00000000:61:00.0All done.sh-4.4# nvidia-smi -i 1 -lgc $(nvidia-smi -i 1 --query-supported-clocks=graphics --format=csv,noheader,nounits | sort -h | tail -n 1)Example outputGPU clocks set to "(gpuClkMin 1740, gpuClkMax 1740)" for GPU 00000000:E1:00.0All done. -
Validate the resource is available from a node describe perspective by running the following command:
$ oc describe node -l node-role.kubernetes.io/worker=| grep -E 'Capacity:|Allocatable:' -A9Example outputCapacity:cpu: 128ephemeral-storage: 1561525616Kihugepages-1Gi: 0hugepages-2Mi: 0memory: 263596712Kinvidia.com/gpu: 2pods: 250rdma/rdma_shared_device_eth: 63rdma/rdma_shared_device_ib: 63Allocatable:cpu: 127500mephemeral-storage: 1438028263499hugepages-1Gi: 0hugepages-2Mi: 0memory: 262445736Kinvidia.com/gpu: 2pods: 250rdma/rdma_shared_device_eth: 63rdma/rdma_shared_device_ib: 63--Capacity:cpu: 128ephemeral-storage: 1561525616Kihugepages-1Gi: 0hugepages-2Mi: 0memory: 263596672Kinvidia.com/gpu: 2pods: 250rdma/rdma_shared_device_eth: 63rdma/rdma_shared_device_ib: 63Allocatable:cpu: 127500mephemeral-storage: 1438028263499hugepages-1Gi: 0hugepages-2Mi: 0memory: 262445696Kinvidia.com/gpu: 2pods: 250rdma/rdma_shared_device_eth: 63rdma/rdma_shared_device_ib: 63
Creating the machine configuration
Before you create the resource pods, you need to create the machineconfig.yaml custom resource (CR) that provides access to the GPU and networking resources without the need for user privileges.
Procedure
- Generate a
MachineconfigCR:apiVersion: machineconfiguration.openshift.io/v1kind: MachineConfigmetadata:labels:machineconfiguration.openshift.io/role: workername: 02-worker-container-runtimespec:config:ignition:version: 3.2.0storage:files:- contents:source: data:text/plain;charset=utf-8;base64,W2NyaW8ucnVudGltZV0KZGVmYXVsdF91bGltaXRzID0gWwoibWVtbG9jaz0tMTotMSIKXQo=mode: 420overwrite: truepath: /etc/crio/crio.conf.d/10-custom
Creating the workload pods
Use the procedures in this section to create the workload pods for the shared and host devices.
Creating a shared device RDMA on RoCE
Create the workload pods for a shared device RDMA on RDMA over Converged Ethernet (RoCE) for the NVIDIA Network Operator and test the pod configuration.
The NVIDIA GPUDirect RDMA device is shared among pods on the OpenShift Container Platform worker node where the device is exposed.
Prerequisites
- Ensure that the Operator is running.
- Delete the
NicClusterPolicycustom resource (CR), if it exists.
Procedure
-
Generate custom pod resources:
$ cat <<EOF > rdma-eth-32-workload.yamlapiVersion: v1kind: Podmetadata:name: rdma-eth-32-workloadnamespace: defaultannotations:k8s.v1.cni.cncf.io/networks: rdmashared-netspec:nodeSelector:kubernetes.io/hostname: nvd-srv-32.nvidia.eng.rdu2.dc.redhat.comcontainers:- image: quay.io/edge-infrastructure/nvidia-tools:0.1.5name: rdma-eth-32-workloadresources:limits:nvidia.com/gpu: 1rdma/rdma_shared_device_eth: 1requests:nvidia.com/gpu: 1rdma/rdma_shared_device_eth: 1EOF$ cat <<EOF > rdma-eth-33-workload.yamlapiVersion: v1kind: Podmetadata:name: rdma-eth-33-workloadnamespace: defaultannotations:k8s.v1.cni.cncf.io/networks: rdmashared-netspec:nodeSelector:kubernetes.io/hostname: nvd-srv-33.nvidia.eng.rdu2.dc.redhat.comcontainers:- image: quay.io/edge-infrastructure/nvidia-tools:0.1.5name: rdma-eth-33-workloadsecurityContext:capabilities:add: [ "IPC_LOCK" ]resources:limits:nvidia.com/gpu: 1rdma/rdma_shared_device_eth: 1requests:nvidia.com/gpu: 1rdma/rdma_shared_device_eth: 1EOF -
Create the pods on the cluster by using the following commands:
$ oc create -f rdma-eth-32-workload.yamlExample outputpod/rdma-eth-32-workload created$ oc create -f rdma-eth-33-workload.yamlExample outputpod/rdma-eth-33-workload created -
Verify that the pods are running by using the following command:
$ oc get pods -n defaultExample outputNAME READY STATUS RESTARTS AGErdma-eth-32-workload 1/1 Running 0 25srdma-eth-33-workload 1/1 Running 0 22s
Creating a host device RDMA on RoCE
Create the workload pods for a host device Remote Direct Memory Access (RDMA) for the NVIDIA Network Operator and test the pod configuration.
Prerequisites
- Ensure that the Operator is running.
- Delete the
NicClusterPolicycustom resource (CR), if it exists.
Procedure
-
Generate a new host device
NicClusterPolicy(CR), as shown below:$ cat <<EOF > network-hostdev-nic-cluster-policy.yamlapiVersion: mellanox.com/v1alpha1kind: NicClusterPolicymetadata:name: nic-cluster-policyspec:ofedDriver:image: doca-driverrepository: nvcr.io/nvidia/mellanoxversion: 24.10-0.7.0.0-0startupProbe:initialDelaySeconds: 10periodSeconds: 20livenessProbe:initialDelaySeconds: 30periodSeconds: 30readinessProbe:initialDelaySeconds: 10periodSeconds: 30env:- name: UNLOAD_STORAGE_MODULESvalue: "true"- name: RESTORE_DRIVER_ON_POD_TERMINATIONvalue: "true"- name: CREATE_IFNAMES_UDEVvalue: "true"sriovDevicePlugin:image: sriov-network-device-pluginrepository: ghcr.io/k8snetworkplumbingwgversion: v3.7.0config: |{"resourceList": [{"resourcePrefix": "nvidia.com","resourceName": "hostdev","selectors": {"vendors": ["15b3"],"isRdma": true}}]}EOF -
Create the
NicClusterPolicyCR on the cluster by using the following command:$ oc create -f network-hostdev-nic-cluster-policy.yamlExample outputnicclusterpolicy.mellanox.com/nic-cluster-policy created -
Verify that the host device
NicClusterPolicyCR by using the following command in the DOCA/MOFED container:$ oc get pods -n nvidia-network-operatorExample outputNAME READY STATUS RESTARTS AGEmofed-rhcos4.16-696886fcb4-ds-9sgvd 2/2 Running 0 2m37smofed-rhcos4.16-696886fcb4-ds-lkjd4 2/2 Running 0 2m37snvidia-network-operator-controller-manager-68d547dbbd-qsdkf 1/1 Running 0 141msriov-device-plugin-6v2nz 1/1 Running 0 2m14ssriov-device-plugin-hc4t8 1/1 Running 0 2m14s -
Confirm that the resources appear in the cluster
oc describe nodesection by using the following command:$ oc describe node -l node-role.kubernetes.io/worker=| grep -E 'Capacity:|Allocatable:' -A7Example outputCapacity:cpu: 128ephemeral-storage: 1561525616Kihugepages-1Gi: 0hugepages-2Mi: 0memory: 263596708Kinvidia.com/hostdev: 2pods: 250Allocatable:cpu: 127500mephemeral-storage: 1438028263499hugepages-1Gi: 0hugepages-2Mi: 0memory: 262445732Kinvidia.com/hostdev: 2pods: 250--Capacity:cpu: 128ephemeral-storage: 1561525616Kihugepages-1Gi: 0hugepages-2Mi: 0memory: 263596704Kinvidia.com/hostdev: 2pods: 250Allocatable:cpu: 127500mephemeral-storage: 1438028263499hugepages-1Gi: 0hugepages-2Mi: 0memory: 262445728Kinvidia.com/hostdev: 2pods: 250 -
Create a
HostDeviceNetworkCR file:$ cat <<EOF > hostdev-network.yamlapiVersion: mellanox.com/v1alpha1kind: HostDeviceNetworkmetadata:name: hostdev-netspec:networkNamespace: "default"resourceName: "hostdev"ipam: |{"type": "whereabouts","range": "192.168.3.225/28","exclude": ["192.168.3.229/30","192.168.3.236/32"]}EOF -
Create the
HostDeviceNetworkresource on the cluster by using the following command:$ oc create -f hostdev-network.yamlExample outputhostdevicenetwork.mellanox.com/hostdev-net created -
Confirm that the resources appear in the cluster
oc describe nodesection by using the following command:$ oc describe node -l node-role.kubernetes.io/worker=| grep -E 'Capacity:|Allocatable:' -A8Example outputCapacity:cpu: 128ephemeral-storage: 1561525616Kihugepages-1Gi: 0hugepages-2Mi: 0memory: 263596708Kinvidia.com/gpu: 2nvidia.com/hostdev: 2pods: 250Allocatable:cpu: 127500mephemeral-storage: 1438028263499hugepages-1Gi: 0hugepages-2Mi: 0memory: 262445732Kinvidia.com/gpu: 2nvidia.com/hostdev: 2pods: 250--Capacity:cpu: 128ephemeral-storage: 1561525616Kihugepages-1Gi: 0hugepages-2Mi: 0memory: 263596680Kinvidia.com/gpu: 2nvidia.com/hostdev: 2pods: 250Allocatable:cpu: 127500mephemeral-storage: 1438028263499hugepages-1Gi: 0hugepages-2Mi: 0memory: 262445704Kinvidia.com/gpu: 2nvidia.com/hostdev: 2pods: 250
Creating a SR-IOV legacy mode RDMA on RoCE
Configure a Single Root I/O Virtualization (SR-IOV) legacy mode host device RDMA on RoCE.
Procedure
-
Generate a new host device
NicClusterPolicycustom resource (CR):$ cat <<EOF > network-sriovleg-nic-cluster-policy.yamlapiVersion: mellanox.com/v1alpha1kind: NicClusterPolicymetadata:name: nic-cluster-policyspec:ofedDriver:image: doca-driverrepository: nvcr.io/nvidia/mellanoxversion: 24.10-0.7.0.0-0startupProbe:initialDelaySeconds: 10periodSeconds: 20livenessProbe:initialDelaySeconds: 30periodSeconds: 30readinessProbe:initialDelaySeconds: 10periodSeconds: 30env:- name: UNLOAD_STORAGE_MODULESvalue: "true"- name: RESTORE_DRIVER_ON_POD_TERMINATIONvalue: "true"- name: CREATE_IFNAMES_UDEVvalue: "true"EOF -
Create the policy on the cluster by using the following command:
$ oc create -f network-sriovleg-nic-cluster-policy.yamlExample outputnicclusterpolicy.mellanox.com/nic-cluster-policy created -
Verify the pods by using the following command in the DOCA/MOFED container:
$ oc get pods -n nvidia-network-operatorExample outputNAME READY STATUS RESTARTS AGEmofed-rhcos4.16-696886fcb4-ds-4mb42 2/2 Running 0 40smofed-rhcos4.16-696886fcb4-ds-8knwq 2/2 Running 0 40snvidia-network-operator-controller-manager-68d547dbbd-qsdkf 1/1 Running 13 (4d ago) 4d21h -
Create an
SriovNetworkNodePolicyCR that generates the Virtual Functions (VFs) for the device you want to operate in SR-IOV legacy mode. See the following example:$ cat <<EOF > sriov-network-node-policy.yamlapiVersion: sriovnetwork.openshift.io/v1kind: SriovNetworkNodePolicymetadata:name: sriov-legacy-policynamespace: openshift-sriov-network-operatorspec:deviceType: netdevicemtu: 1500nicSelector:vendor: "15b3"pfNames: ["ens8f0np0#0-7"]nodeSelector:feature.node.kubernetes.io/pci-15b3.present: "true"numVfs: 8priority: 90isRdma: trueresourceName: sriovlegacyEOF -
Create the CR on the cluster by using the following command:
noteEnsure that SR-IOV Global Enable is enabled. For more information, see Unable to enable SR-IOV and receiving the message "not enough MMIO resources for SR-IOV" in Red Hat Enterprise Linux.
$ oc create -f sriov-network-node-policy.yamlExample outputsriovnetworknodepolicy.sriovnetwork.openshift.io/sriov-legacy-policy created -
Each node has scheduling disabled. The nodes reboot to apply the configuration. You can view the nodes by using the following command:
$ oc get nodesExample outputNAME STATUS ROLES AGE VERSIONedge-19.edge.lab.eng.rdu2.redhat.com Ready control-plane,master,worker 5d v1.29.8+632b078nvd-srv-32.nvidia.eng.rdu2.dc.redhat.com Ready worker 4d22h v1.29.8+632b078nvd-srv-33.nvidia.eng.rdu2.dc.redhat.com NotReady,SchedulingDisabled worker 4d22h v1.29.8+632b078 -
After the nodes have rebooted, verify that the VF interfaces exist by opening up a debug pod on each node. Run the following command:
a$ oc debug node/nvd-srv-33.nvidia.eng.rdu2.dc.redhat.comExample outputStarting pod/nvd-srv-33nvidiaengrdu2dcredhatcom-debug-cqfjz ...To use host binaries, run `chroot /host`Pod IP: 10.6.135.12If you don't see a command prompt, try pressing enter.sh-5.1# chroot /hostsh-5.1# ip link show | grep ens826: ens8f0np0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 100042: ens8f0v0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 100043: ens8f0v1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 100044: ens8f0v2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 100045: ens8f0v3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 100046: ens8f0v4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 100047: ens8f0v5: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 100048: ens8f0v6: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 100049: ens8f0v7: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 -
Repeat the previous steps on the second node, if necessary.
-
Optional: Confirm that the resources appear in the cluster
oc describe nodesection by using the following command:$ oc describe node -l node-role.kubernetes.io/worker=| grep -E 'Capacity:|Allocatable:' -A8Example outputCapacity:cpu: 128ephemeral-storage: 1561525616Kihugepages-1Gi: 0hugepages-2Mi: 0memory: 263596692Kinvidia.com/gpu: 2nvidia.com/hostdev: 0openshift.io/sriovlegacy: 8--Allocatable:cpu: 127500mephemeral-storage: 1438028263499hugepages-1Gi: 0hugepages-2Mi: 0memory: 262445716Kinvidia.com/gpu: 2nvidia.com/hostdev: 0openshift.io/sriovlegacy: 8--Capacity:cpu: 128ephemeral-storage: 1561525616Kihugepages-1Gi: 0hugepages-2Mi: 0memory: 263596688Kinvidia.com/gpu: 2nvidia.com/hostdev: 0openshift.io/sriovlegacy: 8--Allocatable:cpu: 127500mephemeral-storage: 1438028263499hugepages-1Gi: 0hugepages-2Mi: 0memory: 262445712Kinvidia.com/gpu: 2nvidia.com/hostdev: 0openshift.io/sriovlegacy: 8 -
After the VFs for SR-IOV legacy mode are in place, generate the
SriovNetworkCR file. See the following example:$ cat <<EOF > sriov-network.yamlapiVersion: sriovnetwork.openshift.io/v1kind: SriovNetworkmetadata:name: sriov-networknamespace: openshift-sriov-network-operatorspec:vlan: 0networkNamespace: "default"resourceName: "sriovlegacy"ipam: |{"type": "whereabouts","range": "192.168.3.225/28","exclude": ["192.168.3.229/30","192.168.3.236/32"]}EOF -
Create the custom resource on the cluster by using the following command:
$ oc create -f sriov-network.yamlExample outputsriovnetwork.sriovnetwork.openshift.io/sriov-network created
Creating a shared device RDMA on Infiniband
Create the workload pods for a shared device Remote Direct Memory Access (RDMA) for an Infiniband installation.
Procedure
-
Generate custom pod resources:
$ cat <<EOF > rdma-ib-32-workload.yamlapiVersion: v1kind: Podmetadata:name: rdma-ib-32-workloadnamespace: defaultannotations:k8s.v1.cni.cncf.io/networks: example-ipoibnetworkspec:nodeSelector:kubernetes.io/hostname: nvd-srv-32.nvidia.eng.rdu2.dc.redhat.comcontainers:- image: quay.io/edge-infrastructure/nvidia-tools:0.1.5name: rdma-ib-32-workloadresources:limits:nvidia.com/gpu: 1rdma/rdma_shared_device_ib: 1requests:nvidia.com/gpu: 1rdma/rdma_shared_device_ib: 1EOF$ cat <<EOF > rdma-ib-32-workload.yamlapiVersion: v1kind: Podmetadata:name: rdma-ib-33-workloadnamespace: defaultannotations:k8s.v1.cni.cncf.io/networks: example-ipoibnetworkspec:nodeSelector:kubernetes.io/hostname: nvd-srv-33.nvidia.eng.rdu2.dc.redhat.comcontainers:- image: quay.io/edge-infrastructure/nvidia-tools:0.1.5name: rdma-ib-33-workloadsecurityContext:capabilities:add: [ "IPC_LOCK" ]resources:limits:nvidia.com/gpu: 1rdma/rdma_shared_device_ib: 1requests:nvidia.com/gpu: 1rdma/rdma_shared_device_ib: 1EOF -
Create the pods on the cluster by using the following commands:
$ oc create -f rdma-ib-32-workload.yamlExample outputpod/rdma-ib-32-workload created$ oc create -f rdma-ib-33-workload.yamlExample outputpod/rdma-ib-33-workload created -
Verify that the pods are running by using the following command:
$ oc get podsExample outputNAME READY STATUS RESTARTS AGErdma-ib-32-workload 1/1 Running 0 10srdma-ib-33-workload 1/1 Running 0 3s
Verifying RDMA connectivity
Confirm Remote Direct Memory Access (RDMA) connectivity is working between the systems, specifically for Legacy Single Root I/O Virtualization (SR-IOV) Ethernet.
Procedure
-
Connect to each
rdma-workload-clientpod by using the following command:$ oc rsh -n default rdma-sriov-32-workloadExample outputsh-5.1# -
Check the IP address assigned to the first workload pod by using the following command. In this example, the first workload pod is the RDMA test server.
sh-5.1# ip aExample output1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope hostvalid_lft forever preferred_lft forever2: eth0@if3970: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1400 qdisc noqueue state UP group defaultlink/ether 0a:58:0a:80:02:a7 brd ff:ff:ff:ff:ff:ff link-netnsid 0inet 10.128.2.167/23 brd 10.128.3.255 scope global eth0valid_lft forever preferred_lft foreverinet6 fe80::858:aff:fe80:2a7/64 scope linkvalid_lft forever preferred_lft forever3843: net1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether 26:34:fd:53:a6:ec brd ff:ff:ff:ff:ff:ffaltname enp55s0f0v5inet 192.168.4.225/28 brd 192.168.4.239 scope global net1valid_lft forever preferred_lft foreverinet6 fe80::2434:fdff:fe53:a6ec/64 scope linkvalid_lft forever preferred_lft foreversh-5.1#The IP address of the RDMA server assigned to this pod is the
net1interface. In this example, the IP address is192.168.4.225. -
Run the
ibstatuscommand to get thelink_layertype, Ethernet or Infiniband, associated with each RDMA devicemlx5_x. The output also shows the status of all of the RDMA devices by checking thestatefield, which shows eitherACTIVEorDOWN.sh-5.1# ibstatusExample outputInfiniband device 'mlx5_0' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 4: ACTIVEphys state: 5: LinkUprate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_1' port 1 status:default gid: fe80:0000:0000:0000:e8eb:d303:0072:1415base lid: 0xcsm lid: 0x1state: 4: ACTIVEphys state: 5: LinkUprate: 200 Gb/sec (4X HDR)link_layer: InfiniBandInfiniband device 'mlx5_2' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 1: DOWNphys state: 3: Disabledrate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_3' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 1: DOWNphys state: 3: Disabledrate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_4' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 1: DOWNphys state: 3: Disabledrate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_5' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 1: DOWNphys state: 3: Disabledrate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_6' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 1: DOWNphys state: 3: Disabledrate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_7' port 1 status:default gid: fe80:0000:0000:0000:2434:fdff:fe53:a6ecbase lid: 0x0sm lid: 0x0state: 4: ACTIVEphys state: 5: LinkUprate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_8' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 1: DOWNphys state: 3: Disabledrate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_9' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 1: DOWNphys state: 3: Disabledrate: 200 Gb/sec (4X HDR)link_layer: Ethernetsh-5.1# -
To get the
link_layerfor each RDMAmlx5device on your worker node, run theibstatcommand:sh-5.1# ibstat | egrep "Port|Base|Link"Example outputPort 1:Physical state: LinkUpBase lid: 0Port GUID: 0x0000000000000000Link layer: EthernetPort 1:Physical state: LinkUpBase lid: 12Port GUID: 0xe8ebd30300721415Link layer: InfiniBandPort 1:Base lid: 0Port GUID: 0x0000000000000000Link layer: EthernetPort 1:Base lid: 0Port GUID: 0x0000000000000000Link layer: EthernetPort 1:Base lid: 0Port GUID: 0x0000000000000000Link layer: EthernetPort 1:Base lid: 0Port GUID: 0x0000000000000000Link layer: EthernetPort 1:Base lid: 0Port GUID: 0x0000000000000000Link layer: EthernetPort 1:Physical state: LinkUpBase lid: 0Port GUID: 0x2434fdfffe53a6ecLink layer: EthernetPort 1:Base lid: 0Port GUID: 0x0000000000000000Link layer: EthernetPort 1:Base lid: 0Port GUID: 0x0000000000000000Link layer: Ethernetsh-5.1# -
For RDMA Shared Device or Host Device workload pods, the RDMA device named
mlx5_xis already known and is typicallymlx5_0ormlx5_1. For RDMA Legacy SR-IOV workload pods, you need to determine which RDMA device is associated with which Virtual Function (VF) subinterface. Provide this information by using the following command:sh-5.1# rdma link showExample outputlink mlx5_0/1 state ACTIVE physical_state LINK_UPlink mlx5_1/1 subnet_prefix fe80:0000:0000:0000 lid 12 sm_lid 1 lmc 0 state ACTIVE physical_state LINK_UPlink mlx5_2/1 state DOWN physical_state DISABLEDlink mlx5_3/1 state DOWN physical_state DISABLEDlink mlx5_4/1 state DOWN physical_state DISABLEDlink mlx5_5/1 state DOWN physical_state DISABLEDlink mlx5_6/1 state DOWN physical_state DISABLEDlink mlx5_7/1 state ACTIVE physical_state LINK_UP netdev net1link mlx5_8/1 state DOWN physical_state DISABLEDlink mlx5_9/1 state DOWN physical_state DISABLEDIn this example, the RDMA device names
mlx5_7is associated with thenet1interface. This output is used in the next command to perform the RDMA bandwidth test, which also verifies RDMA connectivity between worker nodes. -
Run the following
ib_write_bwRDMA bandwidth test command:sh-5.1# /root/perftest/ib_write_bw -R -T 41 -s 65536 -F -x 3 -m 4096 --report_gbits -q 16 -D 60 -d mlx5_7 -p 10000 --source_ip 192.168.4.225 --use_cuda=0 --use_cuda_dmabufwhere:
- The
mlx5_7RDMA device is passed in the-dswitch. - The source IP address is
192.168.4.225to start the RDMA server. - The
--use_cuda=0,--use_cuda_dmabufswitches indicate that the use of GPUDirect RDMA.Example outputWARNING: BW peak won't be measured in this run.Perftest doesn't supports CUDA tests with inline messages: inline size set to 0************************************* Waiting for client to connect... *************************************
- The
-
Open another terminal window and run
oc rshcommand on the second workload pod that acts as the RDMA test client pod:$ oc rsh -n default rdma-sriov-33-workloadExample outputsh-5.1# -
Obtain the RDMA test client pod IP address from the
net1interface by using the following command:sh-5.1# ip aExample output1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope hostvalid_lft forever preferred_lft forever2: eth0@if4139: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1400 qdisc noqueue state UP group defaultlink/ether 0a:58:0a:83:01:d5 brd ff:ff:ff:ff:ff:ff link-netnsid 0inet 10.131.1.213/23 brd 10.131.1.255 scope global eth0valid_lft forever preferred_lft foreverinet6 fe80::858:aff:fe83:1d5/64 scope linkvalid_lft forever preferred_lft forever4076: net1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether 56:6c:59:41:ae:4a brd ff:ff:ff:ff:ff:ffaltname enp55s0f0v0inet 192.168.4.226/28 brd 192.168.4.239 scope global net1valid_lft forever preferred_lft foreverinet6 fe80::546c:59ff:fe41:ae4a/64 scope linkvalid_lft forever preferred_lft foreversh-5.1# -
Obtain the
link_layertype associated with each RDMA devicemlx5_xby using the following command:sh-5.1# ibstatusExample outputInfiniband device 'mlx5_0' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 4: ACTIVEphys state: 5: LinkUprate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_1' port 1 status:default gid: fe80:0000:0000:0000:e8eb:d303:0072:09f5base lid: 0xdsm lid: 0x1state: 4: ACTIVEphys state: 5: LinkUprate: 200 Gb/sec (4X HDR)link_layer: InfiniBandInfiniband device 'mlx5_2' port 1 status:default gid: fe80:0000:0000:0000:546c:59ff:fe41:ae4abase lid: 0x0sm lid: 0x0state: 4: ACTIVEphys state: 5: LinkUprate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_3' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 1: DOWNphys state: 3: Disabledrate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_4' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 1: DOWNphys state: 3: Disabledrate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_5' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 1: DOWNphys state: 3: Disabledrate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_6' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 1: DOWNphys state: 3: Disabledrate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_7' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 1: DOWNphys state: 3: Disabledrate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_8' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 1: DOWNphys state: 3: Disabledrate: 200 Gb/sec (4X HDR)link_layer: EthernetInfiniband device 'mlx5_9' port 1 status:default gid: 0000:0000:0000:0000:0000:0000:0000:0000base lid: 0x0sm lid: 0x0state: 1: DOWNphys state: 3: Disabledrate: 200 Gb/sec (4X HDR)link_layer: Ethernet -
Optional: Obtain the firmware version of Mellanox cards by using the
ibstatcommand:sh-5.1# ibstatExample outputCA 'mlx5_0'CA type: MT4123Number of ports: 1Firmware version: 20.43.1014Hardware version: 0Node GUID: 0xe8ebd303007209f4System image GUID: 0xe8ebd303007209f4Port 1:State: ActivePhysical state: LinkUpRate: 200Base lid: 0LMC: 0SM lid: 0Capability mask: 0x00010000Port GUID: 0x0000000000000000Link layer: EthernetCA 'mlx5_1'CA type: MT4123Number of ports: 1Firmware version: 20.43.1014Hardware version: 0Node GUID: 0xe8ebd303007209f5System image GUID: 0xe8ebd303007209f4Port 1:State: ActivePhysical state: LinkUpRate: 200Base lid: 13LMC: 0SM lid: 1Capability mask: 0xa651e848Port GUID: 0xe8ebd303007209f5Link layer: InfiniBandCA 'mlx5_2'CA type: MT4124Number of ports: 1Firmware version: 20.43.1014Hardware version: 0Node GUID: 0x566c59fffe41ae4aSystem image GUID: 0xe8ebd303007209f4Port 1:State: ActivePhysical state: LinkUpRate: 200Base lid: 0LMC: 0SM lid: 0Capability mask: 0x00010000Port GUID: 0x546c59fffe41ae4aLink layer: EthernetCA 'mlx5_3'CA type: MT4124Number of ports: 1Firmware version: 20.43.1014Hardware version: 0Node GUID: 0xb2ae4bfffe8f3d02System image GUID: 0xe8ebd303007209f4Port 1:State: DownPhysical state: DisabledRate: 200Base lid: 0LMC: 0SM lid: 0Capability mask: 0x00010000Port GUID: 0x0000000000000000Link layer: EthernetCA 'mlx5_4'CA type: MT4124Number of ports: 1Firmware version: 20.43.1014Hardware version: 0Node GUID: 0x2a9967fffe8bf272System image GUID: 0xe8ebd303007209f4Port 1:State: DownPhysical state: DisabledRate: 200Base lid: 0LMC: 0SM lid: 0Capability mask: 0x00010000Port GUID: 0x0000000000000000Link layer: EthernetCA 'mlx5_5'CA type: MT4124Number of ports: 1Firmware version: 20.43.1014Hardware version: 0Node GUID: 0x5aff2ffffe2e17e8System image GUID: 0xe8ebd303007209f4Port 1:State: DownPhysical state: DisabledRate: 200Base lid: 0LMC: 0SM lid: 0Capability mask: 0x00010000Port GUID: 0x0000000000000000Link layer: EthernetCA 'mlx5_6'CA type: MT4124Number of ports: 1Firmware version: 20.43.1014Hardware version: 0Node GUID: 0x121bf1fffe074419System image GUID: 0xe8ebd303007209f4Port 1:State: DownPhysical state: DisabledRate: 200Base lid: 0LMC: 0SM lid: 0Capability mask: 0x00010000Port GUID: 0x0000000000000000Link layer: EthernetCA 'mlx5_7'CA type: MT4124Number of ports: 1Firmware version: 20.43.1014Hardware version: 0Node GUID: 0xb22b16fffed03dd7System image GUID: 0xe8ebd303007209f4Port 1:State: DownPhysical state: DisabledRate: 200Base lid: 0LMC: 0SM lid: 0Capability mask: 0x00010000Port GUID: 0x0000000000000000Link layer: EthernetCA 'mlx5_8'CA type: MT4124Number of ports: 1Firmware version: 20.43.1014Hardware version: 0Node GUID: 0x523800fffe16d105System image GUID: 0xe8ebd303007209f4Port 1:State: DownPhysical state: DisabledRate: 200Base lid: 0LMC: 0SM lid: 0Capability mask: 0x00010000Port GUID: 0x0000000000000000Link layer: EthernetCA 'mlx5_9'CA type: MT4124Number of ports: 1Firmware version: 20.43.1014Hardware version: 0Node GUID: 0xd2b4a1fffebdc4a9System image GUID: 0xe8ebd303007209f4Port 1:State: DownPhysical state: DisabledRate: 200Base lid: 0LMC: 0SM lid: 0Capability mask: 0x00010000Port GUID: 0x0000000000000000Link layer: Ethernetsh-5.1# -
To determine which RDMA device is associated with the Virtual Function subinterface that the client workload pod uses, run the following command. In this example, the
net1interface is using the RDMA devicemlx5_2.sh-5.1# rdma link showExample outputlink mlx5_0/1 state ACTIVE physical_state LINK_UPlink mlx5_1/1 subnet_prefix fe80:0000:0000:0000 lid 13 sm_lid 1 lmc 0 state ACTIVE physical_state LINK_UPlink mlx5_2/1 state ACTIVE physical_state LINK_UP netdev net1link mlx5_3/1 state DOWN physical_state DISABLEDlink mlx5_4/1 state DOWN physical_state DISABLEDlink mlx5_5/1 state DOWN physical_state DISABLEDlink mlx5_6/1 state DOWN physical_state DISABLEDlink mlx5_7/1 state DOWN physical_state DISABLEDlink mlx5_8/1 state DOWN physical_state DISABLEDlink mlx5_9/1 state DOWN physical_state DISABLEDsh-5.1# -
Run the following
ib_write_bwRDMA bandwidth test command:sh-5.1# /root/perftest/ib_write_bw -R -T 41 -s 65536 -F -x 3 -m 4096 --report_gbits -q 16 -D 60 -d mlx5_2 -p 10000 --source_ip 192.168.4.226 --use_cuda=0 --use_cuda_dmabuf 192.168.4.225where:
-
The
mlx5_2RDMA device is passed in the-dswitch. -
The source IP address
192.168.4.226and the destination IP address of the RDMA server192.168.4.225. -
The
--use_cuda=0,--use_cuda_dmabufswitches indicate that the use of GPUDirect RDMA.Example outputWARNING: BW peak won't be measured in this run.Perftest doesn't supports CUDA tests with inline messages: inline size set to 0Requested mtu is higher than active mtuChanging to active mtu - 3initializing CUDAListing all CUDA devices in system:CUDA device 0: PCIe address is 61:00Picking device No. 0[pid = 8909, dev = 0] device name = [NVIDIA A40]creating CUDA Ctxmaking it the current CUDA CtxCUDA device integrated: 0using DMA-BUF for GPU buffer address at 0x7f8738600000 aligned at 0x7f8738600000 with aligned size 2097152allocated GPU buffer of a 2097152 address at 0x23a7420 for type CUDA_MEM_DEVICECalling ibv_reg_dmabuf_mr(offset=0, size=2097152, addr=0x7f8738600000, fd=40) for QP #0---------------------------------------------------------------------------------------RDMA_Write BW TestDual-port : OFF Device : mlx5_2Number of qps : 16 Transport type : IBConnection type : RC Using SRQ : OFFPCIe relax order: ON Lock-free : OFFibv_wr* API : ON Using DDP : OFFTX depth : 128CQ Moderation : 1CQE Poll Batch : 16Mtu : 1024[B]Link type : EthernetGID index : 3Max inline data : 0[B]rdma_cm QPs : ONData ex. method : rdma_cm TOS : 41---------------------------------------------------------------------------------------local address: LID 0000 QPN 0x012d PSN 0x3cb6d7GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226local address: LID 0000 QPN 0x012e PSN 0x90e0acGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226local address: LID 0000 QPN 0x012f PSN 0x153f50GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226local address: LID 0000 QPN 0x0130 PSN 0x5e0128GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226local address: LID 0000 QPN 0x0131 PSN 0xd89752GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226local address: LID 0000 QPN 0x0132 PSN 0xe5fc16GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226local address: LID 0000 QPN 0x0133 PSN 0x236787GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226local address: LID 0000 QPN 0x0134 PSN 0xd9273eGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226local address: LID 0000 QPN 0x0135 PSN 0x37cfd4GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226local address: LID 0000 QPN 0x0136 PSN 0x3bff8fGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226local address: LID 0000 QPN 0x0137 PSN 0x81f2bdGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226local address: LID 0000 QPN 0x0138 PSN 0x575c43GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226local address: LID 0000 QPN 0x0139 PSN 0x6cf53dGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226local address: LID 0000 QPN 0x013a PSN 0xcaaf6fGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226local address: LID 0000 QPN 0x013b PSN 0x346437GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226local address: LID 0000 QPN 0x013c PSN 0xcc5865GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x026d PSN 0x359409GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x026e PSN 0xe387bfGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x026f PSN 0x5be79dGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x0270 PSN 0x1b4b28GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x0271 PSN 0x76a61bGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x0272 PSN 0x3d50e1GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x0273 PSN 0x1b572cGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x0274 PSN 0x4ae1b5GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x0275 PSN 0x5591b5GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x0276 PSN 0xfa2593GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x0277 PSN 0xd9473bGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x0278 PSN 0x2116b2GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x0279 PSN 0x9b83b6GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x027a PSN 0xa0822bGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x027b PSN 0x6d930dGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x027c PSN 0xb1a4dGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225---------------------------------------------------------------------------------------#bytes #iterations BW peak[Gb/sec] BW average[Gb/sec] MsgRate[Mpps]65536 10329004 0.00 180.47 0.344228---------------------------------------------------------------------------------------deallocating GPU buffer 00007f8738600000destroying current CUDA Ctxsh-5.1#A positive test is seeing an expected BW average and MsgRate in Mpps.
Upon completion of the
ib_write_bwcommand, the server side output also appears on the server pod. See the following example:Example outputWARNING: BW peak won't be measured in this run.Perftest doesn't supports CUDA tests with inline messages: inline size set to 0************************************* Waiting for client to connect... *************************************Requested mtu is higher than active mtuChanging to active mtu - 3initializing CUDAListing all CUDA devices in system:CUDA device 0: PCIe address is 61:00Picking device No. 0[pid = 9226, dev = 0] device name = [NVIDIA A40]creating CUDA Ctxmaking it the current CUDA CtxCUDA device integrated: 0using DMA-BUF for GPU buffer address at 0x7f447a600000 aligned at 0x7f447a600000 with aligned size 2097152allocated GPU buffer of a 2097152 address at 0x2406400 for type CUDA_MEM_DEVICECalling ibv_reg_dmabuf_mr(offset=0, size=2097152, addr=0x7f447a600000, fd=40) for QP #0---------------------------------------------------------------------------------------RDMA_Write BW TestDual-port : OFF Device : mlx5_7Number of qps : 16 Transport type : IBConnection type : RC Using SRQ : OFFPCIe relax order: ON Lock-free : OFFibv_wr* API : ON Using DDP : OFFCQ Moderation : 1CQE Poll Batch : 16Mtu : 1024[B]Link type : EthernetGID index : 3Max inline data : 0[B]rdma_cm QPs : ONData ex. method : rdma_cm TOS : 41---------------------------------------------------------------------------------------Waiting for client rdma_cm QP to connectPlease run the same command with the IB/RoCE interface IP---------------------------------------------------------------------------------------local address: LID 0000 QPN 0x026d PSN 0x359409GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225local address: LID 0000 QPN 0x026e PSN 0xe387bfGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225local address: LID 0000 QPN 0x026f PSN 0x5be79dGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225local address: LID 0000 QPN 0x0270 PSN 0x1b4b28GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225local address: LID 0000 QPN 0x0271 PSN 0x76a61bGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225local address: LID 0000 QPN 0x0272 PSN 0x3d50e1GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225local address: LID 0000 QPN 0x0273 PSN 0x1b572cGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225local address: LID 0000 QPN 0x0274 PSN 0x4ae1b5GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225local address: LID 0000 QPN 0x0275 PSN 0x5591b5GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225local address: LID 0000 QPN 0x0276 PSN 0xfa2593GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225local address: LID 0000 QPN 0x0277 PSN 0xd9473bGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225local address: LID 0000 QPN 0x0278 PSN 0x2116b2GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225local address: LID 0000 QPN 0x0279 PSN 0x9b83b6GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225local address: LID 0000 QPN 0x027a PSN 0xa0822bGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225local address: LID 0000 QPN 0x027b PSN 0x6d930dGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225local address: LID 0000 QPN 0x027c PSN 0xb1a4dGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:225remote address: LID 0000 QPN 0x012d PSN 0x3cb6d7GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x012e PSN 0x90e0acGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x012f PSN 0x153f50GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x0130 PSN 0x5e0128GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x0131 PSN 0xd89752GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x0132 PSN 0xe5fc16GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x0133 PSN 0x236787GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x0134 PSN 0xd9273eGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x0135 PSN 0x37cfd4GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x0136 PSN 0x3bff8fGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x0137 PSN 0x81f2bdGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x0138 PSN 0x575c43GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x0139 PSN 0x6cf53dGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x013a PSN 0xcaaf6fGID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x013b PSN 0x346437GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226remote address: LID 0000 QPN 0x013c PSN 0xcc5865GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:04:226---------------------------------------------------------------------------------------#bytes #iterations BW peak[Gb/sec] BW average[Gb/sec] MsgRate[Mpps]65536 10329004 0.00 180.47 0.344228---------------------------------------------------------------------------------------deallocating GPU buffer 00007f447a600000destroying current CUDA Ctx
-