Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race in obtaining index of CU (Xilinx#7522)
Add lock around accessing cu index in core device. Fixes a potential race when a thread access cu indices while another thread is updating the indices after an xclbin was loaded. The race can only occur when multiple hardware contexts are used because CU contexts are managed per hardware context by XRT coreutil. xrt_core::device::get_cuidx lazy gathers cu indices from KMD when a thread tries to open a CU as part of creating a kernel object. The first thread to access the index of a CU can cause all indices to be updated if the requested CU is not yet registered.
- Loading branch information