Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VITIS-11043 Refactor XRT to cache created devices #7870

Merged
merged 5 commits into from
Jan 9, 2024

Conversation

dbenusov
Copy link
Contributor

@dbenusov dbenusov commented Jan 4, 2024

Problem solved by the commit

https://jira.xilinx.com/browse/VITIS-11043
Each time XRT creates a device reference a new device wrapper is created. This is not correct, only one device should be created and that referenced cached.

Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered

Prevent XRT from constantly creating new xrt_core::device handles.

How problem was solved, alternative solutions (if any) and why they were rejected

Fixed by intercepting the create device call and storing the returned shared pointer. If a request is made for the same device id, the original referenced is returned.

Risks (if any) associated the changes in the commit

None. Should be an improvement in performance hopefully :)

What has been tested and how, request additional testing if necessary

Ubuntu 22.04 U55c

dbenusov@xsjdbenusov50:/proj/rdi/staff/dbenusov$ xbutil examine -d -r electrical
WARNING: Unexpected xocl version (2.16.0) was found. Expected 2.17.0, to match XRT tools.

-------------------------------------------------
[0000:04:00.1] : xilinx_u55c_gen3x16_xdma_base_3
-------------------------------------------------
Electrical
  Max Power              : 225 Watts
  Power                  : 21.445936 Watts
  Power Warning          : false

  Power Rails            :   Voltage  Current
  ---------------------------------------------
  12 Volts Auxillary     :  12.256 V  0.481 A
  12 Volts PCI Express   :  12.240 V  0.985 A
  3.3 Volts PCI Express  :   3.360 V  1.040 A
  3.3 Volts Auxillary    :   0.000 V  0.000 A
  Internal FPGA Vcc      :   0.852 V  6.100 A
  Internal FPGA Vcc IO   :   0.854 V  3.800 A
  DDR Vpp Bottom         :   0.000 V  0.000 A
  DDR Vpp Top            :   0.000 V  0.000 A
  5.5 Volts System       :   5.006 V  0.000 A
  Vcc 1.2 Volts Top      :   0.000 V  0.000 A
  Vcc 1.2 Volts Bottom   :   0.000 V  0.000 A
  1.8 Volts Top          :   1.813 V  0.000 A
  0.9 Volts Vcc          :   0.898 V  0.000 A
  12 Volts SW            :   0.000 V  0.000 A
  Mgt Vtt                :   1.200 V  0.000 A
  3.3 Volts Vcc          :   3.354 V  0.000 A
  1.2 Volts HBM          :   1.203 V  0.000 A
  Vpp 2.5 Volts          :   2.468 V  0.000 A
  12 Volts Aux1          :   0.000 V  0.000 A
  Vcc 1.2 Volts i        :   0.000 V  0.000 A
  V12 in i               :   0.000 V  0.000 A
  V12 in Aux0 i          :   0.000 V  0.000 A
  V12 in Aux1 i          :   0.000 V  0.000 A
  Vcc Auxillary          :   0.000 V  0.000 A
  Vcc Auxillary Pmc      :   0.000 V  0.000 A
  Vcc Ram                :   0.000 V  0.000 A
  0.9 Volts Vcc Vcu      :   0.000 V  0.000 A

Documentation impact (if any)

None

Signed-off-by: Daniel Benusovich <[email protected]>
@gbuildx
Copy link
Collaborator

gbuildx commented Jan 4, 2024

Build failed :(

@dbenusov dbenusov changed the title Refactor XRT to cache created devices VITIS-11043 Refactor XRT to cache created devices Jan 4, 2024
@gbuildx
Copy link
Collaborator

gbuildx commented Jan 4, 2024

Build failed :(

@gbuildx
Copy link
Collaborator

gbuildx commented Jan 6, 2024

Build Passed!

Copy link
Collaborator

@stsoe stsoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion

…otect device initialization.

Signed-off-by: Daniel Benusovich <[email protected]>
@gbuildx
Copy link
Collaborator

gbuildx commented Jan 8, 2024

Build Passed!

@dbenusov dbenusov requested a review from stsoe January 8, 2024 23:13
Copy link
Collaborator

@stsoe stsoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for removing the xrt:;device::get_info calls.

@chvamshi-xilinx chvamshi-xilinx merged commit 6a2e6f5 into Xilinx:master Jan 9, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants