DOCA SDK Documentation

Additional SDKs for DOCA

Installing CUDA on NVIDIA Converged Accelerator

NVIDIA® CUDA® is a parallel computing platform and programming model designed by NVIDIA for general-purpose GPU computing. The following steps detail how to set up CUDA on your environment.

These instructions assume that a BFB image has already been installed on your system.

To install CUDA on your converged accelerator:

  1. Download and install the latest NVIDIA Data Center GPU driver.

  2. Download and install CUDA.

    The CUDA version tested to work with DOCA SDK is 11.8.0.

    Downloading CUDA includes the latest NVIDIA Data Center GPU driver and CUDA toolkit. For more information about CUDA and driver compatibility, refer to the NVIDIA CUDA Toolkit Release Notes.

Configuring Operation Mode

There are two modes that the NVIDIA Converged Accelerator may operate in:

  • Standard mode (default) – the BlueField and the GPU operate separately

  • BlueField-X mode – the GPU is exposed to BlueField and is no longer visible on the host

To verify which mode the system is operating in, run: 

host# sudo mst start
host# sudo mlxconfig -d <device-id> q PCI_DOWNSTREAM_PORT_OWNER[4]
  • Standard mode output: 

    Device #1:
    […]
    Configurations:                              Next Boot
             PCI_DOWNSTREAM_PORT_OWNER[4]        DEVICE_DEFAULT(0)
    

    To configure standard mode, run:  

    host# mlxconfig -d <device-id> s PCI_DOWNSTREAM_PORT_OWNER[4]=0x0
    

     

  • BlueField-X mode output: 

    Device #1:
    […]
    Configurations:                              Next Boot
             PCI_DOWNSTREAM_PORT_OWNER[4]        EMBEDDED_CPU(15)
    

    To configure BlueField-X mode, run:

    host# mlxconfig -d <device-id> s PCI_DOWNSTREAM_PORT_OWNER[4]=0xF
    

     

Power cycle is required for configuration to take effect. For power cycle the host run: 

host# ipmitool power cycle

Downloading and Installing CUDA Toolkit and Driver

This section details the necessary steps to set up CUDA on your environment. It assumes that a BFB image has already been installed on your environment.

  1. Install CUDA by visiting the CUDA Toolkit Downloads webpage.  

    Select the Linux distribution and version relevant for your environment.

    This section shows the native compilation option either on x86 or aarch64 hosts.

  2. Test that the driver installation completed successfully. Run:

    dpu# nvidia-smi
    
    Tue Apr  5 13:37:59 2022       
    +-----------------------------------------------------------------------------+
    | NVIDIA-SMI 510.47.03    Driver Version: 510.47.03    CUDA Version: 11.8     |
    |-------------------------------+----------------------+----------------------+
    | 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 BF A10       Off  | 00000000:06:00.0 Off |                    0 |
    |  0%   43C    P0    N/A / 225W |      0MiB / 23028MiB |      0%      Default |
    |                               |                      |                  N/A |
    +-------------------------------+----------------------+----------------------+
                                                                                   
    +-----------------------------------------------------------------------------+
    | Processes:                                                                  |
    |  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
    |        ID   ID                                                   Usage      |
    |=============================================================================|
    |  No running processes found                                                 |
    +-----------------------------------------------------------------------------+
    
  3. Verify that the installation completed successfully.

    1. Download CUDA samples repo. Run: 

      dpu# git clone https://github.com/NVIDIA/cuda-samples.git
      
    2. Build and run vectorAdd CUDA sample. Run:  

      dpu# cd cuda-samples/Samples/0_Introduction/vectorAdd
      dpu# make
      dpu# ./vectorAdd

      If the vectorAdd sample works as expected, it should output "Test Passed".

      If it seems that the GPU is slow or stuck, stop execution and run:  

      dpu# sudo setpci -v -d ::0302 800.L=201 # CPL_VC0 = 32

GPUDirect RDMA

For information on GPUDirect RMDA and more, refer to DOCA GPUNetIO documentation.

Installing Rivermax on BlueField 

NVIDIA Rivermax offers a unique IP-based solution for any media and data streaming use case.

This section provides the steps to install Rivermax assuming that a BFB image has already been installed on your environment.

Downloading Rivermax Driver

  1. Navigate to the NVIDIA Rivermax SDK product page.

  2. Register to be able to download the driver package using the JOIN button at the top of the page.

  3. Download the appropriate driver package according to your BFB under the "Linux" subsection. For example, for Ubuntu 22.04 BFB, download rivermax_ubuntu2204_<version>.tar.gz.

Installing Rivermax Driver

  1. Copy the .tgz file to BlueField: 

    host# sudo scp -r rivermax_ubuntu2204_<version>.tar.gz ubuntu@192.168.100.2:/tmp/
    
  2. Extract the Rivermax file: 

    dpu# sudo tar xzf rivermax_ubuntu2204_<version>.tar.gz

  3. Install the Rivermax driver package: 

    dpu# cd <rivermax-version>/Ubuntu.22.04/deb-dist/aarch64/
    dpu# sudo dpkg -i rivermax_<version>.deb
    

Installing Rivermax Libraries from DOCA

Rivermax libraries are compatibles with DOCA components and can be found inside the doca-dpu-repo.

  1. Unpack the doca-dpu-repo: 

    dpu# sudo dpkg -i doca-dpu-repo-ubuntu2204-local_<version>_arm64.deb
    
  2. Run apt update: 

    dpu# sudo apt-get update
    
  3. Install the Rivermax libraries: 

    dpu# sudo apt install doca-sdk-rmax
    dpu# sudo apt install libdoca-sdk-rmax-dev
    

For additional details and guidelines, please visit the NVIDIA Rivermax SDK product page.

Last updated: