1.Download latest linux 4.12.10 from kernel.org
2.Apply patches from here:
https://patchwork.freedesktop.org/project/amd-xorg-ddx/series/?ordering=-last_updated( more advanced way)
3.Compile kernel -> the ubuntu way.
4.Install kernel using dpkg
5. Download amdgpu-pro-17.30 latest, unarchive and edit amdgpu-pro-install, under the --compute function remove amdgpu-pro-dkms.
6. Exec ./amdgpu-pro-install --compute to install only opencl and libdrm
7. dpkg -x amdgpu-pro-dkms.... /out; cd out/usr/src/amdgpu-pro/lib/firmware && rm /lib/firmware/amdgpu/* && cp * /lib/firmware/amdgpu
8. add amdgpu.vm_fragment_size=9 to /etc/default/grub as stated in previous posts.
8.1. add if you are using user to video group usermod -a -G video $user
9. update-grub && update-initramfs -u
10. Reboot and mine.
Is a real reason to build new kernel such as performance or stability issues?
Since I wasn't sure what patches to apply, I used a mix of both ways:
1. Installed not whole rocm package but only kernel image and headers 4.11 from rocm repository.
2. Installed compute-only 17.30 amd driver as recommended above (without dkms).
3. Added amdgpu module option.
Still there are issues with very slow boot (known issue if VBIOS was patched). But it runs.
Is 4.12 kernel somehow better?
Thanks laik2, I built linux from the git:linux-master and it works.
--
ROCm does not work for my rig with A + N on it.
Therefore, I did laik2 way to build a new kernel for my rig.
However, I found that linux-4.12.10 even linux-4.13.x from linux.org does not support vm_fragment.
There is no vm_fragment member in ./drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c.
And I don't know which patches to be applied from patchwork.freedesktop.org.
Finally, I google "linux amdgp vm_fragment_size", github.com/torvalds comes out.
What to do is just download linux from github.com/torvalds and buid and run laik2 steps.
And everything works perfect.
Thanks~