PCILeechGen icon indicating copy to clipboard operation
PCILeechGen copied to clipboard

Vivado path and license are lost when running with sudo

Open AikoKiss opened this issue 5 months ago • 1 comments

Description

When the program is run normally, Vivado works because the shell already has the required environment variables:

PATH=/opt/AMDDesignTools/Vivado/2023.2/bin:$PATH XILINXD_LICENSE_FILE=/home/aiko/Desktop/Xilinx.lic LM_LICENSE_FILE=/home/aiko/Desktop/Xilinx.lic

However, when the program is run with sudo, Ubuntu removes or replaces most environment variables. The program can still locate Vivado through --vivado-path, but Vivado cannot find the license file.

"ERROR: Vivado Design Suite cannot be launched because a valid license was not found." Error EXIT 1 or 43 and such

The program launches Vivado as a child process, so Vivado only receives the environment available to the program after sudo has filtered it.

The launch script should explicitly pass the Vivado path and license variables when running under sudo, for example:

sudo env
PATH="/opt/AMDDesignTools/Vivado/2023.2/bin:$PATH"
XILINXD_LICENSE_FILE="/home/aiko/Desktop/Xilinx.lic"
LM_LICENSE_FILE="/home/aiko/Desktop/Xilinx.lic"
./program
--vivado-path /opt/AMDDesignTools/Vivado/2023.2/bin/vivado

Ideally, only the PCI device operations should require sudo, while Vivado synthesis and project generation should run as the normal user.

Error Type

Other

Device Context File

device_context.json

Windows Event Log


Device Manager Error Details

No response

Terminal Output


AikoKiss avatar Jun 28 '26 02:06 AikoKiss

thank you for reporting this. we have resolved the problem. thanks to @VoidChecksum for their contributions in the process.

https://github.com/sercanarga/PCILeechGen/commit/0eb3bf955d906b69391e978bcbf13b94bd909d67

sercanarga avatar Jun 28 '26 12:06 sercanarga