Skip to content

[DevMSAN] Support device memory sanitizer for DG2 GPU device #2554

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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/loader/layers/sanitizer/msan/msan_shadow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ ur_result_t MsanShadowMemoryGPU::Setup() {
// To reserve very large amount of GPU virtual memroy, the pStart param should be beyond
// the SVM range, so that GFX driver will automatically switch to reservation on the GPU
// heap.
const void *StartAddress = (void *)(0x100'0000'0000'0000ULL);
const void *StartAddress = (void *)GetStartAddress();
// TODO: Protect Bad Zone
auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve(
Context, StartAddress, ShadowSize, (void **)&ShadowBegin);
Expand Down
4 changes: 4 additions & 0 deletions source/loader/layers/sanitizer/msan/msan_shadow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ struct MsanShadowMemoryGPU : public MsanShadowMemory {

virtual size_t GetShadowSize() = 0;

virtual uptr GetStartAddress() { return 0; }

private:
ur_result_t EnqueueMapShadow(ur_queue_handle_t Queue, uptr Ptr, uptr Size,
std::vector<ur_event_handle_t> &EventWaitList,
Expand Down Expand Up @@ -133,6 +135,8 @@ struct MsanShadowMemoryPVC final : public MsanShadowMemoryGPU {
uptr MemToShadow(uptr Ptr) override;

size_t GetShadowSize() override { return 0x8000'0000'0000ULL; }

uptr GetStartAddress() override { return 0x100'0000'0000'0000ULL; }
};

/// Shadow Memory layout of GPU DG2 device
Expand Down
Loading