Installing ROCm

I’m trying to install ROCm 6.1 by following SDB:AMD GPGPU - openSUSE Wiki

In particular I did

$ zypper ar -f -g -n "ROCm 6.1" https://repo.radeon.com/rocm/zyp/6.1/main/ ROCm-6.1

However the actual install command fails:

$ sudo zypper in rocm6.1.0

Problem: 1: nothing provides 'libpython3.6m.so.1.0()(64bit)' needed by the to be installed rocm-gdb6.1.0-14.1.60100-sles154.82.x86_64
 Solution 1: do not install rocm6.1.0-6.1.0.60100-sles154.82.x86_64
 Solution 2: break rocm-gdb6.1.0-14.1.60100-sles154.82.x86_64 by ignoring some of its dependencies

Any idea where to get python 3.6 required for ROCm? Thanks!

This seems to be for SLES 15.4?

Well, it is for SLES, but there are no other rocm repos for SUSE: Index of /rocm/zyp/latest/main/ I assume they should be compatible with OpenSUSE and they are referenced in the OpenSUSE wiki.

Edit: there is this mention in the wiki though:

ROCm packaged by AMD is available for openSUSE Leap (SUSE SLE), for Tumbleweed compile it by yourself.

So perhaps I need to compile it myself.

If you are on Tumbleweed this won’t work.

You can, as you said, compile it yourself.

Alternatively you could setup a distrobox with leap or, to make your life even easier, ubuntu and just do whatever you need to in there - with the added benefit of not messing with your base system should anything go awry.

2 Likes

Why you recommend Ubuntu here? Leap has the same level of support. The only difference is new Ubuntu releases get earlier ROCm support for new hardware (advantage is about 1 - 2 months).

1 Like

Thanks, this will be a preferred option indeed. I suppose that GPU pass-through should work right away because distrobox containers share the same kernel?

Not quite. Whatever driver you need, such as amdgpu you’ll need to install inside the distrobox. But no gpu passthrough needed, no.

Isn’t amdgpu part of the Linux kernel? Or you mean Mesa?

As i said, he can use Leap too. But depending on what he intendes to do, ubuntu will likely be easier as some things might require extra steps on leap than on ubuntu. Such as Stable Diffusion.

I mean AMD’s own amdgpu driver with ROCm support separate from Mesa. I dont know what you intend to do, but you might need that one instead of Mesa.

What?
Amdgpu driver is a part of Linux kernel. TW uses newer kernel than Leap, so https://repo.radeon.com/ provides older amdgpu driver than needed for TW.
For ROCm user needs amdgpu and amdkfd drivers.

https://docs.kernel.org/gpu/amdgpu/index.html

Sorry, my wording was confusing.
I meant to say that they will have to install the amdgpu ROCm drivers(which arent part of mesa or the amdgpu kernel driver) inside the distrobox using the appropriate ubuntu or leap specific linked amdgpu-install script repo since he already installed ROCm on the host as per his first post.

Parts of AMD ROCm (HIP & others) are available on Tumbleweed:

Do you have found a solution to install rocm 6.1? I need that, because Ollama need rocm in a version equal or greater than 6.0.

Hey, the solutions are the ones provided in this thread:

  • follow @Svyatko 's suggestion and add the ROCm repo and see if that has all you need(if you are using tumbleweed)

  • use the amdgpu-install script to install ROCm on your system directly(if you are using Leap)

  • use distrobox with a supported distro of your choice (Leap/SUSE, Ubuntu or Rhel) and use the amdgpu-install script

Personally, i’d pick distrobox. But all options provided are valid.

1 Like

Well it certainly depends on what you need, but if you don’t need the GPU driver then I recommend checking out my little tutorial for distrobox:

I tested it with version 6.0

That is basically the sole reason I started using distrobox for something like ROCm, where so much changes all the time.

Ollama requires CUDA 5.0+.
You can use older ROCm (5.7) with ZLUDA to get CUDA support.

I have compiled zluda and after that I try ollama with

LD_LIBRARY_PATH="/home/USER/projects/zluda/target/release:$LD_LIBRARY_PATH" ollama serve

This was the result:

time=2024-05-07T23:37:05.409+02:00 level=INFO source=payload.go:41 msg="Dynamic LLM libraries [cpu cpu_avx cpu_avx2]"
time=2024-05-07T23:37:05.409+02:00 level=INFO source=gpu.go:121 msg="Detecting GPU type"
time=2024-05-07T23:37:05.409+02:00 level=INFO source=gpu.go:268 msg="Searching for GPU management library libcudart.so*"
time=2024-05-07T23:37:05.411+02:00 level=INFO source=gpu.go:314 msg="Discovered GPU libraries: []"
time=2024-05-07T23:37:05.411+02:00 level=INFO source=gpu.go:268 msg="Searching for GPU management library libnvidia-ml.so"
time=2024-05-07T23:37:05.412+02:00 level=INFO source=gpu.go:314 msg="Discovered GPU libraries: [/home/USER/projects/zluda/target/release/libnvml.so]"
time=2024-05-07T23:37:05.414+02:00 level=INFO source=gpu.go:137 msg="Nvidia GPU detected via nvidia-ml"
time=2024-05-07T23:37:05.414+02:00 level=INFO source=cpu_common.go:11 msg="CPU has AVX2"
time=2024-05-07T23:37:05.414+02:00 level=INFO source=gpu.go:179 msg="[nvidia-ml] error looking up NVML GPU compute capability: device compute capability lookup failure 0: 3"
time=2024-05-07T23:37:05.414+02:00 level=INFO source=routes.go:1164 msg="no GPU detected"

But during the compilation of zluda I have to install many packages from the rocm-6.1 repository. And now it works with rocm. If I call this:

ollama serve

I get that:

time=2024-05-07T23:42:00.298+02:00 level=INFO source=amd_linux.go:88 msg="detected amdgpu versions [gfx1100]"
time=2024-05-07T23:42:00.305+02:00 level=INFO source=amd_linux.go:121 msg="amdgpu [0] gfx1100 is supported"
time=2024-05-07T23:42:00.305+02:00 level=INFO source=amd_linux.go:263 msg="[0] amdgpu totalMemory 20464M"
time=2024-05-07T23:42:00.305+02:00 level=INFO source=amd_linux.go:264 msg="[0] amdgpu freeMemory  20464M"

Thanks at all :slight_smile: