<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div class="WordSection1">
<p class="MsoNormal">Hi Michel,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Could you try the patch again ?  That work for me.<o:p></o:p></p>
<p class="MsoNormal"><a href="https://patchwork.freedesktop.org/patch/549605/">https://patchwork.freedesktop.org/patch/549605/</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks<o:p></o:p></p>
<p class="MsoNormal">Jesse<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org>
<b>On Behalf Of </b>Zhang, Jesse(Jie)<br>
<b>Sent:</b> Thursday, July 27, 2023 2:11 PM<br>
<b>To:</b> Yang, Philip <Philip.Yang@amd.com>; Michel Dänzer <michel@daenzer.net>; Yang, Philip <Philip.Yang@amd.com><br>
<b>Cc:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; Kuehling, Felix <Felix.Kuehling@amd.com>; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> RE: [PATCH 28/29] drm/amdkfd: Refactor migrate init to support partition switch<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:5.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:blue">[AMD Official Use Only - General]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p style="margin:5.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:blue">[AMD Official Use Only - General]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi Philip and Michel,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The following issue can reproduce on my side. <o:p></o:p></p>
<p class="MsoNormal"><a href="https://gitlab.freedesktop.org/drm/amd/-/issues/2659">https://gitlab.freedesktop.org/drm/amd/-/issues/2659</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">when load gpu driver , disable iommu  can workaround this issue.<o:p></o:p></p>
<p class="MsoNormal">sudo modprobe amdgpu ignore_crat=1<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks<o:p></o:p></p>
<p class="MsoNormal">Jesse<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>From:</b> amd-gfx <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">amd-gfx-bounces@lists.freedesktop.org</a>>
<b>On Behalf Of </b>Philip Yang<br>
<b>Sent:</b> Tuesday, July 25, 2023 4:04 AM<br>
<b>To:</b> Michel Dänzer <<a href="mailto:michel@daenzer.net">michel@daenzer.net</a>>; Yang, Philip <<a href="mailto:Philip.Yang@amd.com">Philip.Yang@amd.com</a>><br>
<b>Cc:</b> Deucher, Alexander <<a href="mailto:Alexander.Deucher@amd.com">Alexander.Deucher@amd.com</a>>; Kuehling, Felix <<a href="mailto:Felix.Kuehling@amd.com">Felix.Kuehling@amd.com</a>>;
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<b>Subject:</b> Re: [PATCH 28/29] drm/amdkfd: Refactor migrate init to support partition switch<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hi Michel,<o:p></o:p></p>
<p>Please check if this patch "drm/amdkfd: start_cpsch don't map queues" can fix the driver loading ring test failed issue on your system, I am still not able to repro the issue.<o:p></o:p></p>
<p>Regards,<o:p></o:p></p>
<p>Philip<o:p></o:p></p>
<div>
<p class="MsoNormal">On 2023-07-21 09:30, Philip Yang wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 2023-07-21 04:55, Michel Dänzer wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>On 7/20/23 22:48, Philip Yang wrote:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>On 2023-07-20 06:46, Michel Dänzer wrote:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>On 7/17/23 15:09, Michel Dänzer wrote:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>On 5/10/23 23:23, Alex Deucher wrote:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>From: Philip Yang <a href="mailto:Philip.Yang@amd.com"><Philip.Yang@amd.com></a><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Rename smv_migrate_init to a better name kgd2kfd_init_zone_device<o:p></o:p></pre>
<pre>because it setup zone devive pgmap for page migration and keep it in<o:p></o:p></pre>
<pre>kfd_migrate.c to access static functions svm_migrate_pgmap_ops. Call it<o:p></o:p></pre>
<pre>only once in amdgpu_device_ip_init after adev ip blocks are initialized,<o:p></o:p></pre>
<pre>but before amdgpu_amdkfd_device_init initialize kfd nodes which enable<o:p></o:p></pre>
<pre>SVM support based on pgmap.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>svm_range_set_max_pages is called by kgd2kfd_device_init everytime after<o:p></o:p></pre>
<pre>switching compute partition mode.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Signed-off-by: Philip Yang <a href="mailto:Philip.Yang@amd.com"><Philip.Yang@amd.com></a><o:p></o:p></pre>
<pre>Reviewed-by: Felix Kuehling <a href="mailto:Felix.Kuehling@amd.com"><Felix.Kuehling@amd.com></a><o:p></o:p></pre>
<pre>Signed-off-by: Alex Deucher <a href="mailto:alexander.deucher@amd.com"><alexander.deucher@amd.com></a><o:p></o:p></pre>
</blockquote>
<pre>I bisected a regression to this commit, which broke HW acceleration on this ThinkPad E595 with Picasso APU.<o:p></o:p></pre>
</blockquote>
<pre>Actually, it doesn't seem to break HW acceleration completely. GDM eventually comes up with HW acceleration, it takes a long time (~30s or so) to start up though.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Later, the same messages as described in <a href="https://gitlab.freedesktop.org/drm/amd/-/issues/2659">https://gitlab.freedesktop.org/drm/amd/-/issues/2659</a> appear.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Reverting this commit fixes all of the above symptoms.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>I reproduced all of the above symptoms with amd-staging-drm-next commit 75515acf4b60 ("i2c: nvidia-gpu: Add ACPI property to align with device-tree") as well.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>For full disclosure, I use these kernel command line arguments:<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> fbcon=font:10x18 drm_kms_helper.drm_fbdev_overalloc=112 amdgpu.noretry=1 amdgpu.mcbp=1<o:p></o:p></pre>
</blockquote>
<pre>Thanks for the issue report and full disclosure, but I am not able to reproduce this issue, with both drm-next branch and amd-staging-drm-next branch tip on gitlab. The test system has same device id, running Ubuntu 22.04, latest linux-firmware-20230625.tar.gz, and same BIOS version.<o:p></o:p></pre>
</blockquote>
<pre>FWIW, your system has PCI revision ID 0xC2, while mine has 0xC1.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Also, I'm currently using linux-firmware 20230515. AFAICT there are no relevant changes in 20230625, but I'm attaching the contents of /sys/kernel/debug/dri/0/amdgpu_firmware_info just in case.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>I attached full dmesg log, could you help check if there is other difference, maybe kernel config, gcc version... it is hard to guess what could cause the basic driver gfx ring IB test timeout.<o:p></o:p></pre>
</blockquote>
<pre>I suspect the IOMMU page faults logged in my dmesg might be relevant:<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> amdgpu: Topology: Add APU node [0x15d8:0x1002]<o:p></o:p></pre>
<pre> amdgpu 0000:05:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x122201800 flags=0x0070]<o:p></o:p></pre>
<pre> amdgpu 0000:05:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x1125fe380 flags=0x0070]<o:p></o:p></pre>
<pre> kfd kfd: amdgpu: added device 1002:15d8<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>There are no such page faults with the commit reverted.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Other than that and the IB test failure messages, our dmesg outputs are mostly identical indeed.<o:p></o:p></pre>
</blockquote>
<p>Yes, I don't have IO_PAGE_FAULT message on my system, thanks for the finding, I will continue investigating the root cause.
<o:p></o:p></p>
<p>You are right, the error message could cause gfx ring IB test timeout failure, this patch does change the order of driver memory allocation. IOMMU is in translation mode on Ubuntu config.<o:p></o:p></p>
<p>To help confirm if this is caused by IOMMU, please add this to kernel boot option to set IOMMU to passthrough mode, check if this can workaround the issue<o:p></o:p></p>
<p>iommu=pt<o:p></o:p></p>
<p>Regards,<o:p></o:p></p>
<p>Philip<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>