Skip to content

Commit

Permalink
fixing aie_only xclbin issue (#8553)
Browse files Browse the repository at this point in the history
Co-authored-by: ch vamshi krishna <[email protected]>
  • Loading branch information
chvamshi-xilinx and ch vamshi krishna authored Oct 22, 2024
1 parent be2f6cc commit d5adb23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/runtime_src/core/edge/drm/zocl/edge/zocl_aie.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ static struct drm_zocl_slot*
get_slot(struct drm_zocl_dev * zdev, struct kds_client* client, int hw_ctx_id)
{
int slot_idx = 0;
int i = 0;
struct drm_zocl_slot* slot = NULL;
struct kds_client_hw_ctx *kds_hw_ctx = NULL;
mutex_lock(&client->lock);
Expand All @@ -192,10 +193,20 @@ get_slot(struct drm_zocl_dev * zdev, struct kds_client* client, int hw_ctx_id)

if (slot_idx >= MAX_PR_SLOT_NUM) {
DRM_ERROR("%s: Invalid client", __func__);
mutex_unlock(&client->lock);
return NULL;
}

slot = zdev->pr_slot[slot_idx];
// WorkAround for older flows where there is single slot for AIE
if (!slot || !slot->aie) {
for (i = 0; i < MAX_PR_SLOT_NUM; i++) {
slot = zdev->pr_slot[i];
if (slot && slot->aie)
break;
}
}

mutex_unlock(&client->lock);
return slot;
}
Expand Down
3 changes: 1 addition & 2 deletions src/runtime_src/core/edge/drm/zocl/edge/zocl_edge_xclbin.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ zocl_xclbin_read_axlf(struct drm_zocl_dev *zdev, struct drm_zocl_axlf *axlf_obj,
// We come here if user sets force_xclbin_program
// option "true" in xrt.ini under [Runtime] section
DRM_WARN("%s Force xclbin download", __func__);
} else {
} else if (!is_aie_only(axlf)) {
DRM_INFO("xclbin already downloaded to slot=%d", slot_id);
vfree(axlf);
mutex_unlock(&slot->slot_xclbin_lock);
Expand Down Expand Up @@ -214,7 +214,6 @@ zocl_xclbin_read_axlf(struct drm_zocl_dev *zdev, struct drm_zocl_axlf *axlf_obj,
} else
#endif
if (is_aie_only(axlf)) {
zocl_cleanup_aie(slot);

ret = zocl_load_aie_only_pdi(zdev, slot, axlf, xclbin, client);
if (ret)
Expand Down

0 comments on commit d5adb23

Please sign in to comment.