05-06-2022 04:33 AM
Hi, I am trying to make LabVIEW FPGA Compile Worker Systemd Service work. I have installed, tested, and working NI-LVFPGA2020-LinuxVivado, Xilinx Vivado 2019.1 compilation toolkit (64-bit) on centos 7.9.2009. Launching compile worker after every restart manually by clicking into GUI is not an option for me, so I decided to try systemd service according to Official manual.
I came up with an installation script solving some typos present in the installation manual
#!/bin/bash
bold=$(tput bold)
normal=$(tput sgr0)
if [ "$EUID" -ne 0 ]
then echo "${bold}Please run as root${normal}"
exit
fi
echo "${bold}Installing prerequisities${normal}"
yum install -y Xvfb mono-core
echo "${bold}Copying required files${normal}"
cp start_nifpgacompileworker.sh /usr/local/natinst/nifpgacompileworker/
cp nifpgaworker.service /etc/systemd/system/
echo "${bold}Setting privileges to copied files${normal}"
chmod 664 /etc/systemd/system/nifpgaworker.service
chmod 774 /usr/local/natinst/nifpgacompileworker/start_nifpgacompileworker.sh
echo "${bold}Running CompileWorkerSetup${normal}"
cd /usr/local/natinst/nifpgacompileworker
sh cw_wrapper.sh mono CompileWorker.exe
kill -9 $(pgrep -f CompileWorker)
echo "${bold}Setting up systemd${normal}"
systemctl daemon-reload
systemctl enable nifpgaworker.service
systemctl start nifpgaworker.service
echo "${bold}Status of nifpgaworker.service${normal}"
systemctl status -l nifpgaworker.service | grep "Active:"
sleep 1s
echo " $(systemctl status -l nifpgaworker.service | grep -o 'Connected.*"')"
echo "${bold}For more information use${normal} 'systemctl status nifpgaworker.service'"
Everything seems to work smoothly according to systemd logs, the worker is successfully connected to the compilation server, registering Vivado 2019.1.
$ systemctl status -l nifpgaworker.service
● nifpgaworker.service - NI FPGA Compile Worker Wrapper
Loaded: loaded (/etc/systemd/system/nifpgaworker.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2022-05-06 10:50:11 CEST; 6min ago
Main PID: 14852 (start_nifpgacom)
Tasks: 23
CGroup: /system.slice/nifpgaworker.service
├─14852 /bin/bash /usr/local/natinst/nifpgacompileworker/start_nifpgacompileworker.sh
├─14857 Xvfb :1 -screen 0 1024x768x16
└─14858 mono /usr/local/natinst/nifpgacompileworker/CompileWorker.exe
May 06 10:50:12 pcfriml2 start_nifpgacompileworker.sh[14852]: 2022-05-06 08:50:12Z|INFO|SessionId=|WorkerId=|JobId=|About to Serialize: /usr/local/natinst/nifpgacompileworker/configuration/NIFarmInfo.xml
May 06 10:50:12 pcfriml2 start_nifpgacompileworker.sh[14852]: 2022-05-06 08:50:12Z|INFO|SessionId=|WorkerId=|JobId=|Changing file permission for all users: /usr/local/natinst/nifpgacompileworker/configuration/NIFarmInfo.xml
May 06 10:50:12 pcfriml2 start_nifpgacompileworker.sh[14852]: 2022-05-06 08:50:12Z|INFO|SessionId=|WorkerId=|JobId=|Done Serializing: /usr/local/natinst/nifpgacompileworker/configuration/NIFarmInfo.xml
May 06 10:50:12 pcfriml2 start_nifpgacompileworker.sh[14852]: 2022-05-06 08:50:12Z|INFO|SessionId=|WorkerId=|JobId=|Starting the CompileWorkerThreadManager
May 06 10:50:12 pcfriml2 start_nifpgacompileworker.sh[14852]: 2022-05-06 08:50:12Z|INFO|Created thread pool with 9 threads
May 06 10:50:12 pcfriml2 start_nifpgacompileworker.sh[14852]: 2022-05-06 08:50:12Z|INFO|SessionId=FIYbkOA|WorkerId=|JobId=|Connected to Server: "147.229.75.202" with sessionId:FIYbkOA
May 06 10:50:12 pcfriml2 start_nifpgacompileworker.sh[14852]: 2022-05-06 08:50:12Z|INFO|SessionId=|WorkerId=|JobId=|All sessions connected. Server: 147.229.75.202
May 06 10:50:12 pcfriml2 start_nifpgacompileworker.sh[14852]: 2022-05-06 08:50:12Z|INFO|SessionId=FIYbkOA|WorkerId=PYUk212|JobId=|Capability registered: [VendorId=ni.fpga ProductId=labview.2020 Capability=vivado2019.1_64bit] and ServiceRequired=False
May 06 10:50:12 pcfriml2 start_nifpgacompileworker.sh[14852]: 2022-05-06 08:50:12Z|INFO|SessionId=FIYbkOA|WorkerId=|JobId=|Setting info that should end up in the UI: Registered Capabilities: ( 'Vivado 2019.1 (64-bit)' )
May 06 10:50:12 pcfriml2 start_nifpgacompileworker.sh[14852]: 2022-05-06 08:50:12Z|INFO|SessionId=FIYbkOA|WorkerId=|JobId=|UI info changed: Registered Capabilities: ( 'Vivado 2019.1 (64-bit)' )
Compilation results in error while trying to synthesize using vivado
It seems that some HOME environment variable is missing according to Xilings log
I cannot provide more details from the compilation server, as an unobtainable Silverlight is required.
Summary: FPGA Compile Worker ran by systemd fails when synthesizing using Vivado. When the same worker is launched in GUI, everything works fine.
Any idea how to solve this issue? This is consistent irregardless of compiled FPGA VI.