<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div style="margin: 0;">Hi alex/guys:</div><div style="margin: 0;"><span style="background-color: rgb(119, 201, 75);"> <span style="background-color: rgb(119, 201, 75); font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">No such situation exists. there is always a rendernode.</span></span></div><div><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">=======></span></div><div><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">if so, why the logic in function "</span><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px;">kfd_process_device_init_vm" has a situation that in consideration of the "drm render file" not exsists? and even im "</span><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;">kfd_bind_process_to_device" therea are lazy vm conetxt binding " </span></font><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px; color: rgb(83, 139, 215);">err = kfd_process_device_init_vm(pdd, </span></font><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px; color: rgb(83, 139, 215); background-color: rgb(158, 15, 48);">NULL</span></font><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px; color: rgb(83, 139, 215);">)</span></font><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;">;" which pass NULL pointer as drm file directly ? if so , can the another path on scenario drm_file empty "</span></font><span style="background-color: rgb(158, 15, 48); color: rgb(83, 139, 215); font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px;">amdgpu_amdkfd_gpuvm_create_process_vm" call is redundant? </span></div><div><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;"><br></span></div><div><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">Thank you!</span></div><div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;">774 int kfd_process_device_init_vm(struct kfd_process_device *pdd,</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 775 ¦ struct file *drm_file)</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 776 { </span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 777 struct kfd_process *p;</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 778 struct kfd_dev *dev;</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 779 int ret;</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 780 </span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 781 if (pdd->vm)</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 782 return drm_file ? -EBUSY : 0;</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 783 </span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 784 p = pdd->process;</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 785 dev = pdd->dev;</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 786 </span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 787 </span></font><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px; background-color: rgb(221, 64, 50);"> if (drm_file)</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 788 ret = amdgpu_amdkfd_gpuvm_acquire_process_vm(</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 789 dev->kgd, drm_file, p->pasid,</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 790 &pdd->vm, &p->kgd_process_info, &p->ef);</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 791 else</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px; color: rgb(83, 139, 215); background-color: rgb(158, 15, 48);"> 792 ret = amdgpu_amdkfd_gpuvm_create_process_vm(dev->kgd, p->pasid,</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px; color: rgb(83, 139, 215); background-color: rgb(158, 15, 48);"> 793 &pdd->vm, &p->kgd_process_info, &p->ef);</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 794 if (ret) {</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 795 pr_err("Failed to create process VM object\n");</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 796 return ret;</span></font></div><div style=""><font face="Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif"><span style="font-size: 16px;"> 797 }</span></font></div><div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;"><br></div></div><p style="margin: 0;"><br></p><p style="margin: 0;"><br></p><p style="margin: 0;"><br></p><p style="margin: 0;"><br></p><div style="position:relative;zoom:1"></div><div id="divNeteaseMailCard"></div><p style="margin: 0;"><br></p><p>At 2024-03-06 22:45:13, "Deucher, Alexander" <Alexander.Deucher@amd.com> wrote:</p><blockquote id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
<div dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#008000;margin:15pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
No such situation exists. there is always a rendernode.</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Alex</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> 曹子龙 <gainerying@163.com><br>
<b>Sent:</b> Wednesday, March 6, 2024 12:25 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; Yat Sin, David <David.YatSin@amd.com>; Kuehling, Felix <Felix.Kuehling@amd.com><br>
<b>Subject:</b> Re:RE: Why has to offer "/dev/drv/render128" fd when running ROCm demo?</font>
<div> </div>
</div>
<div>
<div style="line-height:1.7; color:#000000; font-size:14px; font-family:Arial">
<div style="margin:0">Hi felix:</div>
<div style="margin:0"> Thanks for your kindly help.</div>
<div style="margin:0"><br>
</div>
<div style="margin:0">i still has a question, if on a pure-compute platform, which has no /dev/dri/render node, but only with a single /dev/kfd node, how the compue scenario works since that wei have no "render" fd exists?<br>
</div>
<div style="margin:0">is such platfom(without render node) exists? </div>
<div style="margin:0"><br>
</div>
<div style="margin:0"> thanks for your kindly help.!</div>
<div style="margin:0"><br>
</div>
<div style="margin:0">BRs</div>
<div style="margin:0">zlcao.</div>
<p style="margin:0"><br>
</p>
<p style="margin:0"><br>
</p>
<p style="margin:0"><br>
</p>
<div style="zoom:1"></div>
<div id="x_divNeteaseMailCard"></div>
<p style="margin:0"><br>
</p>
<p>At 2024-03-06 04:43:30, "Kuehling, Felix" <Felix.Kuehling@amd.com> wrote:</p>
<blockquote id="x_isReplyContent" style="padding-left:1ex; margin:0px 0px 0px 0.8ex; border-left:#ccc 1px solid">
<div><style>
<!--
-->
--></style>
<div lang="EN-US" style="word-wrap:break-word">
<p align="Left" style="font-family:Arial; font-size:10pt; color:#0000FF; margin:5pt; font-style:normal; font-weight:normal; text-decoration:none">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div class="x_WordSection1">
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">I already answered this question in a reply to another email that was addressed to me:</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"> </span></p>
<p class="x_MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">The render nodes are used for CPU mapping of VRAM with mmap calls and an offset that identifies the BO. The render node also creates the GPU virtual
address space that is used by KFD to create the GPU memory mappings. Applications that use both graphics and compute can share the same GPU virtual address space in this way.</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"> </span></p>
<p class="x_MsoNormal"><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:black">Zlcao, in the future, this type of question may be better addressed to a mailing list such as amd-gfx@lists.freedesktop.org, instead of writing separately to
different maintainers.</span><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"></span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">Regards,<br>
Felix</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"> </span></p>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="x_MsoNormal"><b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"> Deucher, Alexander <Alexander.Deucher@amd.com>
<br>
<b>Sent:</b> Tuesday, March 5, 2024 3:17 PM<br>
<b>To:</b> </span><span lang="ZH-CN" style="font-size:11.0pt">曹子龙</span><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"> <gainerying@163.com>; Kuehling, Felix <Felix.Kuehling@amd.com>; Yat Sin, David <David.YatSin@amd.com><br>
<b>Subject:</b> Re: Why has to offer "/dev/drv/render128" fd when running ROCm demo?</span></p>
</div>
</div>
<p class="x_MsoNormal"> </p>
<p style="margin:5.0pt"><span style="font-size:10.0pt; font-family:"Arial",sans-serif; color:blue">[AMD Official Use Only - General]</span></p>
<p class="x_MsoNormal"> </p>
<div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Aptos",sans-serif; color:black">+ Felix, David to comment.</span></p>
</div>
<div class="x_MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="x_divRplyFwdMsg">
<p class="x_MsoNormal"><b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:black">From:</span></b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:black">
</span><span lang="ZH-CN" style="font-size:11.0pt; color:black">曹子龙</span><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:black"> <</span><a href="mailto:gainerying@163.com"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">gainerying@163.com</span></a><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:black">><br>
<b>Sent:</b> Tuesday, March 5, 2024 8:46 AM<br>
<b>To:</b> Deucher, Alexander <</span><a href="mailto:Alexander.Deucher@amd.com"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">Alexander.Deucher@amd.com</span></a><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:black">><br>
<b>Subject:</b> Why has to offer "/dev/drv/render128" fd when running ROCm demo?</span>
</p>
<div>
<p class="x_MsoNormal"> </p>
</div>
</div>
<div>
<div>
<p><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:black">Hi alexander.:</span></p>
<div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:black"> sorry for bother. but i really need some help to deal with my puzzle. </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:black">i am a freshman to AMD GPU Driver, NOW i am trying to write a simple demo to use "/dev/kfd" and do some vram alloc/free tests, but i found you must do the right
"AMDKFD_IOC_ACQUIRE_VM" ioctl comamnd before you try GPU to do vram allocation and other things. from the kfd driver code,the pre-condition to do the right "AMDKFD_IOC_ACQUIRE_VM" is to offer a "/dev/drv/render128" fd to the parameters.</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:black">so, why need to do this? kfd is used for compute, but "/dev/dri/render128" is specify to gfx usaged, why must open the "/dev/dri/render128" during the KFD compute
scenario?</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:black">thanks for your kindly help!</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:black">BRs</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:black">zlcao.</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.5pt; font-family:"Arial",sans-serif; color:black"> </span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote></div>