What is the function of opencpi-4.19.0-xilinx-v2019.2-v2019.2.01.ko

Hello everyone, my FPGA development board is not xilinx’s official zcu102, but the chip is the same, so I operate according to the zcu102 manual. After I executed the ocpiremote start -b command on the host side, I found an error on the FPGA side opencpi: version magic ‘4.19.0-xilinx-v2019.2 SMP mod_unload aarch64’ should be ‘4.19.0 SMP mod_unload aarch64’, I tried to load this ko file manually, but it still couldn’t.

What I am confused about is what the function of this ko file is. At present, this ko file should not match the FPGA. I don’t know if it is because my development board peripherals are inconsistent with ZCU102. So I would like to ask, when was the opencpi-4.19.0-xilinx-v2019.2-v2019.2.01.ko file generated, and how to modify and recompile the ko file to adapt to my third-party development board?

Thanks

OpenCPI Kernel

The running Linux kernel config needs to match exactly to what the driver was built against. From the screenshot you posted it looks like you are running your development board’s SD card boot artifacts which may have differences in the Kernel config that make it incompatible.

The kernel module performs various functions:

  • Handles DMA between FPGA and CPU
  • Memory Mapped access to Control Plane in hardware
  • Low level access to Ethernet
  • FPGA manager access to load FPGA bitstream
  • not applicable in this case but for other platforms PCIe and DG-RGMA interconnects

OpenCPI Platform Development

If you think that your third party board is functionally equivalent hardware. Meaning the PS side has the same input clocks as the ZCU102 and similar MIO device tree structure. Try these SD card artifacts to boot it. These SD card artifacts is built for zcu102 that has been tested and successfully loads the kernel. This SD card contains xilinx24_1_aarch64 and OpenCPI directory containing standalone version of the framework.

ZCU102 SD Card with OpenCPI Prebuilt

Device Boots

Try loading the driver:

cd /run/media/mmcblk0p1/opencpi/xilinx24_1_aarch64/lib
insmod opencpi.ko

Expected output:

[  141.990581]  opencpit: loading out-of-tree module taints kernel.
[  142.001102]  NET: registered PF_DECnet protocol family 

If that works let me know and I can walk you through running the testbias application already included on that SD card.

Device Doesn’t Boot

If the board doesn’t boot you need to create both a new HDL platform and a new RCC platform.

The HDL platform will handle the OpenCPI container running on the FPGA fabric side of your platform.

For the RCC platform you could go one of two ways.

  1. Use existing operating system provided by your FPGA vendor.
  2. Generate your own that matches your boards peripherals using Petalinux, Yocto, or Buildroot .

I’ve shared with you already but I’ll re-iterate the following is a guide that will walk you through option #2. : guide/zcu102/Guide.md · develop · OpenCPI / OpenCPI System support Projects (OSP) / Xilinx · GitLab

The guide uses Xilinx 2019.2 but also applies to other versions such as xilinx2024.1 .

hi,aolivarez:
Unfortunately, you gave me the ZCU102 SD Card with OpenCPI Prebuilt, and I downloaded the file and put it in a formatted SD card in FAT32 format, but it couldn’t start it up. Maybe the SD card pin of my development board does not match the ZCU102.

I tried the SD card image that I can boot normally and replaced the BOOT. BIN and other files you provided to me. Now it seems to be able to enter the system, but I don’t know the login name and password.

I tried username: root password: root and found that the password is wrong.

I successfully logged in with the default username petalinux
But I still reported an error when I manually loaded the opencpi.ko module.

plxzcu102minimal:~/opencpi/xilinx24_1_aarch64/lib$ sudo insmod opencpi.ko
insmod: ERROR: could not insert module opencpi.ko: Invalid module format

[ 541.225715] opencpi: version magic ‘6.6.10-xilinx-v2024.1-g3af4295e00ef SMP mod_unload modversions aarch64’ should be ‘6.6.10-xilinx-v2024.1-g3af4295e00ef SMP mod_unload aarch64’

I tried using the command ocpiremote load -s xilinx19_2_aarch64 -w zcu102 -u petalinux -p root on ubuntu
The sandbox file was successfully sent to the FPGA development board.
the log is

(base) test@ubuntu:~/Desktop$ ocpiremote load -s xilinx19_2_aarch64 -w zcu102 -u petalinux -p root
Preparing remote sandbox...
Fri Mar  7 15:06:06 UTC 2025
date: can't set date: Operation not permitted
Creating server package...
Sending server package...
Server package sent successfully
Getting status (no server expected to be running):
Executing remote configuration command: status
No ocpiserve appears to be running: no pid file
(base) test@ubuntu:~/Desktop$ ocpiremote start -b 
Error: Unable to reach remote device using ssh at address 192.168.137.100
(base) test@ubuntu:~/Desktop$ ping 192.168.137.100
PING 192.168.137.100 (192.168.137.100) 56(84) bytes of data.
64 bytes from 192.168.137.100: icmp_seq=1 ttl=128 time=2.63 ms
64 bytes from 192.168.137.100: icmp_seq=2 ttl=128 time=3.41 ms
64 bytes from 192.168.137.100: icmp_seq=3 ttl=128 time=2.53 ms
^C
--- 192.168.137.100 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2006ms
rtt min/avg/max/mdev = 2.532/2.856/3.411/0.394 ms
(base) test@ubuntu:~/Desktop$ ocpiremote start -b -u petalinux -p root
Executing remote configuration command: start -B
Reloading kernel driver: 
The driver module is not loaded. No action was taken.
No reserved DMA memory found on the linux boot command line.
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
Reload of udev rules failed. (/sbin/udevadm control --reload-rules)
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required

I tried to log in as root user in fpga and repeat the above steps:
the log is:


(base) test@ubuntu:~/Desktop$ ocpiremote load -s xilinx19_2_aarch64 -w zcu102  -p root
Preparing remote sandbox...
Fri Mar  7 15:20:46 UTC 2025
Creating server package...
Sending server package...
Server package sent successfully
Getting status (no server expected to be running):
Executing remote configuration command: status
No ocpiserve appears to be running: no pid file
(base) test@ubuntu:~/Desktop$ ocpiremote start -b  -p root
Executing remote configuration command: start -B
Reloading kernel driver: 
The driver module is not loaded. No action was taken.
No reserved DMA memory found on the linux boot command line.
/sbin/udevadm: symbol lookup error: xilinx19_2_aarch64/sdk/lib/libpthread.so.0: undefined symbol: __libc_vfork, version GLIBC_PRIVATE
Reload of udev rules failed. (/sbin/udevadm control --reload-rules)

I don’t know how to solve this problem

I accidentally gave you the wrong boot.bin and image.ub. Those look like an older version that I still had in my system.

Replace them using the ones found in the link below.

https://opencpi-public.s3.us-east-2.amazonaws.com/prebuilt/2024.1-zcu102-release.tar.xz

When access the system using the terminal via UART it should not require a password.

Use the OpenCPI directory from the previous package and replace boot.bin and image.ub with the new version.

hi,aolivarez
It looks like the kernel loaded successfully. I don’t know how to thank you anymore. Thank you very much for your help. The problem that has plagued me all day is finally solved, and I can finally move on to the next step.

I copied the opencpi folder in the compressed package you gave last time to the root directory of the FPGA and renamed it sandbox, but it seems that this file is not have ocpiserver.sh. Is the opencpi folder you gave me also deprecated?

(base) test@ubuntu:~/Desktop$ ocpiremote start -b  -p root
sh: line 1: ./ocpiserver.sh: No such file or directory
root@plx-zcu102-minimal:~/sandbox# ls
COPYRIGHT              applications           default_mynetsetup.sh  release                xilinx24_1_aarch64     zynq_setup_common.sh
LICENSE.txt            artifacts              default_mysetup.sh     scripts                zynq_net_setup.sh
VERSION                default-system.xml     opencpi-setup.sh       system.xml             zynq_setup.sh
root@plx-zcu102-minimal:~/sandbox# cd scripts/
root@plx-zcu102-minimal:~/sandbox/scripts# ls
findJtagByESN_xilinx  loadBitStream         loadFlash_xilinx      ocpibootstrap.sh      ocpisetup.sh          probeJtag_altera      util.sh
getESNfromUSB_xilinx  loadFlash_altera      ocpi_linux_driver     ocpidriver            ocpisudo              probeJtag_xilinx
root@plx-zcu102-minimal:~/sandbox/scripts#

The contents I gave you were to verify that your boards compatibility. We’ve verified that xilinx24_1_aarch64 software platform runs on your third-party board.

Now that the kernel is loaded try loading the bitstream on to your platform.

On your embedded device:

cd /rum/media/mmcblk0p1/opencpi/
cp default_mysetup.sh mysetup.sh
source ./mysetup.sh

This is what you should see:

root@plx-zcu102-minimal:/run/media/mmcblk0p1/opencpi# source ./mysetup.sh 
Attempting to set time from time.nist.gov
rdate: bad address 'time.nist.gov'
====YOU HAVE NO NETWORK CONNECTION and NO HARDWARE CLOCK====
Set the time using the "date YYYY.MM.DD-HH:MM[:SS]" command.
Running login script.
OCPI_CDK_DIR is now /run/media/mmcblk0p1/opencpi
OCPI_ROOT_DIR is now /run/media/mmcblk0p1/opencpi/..
Executing /etc/profile.d/opencpi-persist.sh.
No reserved DMA memory found on the linux boot command line.
[ 1934.858288] opencpi: loading out-of-tree module taints kernel.
[ 1934.870603] NET: Registered PF_DECnet protocol family
Driver loaded successfully.
OpenCPI ready for zynq.
Loading bitstream
Bitstream loaded successfully
Discovering available containers...
Available containers:
 #  Model Platform            OS     OS-Version  Arch     Name
 0  hdl   zcu102                                          PL:0
 1  rcc   xilinx24_1_aarch64  linux  24_1        aarch64  rcc0

You’ll be looking for “Bitstream loaded succesfully”

Once that is done you can run the testbias application using standalone mode:

cd application
ocpirun -v -d -m bias=hdl testbias.xml

The output of that should look like this:

% cd applications/
% ocpirun -v -d -m bias=hdl testbias.xml
Available containers are:  0: PL:0 [model: hdl os:  platform: zcu102], 1: rcc0 [model: rcc os: linux platform: xilinx24_1_aarch64]
Actual deployment is:
  Instance  0 file_read (spec ocpi.core.file_read) on rcc container 1: rcc0, using file_read in /run/media/mmcblk0p1/opencpi/xilinx24_1_aarch64/artifacts/ocpi.core.file_read.rcc.0.xilinx24_1_aarch64.so dated Th5
  Instance  1 bias (spec ocpi.core.bias) on hdl container 0: PL:0, using bias_vhdl/a/bias_vhdl in /run/media/mmcblk0p1/opencpi/artifacts/testbias_zcu102_base.bitz dated Thu Mar  6 15:12:52 2025
  Instance  2 file_write (spec ocpi.core.file_write) on rcc container 1: rcc0, using file_write in /run/media/mmcblk0p1/opencpi/xilinx24_1_aarch64/artifacts/ocpi.core.file_write.rcc.0.xilinx24_1_aarch64.so date5
Application XML parsed and deployments (containers and artifacts) chosen [0 s 57 ms]
Application established: containers, workers, connections all created [0 s 15 ms]
Dump of all initial property values:
Property   0: file_read.fileName = "test.input" (cached)
Property   1: file_read.messagesInFile = "false" (cached)
Property   2: file_read.opcode = "0" (cached)
Property   3: file_read.messageSize = "16"
Property   4: file_read.granularity = "4" (cached)
Property   5: file_read.repeat = "false"
Property   6: file_read.bytesRead = "0"
Property   7: file_read.messagesWritten = "0"
Property   8: file_read.suppressEOF = "false"
Property   9: file_read.badMessage = "false"
Property  16: bias.biasValue = "16909060" (cached)
Property  20: bias.test64 = "0"
Property  31: file_write.fileName = "test.output" (cached)
Property  32: file_write.messagesInFile = "false" (cached)
Property  33: file_write.bytesWritten = "0"
Property  34: file_write.messagesWritten = "0"
Property  35: file_write.stopOnEOF = "true" (cached)
Property  39: file_write.suppressWrites = "false"
Property  40: file_write.countData = "false"
Property  41: file_write.bytesPerSecond = "0"
Application started/running [0 s 1 ms]
Waiting for application to finish (no time limit)
Application finished [0 s 20 ms]
Dump of all final property values:
Property   0: file_read.fileName = "test.input" (cached)
Property   1: file_read.messagesInFile = "false" (cached)
Property   2: file_read.opcode = "0" (cached)
Property   3: file_read.messageSize = "16"
Property   4: file_read.granularity = "4" (cached)
Property   5: file_read.repeat = "false" (cached)
Property   6: file_read.bytesRead = "4000"
Property   7: file_read.messagesWritten = "250"
Property   8: file_read.suppressEOF = "false" (cached)
Property   9: file_read.badMessage = "false"
Property  16: bias.biasValue = "16909060" (cached)
Property  20: bias.test64 = "0" (cached)
Property  31: file_write.fileName = "test.output" (cached)
Property  32: file_write.messagesInFile = "false" (cached)
Property  33: file_write.bytesWritten = "4000"
Property  34: file_write.messagesWritten = "250"
Property  35: file_write.stopOnEOF = "true" (cached)
Property  39: file_write.suppressWrites = "false" (cached)
Property  40: file_write.countData = "false" (cached)
Property  41: file_write.bytesPerSecond = "316331"

That would mean the device is capable of running OpenCPI on both the CPU and the FPGA.

The next step would be to update your development host to build the versions you need.
Your development host needs to have the zcu102 and xilinx24_1_aarch64 installed.

You will need to install Xilinx 2024.1 Vitis Tools following the instillation guide.

After your host has build for zcu102 and xilinx24_1_aarch64 you can then use ocpiremote with the device.

I have such a problem when executing it. Could it be a problem with the absolute path used? I will try to check each sh script to confirm.

root@plx-zcu102-minimal:~/opencpi# ls
COPYRIGHT              applications           default_mynetsetup.sh  ocpiserver.sh          release                xilinx24_1_aarch64     zynq_setup_common.sh
LICENSE.txt            artifacts              default_mysetup.sh     opencpi-setup.sh       scripts                zynq_net_setup.sh
VERSION                default-system.xml     mysetup.sh             opencpiserver.sh       system.xml             zynq_setup.sh
root@plx-zcu102-minimal:~/opencpi# cp default_mysetup.sh mysetup.sh
root@plx-zcu102-minimal:~/opencpi# source ./mysetup.sh
-sh: /release: No such file or directory
Attempting to set time from time.nist.gov
rdate: bad address 'time.nist.gov'
====YOU HAVE NO NETWORK CONNECTION and NO HARDWARE CLOCK====
Set the time using the "date YYYY.MM.DD-HH:MM[:SS]" command.
Running login script.
OCPI_CDK_DIR is now
OCPI_ROOT_DIR is now /..
Executing /etc/profile.d/opencpi-persist.sh.
-sh: cd: /../opencpi: No such file or directory

The directory for running in standalone mode assumes it is located in /run/media/mmcblk0p1/

Symbolic links would break if it’s moved into another location.

hi,aolivarez
It is indeed the symbolic connection problem you mentioned. I created the file structure according to the path you gave, and it worked successfully.Thanks a lot.

I executed the test you gave and it seems to run successfully.

% ocpirun -v -d -m bias=hdl testbias.xml
Available containers are:  0: PL:0 [model: hdl os:  platform: zcu102], 1: rcc0 [model: rcc os: linux platform: xilinx24_1_aarch64]
Actual deployment is:
  Instance  0 file_read (spec ocpi.core.file_read) on rcc container 1: rcc0, using file_read in /run/media/mmcblk0p1/opencpi/xilinx24_1_aarch64/artifacts/ocpi.core.file_read.rcc.0.xilinx24_1_aarch64.so dated Tue Nov  8 14:06:23 2022
  Instance  1 bias (spec ocpi.core.bias) on hdl container 0: PL:0, using bias_vhdl/a/bias_vhdl in /run/media/mmcblk0p1/opencpi/artifacts/testbias_zcu102_base.bitz dated Tue Nov  8 14:06:22 2022
  Instance  2 file_write (spec ocpi.core.file_write) on rcc container 1: rcc0, using file_write in /run/media/mmcblk0p1/opencpi/xilinx24_1_aarch64/artifacts/ocpi.core.file_write.rcc.0.xilinx24_1_aarch64.so dated Tue Nov  8 14:06:23 2022
Application XML parsed and deployments (containers and artifacts) chosen [0 s 41 ms]
Application established: containers, workers, connections all created [0 s 9 ms]
Dump of all initial property values:
Property   0: file_read.fileName = "test.input" (cached)
Property   1: file_read.messagesInFile = "false" (cached)
Property   2: file_read.opcode = "0" (cached)
Property   3: file_read.messageSize = "16"
Property   4: file_read.granularity = "4" (cached)
Property   5: file_read.repeat = "false"
Property   6: file_read.bytesRead = "0"
Property   7: file_read.messagesWritten = "0"
Property   8: file_read.suppressEOF = "false"
Property   9: file_read.badMessage = "false"
Property  16: bias.biasValue = "16909060" (cached)
Property  20: bias.test64 = "0"
Property  31: file_write.fileName = "test.output" (cached)
Property  32: file_write.messagesInFile = "false" (cached)
Property  33: file_write.bytesWritten = "0"
Property  34: file_write.messagesWritten = "0"
Property  35: file_write.stopOnEOF = "true" (cached)
Property  39: file_write.suppressWrites = "false"
Property  40: file_write.countData = "false"
Property  41: file_write.bytesPerSecond = "0"
Application started/running [0 s 1 ms]
Waiting for application to finish (no time limit)
Application finished [0 s 20 ms]
Dump of all final property values:
Property   0: file_read.fileName = "test.input" (cached)
Property   1: file_read.messagesInFile = "false" (cached)
Property   2: file_read.opcode = "0" (cached)
Property   3: file_read.messageSize = "16"
Property   4: file_read.granularity = "4" (cached)
Property   5: file_read.repeat = "false" (cached)
Property   6: file_read.bytesRead = "4000"
Property   7: file_read.messagesWritten = "250"
Property   8: file_read.suppressEOF = "false" (cached)
Property   9: file_read.badMessage = "false"
Property  16: bias.biasValue = "16909060" (cached)
Property  20: bias.test64 = "0" (cached)
Property  31: file_write.fileName = "test.output" (cached)
Property  32: file_write.messagesInFile = "false" (cached)
Property  33: file_write.bytesWritten = "4000"
Property  34: file_write.messagesWritten = "250"
Property  35: file_write.stopOnEOF = "true" (cached)
Property  39: file_write.suppressWrites = "false" (cached)
Property  40: file_write.countData = "false" (cached)
Property  41: file_write.bytesPerSecond = "355274"

That is great!

Next step is setup of your development environment with zcu102 and xilinx24_1_aarch64 to build your own OpenCPI artifacts. Once your development environment is set you could also try running using ocpiremote.

hi,aolivarez:
I downloaded vitis today 2024.1
When I tried to install xilinx24_1_aarch64 platform, I found that there is no such platform


I asked you before that I can’t find the zcu102 platform, that solved it, and now I can’t find xilinx24_1_aarch64 how to solve it?
Also by the way, the platform queried on the FPGA side is xilinx24_1_aarch64, is it only possible to install vitis 2024.1, if I install 2024.2?

Available containers:
 #  Model Platform            OS     OS-Version  Arch     Name
 0  hdl   zcu102                                          PL:0
 1  rcc   xilinx24_1_aarch64  linux  24_1        aarch64  rcc0
%

24.1 RCC is available here on develop:

From what I’ve read it looks like @aolivarez provided you some precompiled stuff for 2024.1.

If you want to compile your own stuff for 2024.1, then you’ll need the RCC Platform locally and build it.

Your three options would be:

  • Copy it out of develop into your local v2.4.7
    • WARNING: This is potentially error prone, as other fixes may be needed for it to work.
  • Move to develop instead of v2.4.7
    • This is not fantastic as you aren’t on a hard tagged release, but you could checkout a specific commit and achieve the same versioning control.
  • Use xilinx19_2_aarch64 until v2.4.8 is available.
    • I imagine that you want to use 2024.1 because you have existing code in that environment.
    • So this is probably a non-starter.

I’d recommend the second option, as that is the least error prone and gets you the version you want. However, you will effectively be using a prerelease version.

@aolivarez, please correct me if I’m incorrect here.