<div dir="ltr">Even if it's using CPU for OCL (I know it's not doing this), why does memcpy on CPU slow down permanently, if I'm not doing anything with OpenCL after clCreateContext?<div><br></div><div>As you see from test program it just does clCreateContext and then a loop of memcpy-s on CPU.</div><div><br></div><div><div dir="ltr">Also I found out that writing different values to /sys/class/drm/card0/device/power_dpm_force_performance_level changes my max memcpy speed on CPU:</div><div dir="ltr"><br></div><div dir="ltr">echo "low" > /sys/class/drm/card0/device/power_dpm_force_performance_level</div><span class="gmail-im" style="color:rgb(80,0,80)"><div dir="ltr">./cl_slow_test 1 5</div><div dir="ltr">got 1 platforms 1 devices</div></span><div dir="ltr">speed 731.810425 avg 731.810425 mbytes/s</div><div dir="ltr">speed 163.425583 avg 447.618011 mbytes/s</div><div dir="ltr">speed 123.441612 avg 339.559235 mbytes/s</div><div dir="ltr">speed 121.655266 avg 285.083252 mbytes/s</div><div dir="ltr">speed 123.806801 avg 252.827972 mbytes/s</div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr">echo "high" > /sys/class/drm/card0/device/power_dpm_force_performance_level</div></div><span class="gmail-im" style="color:rgb(80,0,80)"><div dir="ltr">./cl_slow_test 1 5</div><div dir="ltr">got 1 platforms 1 devices</div></span><div dir="ltr">speed 3742.063721 avg 3742.063721 mbytes/s</div><div dir="ltr">speed 836.148987 avg 2289.106445 mbytes/s</div><div dir="ltr">speed 189.379166 avg 1589.197266 mbytes/s</div><div dir="ltr">speed 189.271393 avg 1239.215820 mbytes/s</div><div dir="ltr">speed 188.290451 avg 1029.030762 mbytes/s</div><div><br></div><div>echo "profile_standard" > /sys/class/drm/card0/device/power_dpm_force_performance_level<br></div><div><span class="gmail-im" style="color:rgb(80,0,80)"><div>./cl_slow_test 1 5</div><div>got 1 platforms 1 devices</div></span><div>speed 2303.955566 avg 2303.955566 mbytes/s</div><div>speed 2298.224121 avg 2301.089844 mbytes/s</div><div>speed 2295.585205 avg 2299.254883 mbytes/s</div><div>speed 2295.762939 avg 2298.381836 mbytes/s</div><div>speed 2288.766602 avg 2296.458740 mbytes/s</div></div><div><br></div><div> echo "profile_peak" > /sys/class/drm/card0/device/power_dpm_force_performance_level<br></div><div><span class="gmail-im" style="color:rgb(80,0,80)"><div>./cl_slow_test 1 5</div><div>got 1 platforms 1 devices</div></span><div>speed 3710.360352 avg 3710.360352 mbytes/s</div><div>speed 3713.660400 avg 3712.010254 mbytes/s</div><div>speed 3797.630859 avg 3740.550537 mbytes/s</div><div>speed 3708.004883 avg 3732.414062 mbytes/s</div><div>speed 3796.403076 avg 3745.211914 mbytes/s</div></div><div><br></div><div>However none of those is close to the memcpy speed I get when I don't do clCreateContext (my test prog has first arg 0):</div><div><div>./cl_slow_test 0 5</div><div>speed 7299.201660 avg 7299.201660 mbytes/s</div><div>speed 9298.841797 avg 8299.021484 mbytes/s</div><div>speed 9360.181641 avg 8652.742188 mbytes/s</div><div>speed 9004.759766 avg 8740.746094 mbytes/s</div><div>speed 9414.607422 avg 8875.518555 mbytes/s</div></div></div><div><br></div><div>Also attached clinfo.txt. It shows that opencl is using GPU so device node permissions are probably not the issue. </div><div><br></div><div>--</div><div>Lauri</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 8, 2019 at 10:35 PM Alex Deucher <<a href="mailto:alexdeucher@gmail.com">alexdeucher@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I think you are probably using the CPU for OCL in the remote login<br>
case. When you log into the desktop, the permissions on the device<br>
nodes get changed dynamically to support accelerated rendering. You<br>
probably need to change the permissions on the device nodes manually<br>
if you are not logging into the desktop.<br>
<br>
Alex<br>
<br>
On Fri, Mar 8, 2019 at 2:43 PM Lauri Ehrenpreis <<a href="mailto:laurioma@gmail.com" target="_blank">laurioma@gmail.com</a>> wrote:<br>
><br>
> Hi!<br>
><br>
> I am using Ryzen 2400G with Gigabyte AMD B450 AORUS board. I have latest bios, ubuntu 18.04 and latest mainline kernel (5.0.0-050000-generic) installed. Also I have rocm-dev 2.1.96 but no rock-dkms installed.<br>
><br>
> I found that when I log in over ssh and try to use OpenCL (doing clCreateContext is enough) then cpu memory accesses after that will slow down by 100x.<br>
> If I connect HDMI cable and log in to desktop mode then this does not happen. Also if I don't call clCreateContext then everything works properly.<br>
><br>
> Attached the test program and kernel log also. Test works like that :<br>
> g++ cl_slow_test.cpp -o cl_slow_test -I /opt/rocm/opencl/include/ -L /opt/rocm/opencl/lib/x86_64/ -lOpenCL<br>
> lauri@rv:~$ ./cl_slow_test 0 5<br>
> speed 7003.145508 avg 7003.145508 mbytes/s<br>
> speed 8427.357422 avg 7715.251465 mbytes/s<br>
> speed 9203.049805 avg 8211.184570 mbytes/s<br>
> speed 9845.956055 avg 8619.877930 mbytes/s<br>
> speed 9882.748047 avg 8872.452148 mbytes/s<br>
> lauri@rv:~$ ./cl_slow_test 1 5<br>
> got 1 platforms 1 devices<br>
> speed 1599.803589 avg 1599.803589 mbytes/s<br>
> speed 1665.426392 avg 1632.614990 mbytes/s<br>
> speed 146.137253 avg 1137.122437 mbytes/s<br>
> speed 121.056877 avg 883.106018 mbytes/s<br>
> speed 122.428970 avg 730.970581 mbytes/s<br>
><br>
> I also tried latest amd-staging kernel <a href="https://github.com/M-Bab/linux-kernel-amdgpu-binaries" rel="noreferrer" target="_blank">https://github.com/M-Bab/linux-kernel-amdgpu-binaries</a> and it had the same issue.<br>
><br>
> Can anyone point me into right direction?<br>
><br>
> Br,<br>
> Lauri<br>
> _______________________________________________<br>
> amd-gfx mailing list<br>
> <a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</blockquote></div>