FreeBSD Status Report

Report Entry

ROCm Support on FreeBSD

Contact: Sourojeet Adhikari <siri@racha.ca>

ROCm is AMD’s compute platform, which is the set of libraries, drivers, and tooling used to program their AI accelerators, and/or GPUs. On FreeBSD there are only a few ways to run compute workloads (AI/ML, graphics, and so on) on the GPU, and to my knowledge those are Vulkan and OpenGL. Both are fine for graphics, and sometimes machine learning too, but a lot of workloads are just not well suited to them, and end up being done in ROCm or CUDA instead, since those give the developer a lot more control over how the task is actually executed.

So I have been slowly porting the ROCm toolchain over to FreeBSD, which would let the AI accelerator ecosystem run natively here.

Most of my time recently has been spent getting rocr-runtime working from my rocm-systems fork, whilst upstreaming the changes needed in the FreeBSD kernel. Once the kernel side is done, I can merge the amdkfd code into drm-kmod (after a lot of cleaning up), and from there it is mostly a matter of time getting the remaining pieces of rocr-runtime running.

Work completed

  • amdkfd driver

    • The amdkfd driver now compiles, links, and loads.

    • Ported the v11 platform files for certain AMDGPU generations.

    • /dev/kfd is now exposed, and interactable.

    • Cleaned up undefined symbols which are not used as of now.

  • ROCm systems

    • Fixed initialisation issues.

    • Refactoring all changes before doing a large upstream push of code which can be upstreamed.

  • FreeBSD kernel

    • The linux/util_macros.h` (D57465) has been committed to the kernel.

    • Added jiffies64_to_msecs (D58075) has been committed to the kernel.

    • Added compat_ptr_ioctl (D58076) has been committed to the kernel.

    • Added tgid to task_struct under LinuxKPI (D58228) has been committed to the kernel.

    • Various other LinuxKPI-related changes are still under review (D58207, D58222, D58845, D60275).

There have been about two pull requests accepted to rocm-systems, otherwise I am still working on the large one which merges in FreeBSD support. That code has not been completed yet, so I have not opened it.

Work in progress

  • Fixing initialisation issues in rocr-runtime, and working through whatever else shows up once it runs further.

  • Getting the large rocm-systems pull request finished and opened upstream.

  • Fixing issues with Sysfs within amdkfd. Still diagnosing issues, and figuring out what exactly the issue is.

Help needed

  • Support for RDNA 1 and RDNA 2: I had commented/stubbed out all the structs and functions related to RDNA 1 and 2, because I do not have the cards, nor the time right now to test them properly. If you have the cards and the time to test them, please reach out and I can tell you exactly how to do it.

This work has been sponsored by The FreeBSD Foundation! Thank you to the FreeBSD Foundation!!

Sponsor: The FreeBSD Foundation


Last modified on: November 9, 2026 by Lorenzo Salvadore