Cannot make `xrtDeviceLoadXclbinUUID` work
furkanturan opened this issue · 0 comments
I need to give access to a third-party to my accelerator on my server. I wish to load the Alveo card with the .xclbin file, but do not give the users access to this file. That is my IP, and I want to protect it. The user will only receive a code that uses the accelerator. Not a binary, but source code, so that s/he can modify and profile the app as s/he wants.
Because, I use Rust for development, I use bindings over XRT's low-level API. Thus, I wish to use this routine:
fpga_device = xrtDeviceOpen(fpga_index);
xrtDeviceGetXclbinUUID(fpga_device, xclbin_uuid);
xrtDeviceLoadXclbinUUID(fpga_device, xclbin_uuid);
xrtPLKernelOpenExclusive(fpga_device, xclbin_uuid, kernel_name);
However, this does not work at all.
I find that it reads the uuid correctly in line 2. After line 2, the value at xclbin_uuid
is same as the value that I read with xbutil examine
. However, line 3 gives me the following error:
[XRT] ERROR: No such query request (34)
This is quite a poor error message.
Unfortunately, I could not find if my use of xrtDeviceLoadXclbinUUID
is right or wrong?
In fact, I first thought that its use should be unnecessary. As the FPGA is already programmed. However, if I skip this function, again I cannot continue. It gives me the following error. However, this specific UUID is programmed in the FPGA; I can confirm with xbutil examine
.
ERROR: No xclbin with uuid 'a0935cc1-bc3f-11a6-d055-e427c1970857': Invalid argument
I could not find any example use of xrtDeviceLoadXclbinUUID
. Besides, its documentation seems poor.
When I check the XRT repo, I see that xrtDeviceLoadXclbinUUID
calls load_xclbin
function in src/runtime_src/core/common/device.cpp
, and it wants to have the xclbin_full
information, which is explained as:
// class xclbin_full - Implementation of full xclbin
//
// A full xclbin is constructed from a file on disk or from a complete
// binary images for file content
In my case, I do not want to give this file to user; hence, I am not sure if XRT can still load the FPGA.
I would like to ask, if there is a suggested way of using xrtDeviceLoadXclbinUUID
? Or, if there is an alternative solution to my case, where the user connects to already programmed FPGA?
Kind Regards,