Skip to content
Maksim Levental edited this page Sep 24, 2024 · 11 revisions

Getting started

amdgpu

Use mainline to switch between kernels.

The most recent kernel I've gotten to work as of 08/29/24 is 6.8.8.

If you have a working amdgpu driver then you should be able to do

svcnod@sharkbox1:~$ cat /sys/devices/virtual/kfd/kfd/topology/nodes/0/properties 

and

svcnod@sharkbox1:~$ cat /sys/devices/virtual/kfd/kfd/topology/nodes/1/properties 

If you're having trouble installing because it doesn't compile/isn't compatible with some kernel version then just uninstall the headers for that kernel.

DON'T FORGET TO sudo usermod -a -G render,video $LOGNAME for whichever user needs to have access to the kfd.

If you see

rocr::core::Shared<T, rocr::core::PageAllocator<T> >::Shared(int, int) [with T = rocr::core::SharedQueue]: Assertion `allocate_ != nullptr && free_ != nullptr && "Shared object allocator is not set"' failed.

then you either forgot to do the usermod above or it hasn't stuck yet - just reboot.

ROCR-Runtime

https://github.com/nod-ai/ROCR-Runtime

Clang

To build from source you're going to need clang-19 (well currently that's what I've patched/hacked in). Easiest way to get it is using https://apt.llvm.org:

wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 19
sudo apt install libclang-19-dev libllvmlibc-19-dev

The above might not be enough (just install stuff until it works and then come back here and tell us).

Debugging

Add these to your grub boot command for way too much debug info in dmesg:

amdgpu.dyndbg=+pflm amdxdna.dyndbg=+pflm amdgpu.vm_debug=1 amdgpu.debug=1

i.e. somewhere around

linux	/boot/vmlinuz-6.8.8 root=UUID=e1f5001d-5822-4b4e-8e6f-899d62e46ff1 ro amdgpu.dyndbg=+pflm amdxdna.dyndbg=+pflm amdgpu.vm_debug=1 amdgpu.debug=1 $vt_handoff
Clone this wiki locally