# OAI accelerated by T1 card ###### tags: `Construction` ## Pre-requisites | OS/Kernel | Version | |:-------------------------- |:----------------------------------------| | Host operating system | Linux Ubuntu 18.04 LTS | | Kernel | 4.15.0.142.lowlatency | ## Build Environment * Install git and other utility packages. ``` $ sudo apt-get install git vim ssh subversion gitk -y ``` * Install lowlatency kernel ``` $ sudo apt-get install linux-image-4.15.0.142-lowlatency -y ``` * Let the lowlatency kernel generate the build folder ``` $ sudo apt-get install linux-headers-4.15.0.142-lowlatency -y ``` * Reboot and setting the kernel as low latency mode ``` $ sudo reboot # Press shift+esc to enter GNU GRUB # Choose Advanced options for Ubuntu --> choose low latency kernel (without recovery mode) ``` * Check the current kernel is the low-latency one ``` $ uname -a ``` * Do: apt update in order to let the machine is up-to-date ``` $ sudo apt-get update ``` * Plug-in the T1 accelerator card to the motherboard & Confirm to read the acceleator card ``` $ lspci | grep Xilinx ``` * After Plug-in and confirm it should show: **3b:00.0 Serial controller: Xilinx Corporation Device 8038** ## Install and load FPGA LDPC driver ### Build driver * **Step 1:** Cloning related project ``` $ git clone -b OpinConnect_NYCU_NTUST_fpga_ldpc_decoder https://gitlab.eurecom.fr/oai/openairinterface5g.git ``` * **Step 2:** Install kernel module driver ``` $ cd openairinterface5g/openair1/PHY/NR_TRANSPORT/xdma_driver/xdma $ sudo make clean $ sudo make install ``` * <font color=#FF0000> **Here you may ran into this problem. If no, please skip to step 3 (Due to missing a signing key to sign the module)** </font> ``` SSL error:02001002:system library:fopen:No such file or directory: bss_file.c:175 SSL error:2006D080:BIO routines:BIO_new_file:no such file: bss_file.c:178 sign-file: certs/signing_key.pem: No such file or directory ``` * <font color=#FF0000> **To solve this problem, you should create a signing key to sign the module** </font> ``` $ cd /lib/modules/$(uname -r)/build/certs $ sudo tee x509.genkey > /dev/null << 'EOF' [ req ] default_bits = 4096 distinguished_name = req_distinguished_name prompt = no string_mask = utf8only x509_extensions = myexts [ req_distinguished_name ] CN = Modules [ myexts ] basicConstraints=critical,CA:FALSE keyUsage=digitalSignature subjectKeyIdentifier=hash authorityKeyIdentifier=keyid EOF $ sudo openssl req -new -nodes -utf8 -sha512 -days 36500 -batch -x509 -config x509.genkey -outform DER -out signing_key.x509 -keyout signing_key.pem ``` * **Step 3:** Loading driver ``` $ cd openairinterface5g/openair1/PHY/NR_TRANSPORT/xdma_driver/tests $ sudo ./load_driver.sh ``` * **Step 4:** Compile OAI ``` $ cd openairinterface5g $ source oaienv $ cmake_targets # First time build $ sudo ./build_oai -I # Simulation build $ sudo ./build_oai -c -C -P ``` ### Current related configuration * Number of RB : 106 * Number of symbols : 12 * MCS : 9 * Frequency Band : 78 (DL frequency 3619080000: band 78, UL frequency 3619080000) * Bandwidth : 40 * SCS : 30khz * **Step 5:** Execute OAI (for simulation) ``` $ sudo ./phy_simulators/build/nr_ulsim -n10000 -m9 -r106 -s10 -w2 -y2 -z2 -P -o # -n : Number of trials to simulate # -m : MCS value # -r : number of RB # -s : SNR # -w : Start PRB for PUSCH # -y : Number of TX antennas used in gNB # -z : Number of RX antennas used in UE # -P : Print ULSCH performances # -o : Enabled FPGA module (default is disabled) # -u : numerology ``` ## Experiment Result * Offload on FPGA ![](https://i.imgur.com/9qtYSNV.png) * Decoding in x86 (12th Gen Intel® Core™ i7-12700 × 20 ) ![](https://i.imgur.com/xpCXQrQ.png)