Skip to content

[UR] call urGetAdapter before creating a platform from native handle #12432

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

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

pbalcer
Copy link
Contributor

@pbalcer pbalcer commented Jan 18, 2024

Calling urAdapterGet is required for the global adapter to be initialized, but it was missing when creating a platform from a native handle. This meant that the adapter's state never got initialized and its refcount remained at 0 (and overflowed on teardown).

This had no visible side-effects until changes in #12403.

Calling urAdapterGet is required for the global adapter to be initialized,
but it was missing when creating a platform from a native handle.
This meant that the adapter's state never got initialized and its refcount
remained at 0 (and overflowed on teardown).

This had no visible side-effects until changes in intel#12403.
Copy link
Contributor

@callumfare callumfare left a comment

Choose a reason for hiding this comment

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

LGTM

@pbalcer
Copy link
Contributor Author

pbalcer commented Jan 18, 2024

@intel/llvm-gatekeepers please merge.

@aelovikov-intel aelovikov-intel merged commit 5f6dc36 into intel:sycl Jan 18, 2024
@pbalcer pbalcer deleted the ur-fix-platform-native-handle branch January 18, 2024 17:03
@kbenzie kbenzie mentioned this pull request Jan 19, 2024
7 tasks
kbenzie pushed a commit that referenced this pull request Jan 22, 2024
…12432)

Calling urAdapterGet is required for the global adapter to be
initialized, but it was missing when creating a platform from a native
handle. This meant that the adapter's state never got initialized and
its refcount remained at 0 (and overflowed on teardown).

This had no visible side-effects until changes in #12403.
pbalcer added a commit to pbalcer/llvm that referenced this pull request Feb 6, 2024
This solves the same issues as intel#12432, but for urDeviceCreateWithNativeHandle.
nrspruit pushed a commit to nrspruit/llvm that referenced this pull request Feb 6, 2024
This solves the same issues as intel#12432, but for urDeviceCreateWithNativeHandle.

Includes required oneapi-src/unified-runtime#1252
ldrumm pushed a commit that referenced this pull request Feb 7, 2024
…12619)

This solves the same issues as #12432, but for
`urDeviceCreateWithNativeHandle`. I considered a more generalized
solution (e.g., calling `urGetAdapter` in `piPluginInit`), but I'm not
sure that's worth it considering PI is going away. All the other
`CreateWithNativeHandle` functions require either platform or a device
to already exist.
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.

3 participants