Generating TV and Launch Pattern Files#

Since the cuBB 22-2.2 release, the test vectors are not included in the release package. You must generate the TV files before running cuPHY examples or cuBB end-to-end test.

Note

TV generation is NOT supported on ARM because Matlab Compiler SDK doesn’t support it yet.

Using Aerial Python mcore Module#

No Matlab license is required to generate TV files using the Aerial Python mcore module. The cuBB container already has aerial_mcore installed.

To generate the test vectors required for end-to-end testing, follow these steps:

  1. Install the MATLAB Runtime and supporting apt packages inside the Aerial container. Note that following these instructions accepts the MATHWORKS license.

    sudo apt update && sudo apt install -y unzip
    wget https://ssd.mathworks.com/supportfiles/downloads/R2023a/Release/1/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R2023a_Update_1_glnxa64.zip
    mkdir unzip && cd unzip
    unzip ../MATLAB_Runtime_R2023a_Update_1_glnxa64.zip
    sudo ./install -mode silent -agreeToLicense yes
    cd .. && rm -rf MATLAB_Runtime_R2023a_Update_1_glnxa64.zip unzip
    
    sudo apt install -y libxcomposite1 libnss3 libxrandr-dev libatk1.0-0 libatk-bridge2.0-0 libx11-xcb-dev libxcb-dri3-0 libxcursor-dev libxdamage-dev libxi-dev libdrm-dev libgbm-dev libasound-dev libcups2-dev libxtst-dev
    

These instructions can be run directly inside the Aerial container as shown above, or with a Dockerfile against the Aerial container so that a new container with the MATLAB Runtime and its dependencies are only installed once. Create a Dockerfile with the following contents by running the following command. Note that the double backslash ensures a single backslash in the Dockerfile.

mkdir temp_dockerfile && cd temp_dockerfile
cat << EOF > Dockerfile
FROM nvcr.io/qhrjhjrvlsbu/aerial-cuda-accelerated-ran:25-1-cubb

USER root

RUN apt update && apt install -y unzip

RUN wget https://ssd.mathworks.com/supportfiles/downloads/R2023a/Release/1/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R2023a_Update_1_glnxa64.zip && \\
    mkdir unzip && \\
    cd unzip && \\
    unzip ../MATLAB_Runtime_R2023a_Update_1_glnxa64.zip && \\
    ./install -mode silent -agreeToLicense yes && \\
    cd .. && \\
    rm -rf MATLAB_Runtime_R2023a_Update_1_glnxa64.zip unzip

RUN apt install -y \\
    libxcomposite1 \\
    libnss3 \\
    libxrandr-dev \\
    libatk1.0-0 \\
    libatk-bridge2.0-0 \\
    libx11-xcb-dev \\
    libxcb-dri3-0 \\
    libxcursor-dev \\
    libxdamage-dev \\
    libxi-dev \\
    libdrm-dev \\
    libgbm-dev \\
    libasound-dev \\
    libcups2-dev \\
    libxtst-dev

USER aerial

EOF

Next execute the following command to create the new Aerial container with the MATLAB runtime and its dependencies. This needs to be executed from a machine that has docker installed. See instructions here

docker build -t aerial-cuda-accelerated-ran:25-1-cubb-matlab-runtime-enabled .

This will create the aerial-cuda-accelerated-ran image with a 25-1-cubb-matlab-runtime-enabled tag. Use the 25-1-cubb-matlab-runtime-enabled tagged image in place of the Aerial container when generating TVs using aerial_mcore.

  1. Run the following inside the Aerial container. It completes in less than a minute.

    cd ${cuBB_SDK}/5GModel/aerial_mcore/examples
    source ../scripts/setup.sh
    ../scripts/gen_e2e_ota_tvs.sh
    ls -lh GPU_test_input/
    cp GPU_test_input/* ${cuBB_SDK}/testVectors/
    

    The following is example output from the above commands:

    aerial@c_aerial_aerial:/opt/nvidia/cuBB/5GModel/aerial_mcore$ source ./scripts/setup.sh
    [Aerial Python]aerial@c_aerial_aerial:/opt/nvidia/cuBB/5GModel/aerial_mcore$ ./scripts/gen_e2e_ota_tvs.sh
    Finished genCuPhyChEstCoeffs
    Elapsed time: 1.166473150253296 seconds
    [Aerial Python]aerial@c_aerial_aerial:/opt/nvidia/cuBB/5GModel/aerial_mcore$ ls -lh ../GPU_test_input/
    -rw-rw-r-- 1 aerial aerial 90K Oct 17  2023 ../cuPhyChEstCoeffs.h5
    

    Note

    The cuPhyChEstCoeffs.h5 file can be found in the /opt/nvidia/cuBB/testVectors directory of both the x86 and ARM containers.

  1. Copy the output to the testVectors folder.

To generate all of the TV files, including files that are not necessary for E2E testing, follow these steps:

  1. Run the following commands inside the Aerial container.

    cd ${cuBB_SDK}/5GModel/aerial_mcore/examples
    source ../scripts/setup.sh
    export REGRESSION_MODE=1
    time python3 ./example_5GModel_regression.py allChannels
    echo $?
    ls -alF GPU_test_input/
    du -h GPU_test_input/
    

    Note

    The TV generation may take a few hours on the devkit with the current isocpus parameter setting in the kernel command line. The host must have at least 64GB of memory and 430GB of available disk space. Hyperthreading must be enabled.

  2. Review the output from the above commands; an example is shown below. The “real” time takes less than one hour on a 24-core x86 host. The echo $? command shows the exit code of the process, which should be 0, while a non-zero exit code indicates a failure.

    Channel  Compliance_Test  Error   Test_Vector  Error  Performance_Test   Fail
    ------------------------------------------------------------------------------
    SSB           37            0         42          0           0            0
    PDCCH         71            0         80          0           0            0
    PDSCH        274            0        286          0           0            0
    CSIRS         86            0         87          0           0            0
    DLMIX          0            0        1049         0           0            0
    PRACH         60            0         60          0          48            0
    PUCCH        469            0        469          0          96            0
    PUSCH        388            0        398          0          41            0
    SRS          125            0        125          0           0            0
    ULMIX          0            0        576          0           0            0
    BFW           58            0         58          0           0            0
    ------------------------------------------------------------------------------
    Total       1568            0       3230          0         185            0
    
    Total time for runRegression is 2147 seconds
    Parallel pool using the 'local' profile is shutting down.
    
    real    36m51.931s
    user    585m1.704s
    sys     10m28.322s
    

To generate the launch pattern for each test case using cubb_scripts, follow these steps:

  1. Run the following commands:

    cd $cuBB_SDK
    cd cubb_scripts
    python3 auto_lp.py -i ../5GModel/aerial_mcore/examples/GPU_test_input -t launch_pattern_nrSim.yaml
    
  2. Copy the launch pattern and TV files to the testVectors repo:

    cd $cuBB_SDK
    cp ./5GModel/aerial_mcore/examples/GPU_test_input/*h5 ./testVectors/.
    cp ./5GModel/aerial_mcore/examples/GPU_test_input/launch_pattern* ./testVectors/multi-cell/.`
    

Using Matlab#

To generate TV files using Matlab:

  1. Run the following command in Matlab:

    cd('nr_matlab'); startup; [nTC, errCnt] = runRegression({'TestVector'}, {'allChannels'}, 'compact', [0, 1] );
    

    All the cuPHY TVs are generated and stored under nr_matlab/GPU_test_input.

  2. Generate the launch pattern for each test case using cubb_scripts:

    cd $cuBB_SDK
    cd cubb_scripts
    python3 auto_lp.py -i ../5GModel/nr_matlab/GPU_test_input -t launch_pattern_nrSim.yaml
    
  3. Copy the launch pattern and TV files to testVectors repo.

cd $cuBB_SDK
cp ./5GModel/nr_matlab/GPU_test_input/TVnr_* ./testVectors/.
cp ./5GModel/nr_matlab/GPU_test_input/launch_pattern* ./testVectors/multi-cell/.