Public bug reported:

[Impact]

On AMD GPUs using MES (Micro Engine Scheduler), queue suspension does
not perform a heavy-weight TLB invalidation. This allows DMA descriptors
to access memory that has already been unmapped, causing page faults and
GPU queue hangs during SVM (Shared Virtual Memory) page migration.

Observed as KFDSVMRangeTest.MultiTHreadMigrationTest failures on gfx1151
(Strix Point) with XNACK mode 1 enabled: the runtime queue hangs with
packets submitted but never consumed.

[Fix]

As suggested by the AMD team: upstream commit 
(https://lore.kernel.org/amd-gfx/[email protected]/) 
(amd-gfx mailing list, Priya Hosur): 
"drm/amdkfd: Add TLB flush after MES queue eviction/suspension"
Message-Id: <[email protected]>       
                                                               
Adds kfd_flush_tlb() calls after MES queue removal in:         
- evict_process_queues_cpsch()                                 
- suspend_queues() (with mem_fence barrier)                    

This ensures all in-flight memory accesses from unmapped queues are
completed/flushed before the underlying memory is freed or fully
migrated.


[Where problems could occur]
This change adds and extra kfd_flush_tlb() fall, gated behind 
dqp->dev->kfd->shared_resources.enable_mes, which means it only affects MES 
enabled devices from newer AMD GPU generations. The risk is limited to a 
possible minor latency increase during queue suspension on MES enabled 
hardware. 

[Other Info]
Patch is currently in review upstream, not yet merged into the Linus' tree. 
Requesting it to be tracked once it lands, or considered for inclusion in 
Ubuntu kernel.
Change-Id: Iaa884d4a7ad1199446bc45f4ad8a9a179ab386e6

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2164934

Title:
  [SRU] Add TLB flush after MES queue eviction/suspension in amdkfd
  (fixes GPU hang on SVM migration, gfx1151/Strix Point)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2164934/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to