Cannot make `xrtDeviceLoadXclbinUUID` work
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 686
- Forks
- 549
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 70
Description
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,
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the xrtDeviceLoadXclbinUUID entry point, its documentation, and the load_xclbin implementation in src/runtime_src/core/common/device.cpp. Reproduce the UUID-loading and already-programmed-device paths using xbutil examine and the reported Rust call sequence. Done requires establishing a supported way to access the programmed FPGA without exposing the xclbin, or documenting why that workflow is unsupported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, rust
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100