Examples and IP for Software-Designed Instruments and NI FlexRIO

cancel
Showing results for 
Search instead for 
Did you mean: 

Run c\c++ app for NiFPGA in docker

How to run app with NiFPGA lib in docker?!

 

Example application in attachement - test_open_RIO.c

App build command:

g++ test_open_RIO0.c -I/opt/include -L/opt/lib -lNiFpga -o test_open_RIO0

 

Host App(./test_open_RIO0) output:

 

Hello, wrld!
Ready: 1
DIO0: 1
NiFpga_True 1
Finished

 

 

Host lsrio.py output:

 

RIO0
--Model Name: NI 9159

....

 

 

docker build command:

 

docker build --rm -t startrio .

 

 

docker run command:

 

docker run --rm --privileged --device /dev/RIO0 --mount type=bind,source=/sys/devices/pci0000\:00/0000\:00\:1c.5/0000\:02\:00.0/0000\:03\:03.0/0000\:04\:00.0/0000\:05\:01.0/0000\:06\:00.0/0000\:07\:08.0,target=/sys/devices/pci0000\:00/0000\:00\:1c.5/0000\:02\:00.0/0000\:03\:03.0/0000\:04\:00.0/0000\:05\:01.0/0000\:06\:00.0/0000\:07\:08.0 -it startrio bash

 

 

I have added host dev RIO0 to container and mounted PCI dev.

 

Now we are in conteiner bash!

conteiner lsrio.py output:

 

RIO0
--Model Name: NI 9159

....

 

 

conteiner App(./test_open_RIO0) output:

 

Hello, wrld!
Open error: -63192
Finished

 

 

On host FPGA device is accessible, from container is not accessible.

Sig
Comments
alqio
Member
Member
on

Did you figure this out? We are facing the same problem. 

nips180486
Member
Member
on

no

Sig