-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove redundant static member m_prelimEnabled
The buffer manager currently detects whether the KMD supports the prelim interface and sets the static member m_prelimEnabled accordingly. It then uses m_prelimEnabled to determine how to perform certain operations. However, since m_prelimEnabled is static, its value persists across all instances within the same process. This can lead to issues in multi-GPU environments. For example, consider two Intel GPUs: - GPU A supports the prelim interface. - GPU B does not support the prelim interface. If we initialize the buffer manager on GPU A first, m_prelimEnabled is set to true. When we subsequently initialize the buffer manager on GPU B within the same process, it incorrectly uses the cached value of m_prelimEnabled, potentially causing the program to crash due to incorrect assumptions about prelim support. To resolve this, we can eliminate the use of m_prelimEnabled. Instead, we can check the nullness of the instance member prelim within the buffer manager. The prelim member will be non-null if and only if the KMD supports the prelim interface for that specific GPU. This approach provides the same functionality without the drawbacks of using a static member. Tracked-On: OAM-124779 Signed-off-by: Weifeng Liu <[email protected]>
- Loading branch information
Showing
3 changed files
with
18 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters