# [SOLVED] Anyway to install Radeon VII driver? opencl support

## TigerJr

Im not newbie in gentoo, but than i try to install Radeon VII card i didn't find driver sources, only debian or rpms. 

Want to try on linux-kernel-4.16.xxx 

Anyone can help?

----------

## Ant P.

Support for Vega20/VII was added in kernel 4.20.

----------

## Hu

 *TigerJr wrote:*   

> Want to try on linux-kernel-4.16.xxx 

 Why use this line?  This is not an LTS series, and is abandoned upstream.

----------

## TigerJr

 *Quote:*   

> Why use this line? This is not an LTS series, and is abandoned upstream.

 

On another forum written that support added from 4.15 kernel

Thanks for a tips. I will try 4.20. Checked LTS today 4.19.45 and stable 5.0.18 what should i do?

But I'm afraid that without the official driver will not work all functions. There is no sources or binary installers, only deb or rpms on amd support page...   :Evil or Very Mad: 

----------

## Hu

If support was added in 4.15, then I would interpret that to mean that the source code for an acceptable driver was merged into Linus' v4.15 release, so any subsequent release should have in-tree support and there should be no need for an external installer.  For new hardware like this, I would suggest tracking the latest stable kernel (v5.1.x as of this writing), on the assumption that there may still be fixes/improvements being added.

----------

## TigerJr

 *Hu wrote:*   

> If support was added in 4.15, then I would interpret that to mean that the source code for an acceptable driver was merged into Linus' v4.15 release, so any subsequent release should have in-tree support and there should be no need for an external installer.  For new hardware like this, I would suggest tracking the latest stable kernel (v5.1.x as of this writing), on the assumption that there may still be fixes/improvements being added.

 

Ok, i can try modern kernel. Thanks anyway))

----------

## TigerJr

Didn't work opencl, trying to install amdgpu-pro-opencl make fault

```
>>> Emerging (19 of 19) dev-libs/amdgpu-pro-opencl-18.20.684755::gentoo

!!! dev-libs/amdgpu-pro-opencl-18.20.684755 has fetch restriction turned on.

!!! This probably means that this ebuild's files must be downloaded

!!! manually.  See the comments in the ebuild for more information.

 * Fetch failed for 'dev-libs/amdgpu-pro-opencl-18.20.684755', Log file:

 *  '/var/tmp/portage/dev-libs/amdgpu-pro-opencl-18.20.684755/temp/build.log'

 * Please download the Radeon Software for Linux Driver 18.20 for Ubuntu 16 from

 *     https://support.amd.com/en-us/kb-articles/Pages/Radeon-Software-for-Linux-Release-Notes.aspx

 * The archive should then be placed into your distfiles directory.

>>> Failed to emerge dev-libs/amdgpu-pro-opencl-18.20.684755, Log file:

>>>  '/var/tmp/portage/dev-libs/amdgpu-pro-opencl-18.20.684755/temp/build.log'
```

[Moderator edit: added [code] tags to preserve output layout. -Hu]

----------

## argen

Do what the error message says and download from https://support.amd.com/en-us/kb-articles/Pages/Radeon-Software-for-Linux-Release-Notes.aspx (it wants the https://www2.ati.com/drivers/linux/amdgpu-pro-18.20-684755-ubuntu-16.04.tar.xz file) and place it in /usr/portage/distfiles.

Are you sure you need the proprietary drivers? In most cases the open source amdgpu driver is nearly the same performance. OpenCL can be enabled with mesa[opencl].

----------

## TigerJr

im recompiled mesa for radeon and radeonsi with opencl use flag

```
[U] media-libs/mesa

     Available versions:  18.3.6^t ~19.0.2^t ~19.0.3^t ~19.0.4^t ~19.0.5^t ~19.1.0_rc1^t ~19.1.0_rc2^t ~19.1.0_rc3^t **9999^t {+classic d3d9 debug +dri3 +egl +gallium +gbm gles1 +gles2 +libglvnd +llvm lm_sensors opencl osmesa pax_kernel pic selinux test unwind vaapi valgrind vdpau vulkan vulkan-overlay wayland xa xvmc ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32" VIDEO_CARDS="freedreno i915 i965 imx intel iris nouveau r100 r200 r300 r600 radeon radeonsi vc4 virgl vivante vmware"}

     Installed versions:  18.1.6^d(12:27:35 05/29/19)(classic dri3 egl gallium gbm gles2 llvm nptl opencl osmesa vdpau wayland xa xvmc -bindist -d3d9 -debug -gles1 -openmax -pax_kernel -pic -selinux -unwind -vaapi -valgrind -vulkan ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" VIDEO_CARDS="radeon radeonsi -freedreno -i915 -i965 -imx -intel -nouveau -r100 -r200 -r300 -r600 -vc4 -virgl -vivante -vmware")

     Homepage:            https://www.mesa3d.org/ https://mesa.freedesktop.org/

     Description:         OpenGL-like graphic library for Linux

```

made eselect opencl set mesa

but application didn't see opencl support, maybe i did sommething wrong?

----------

## argen

Hmm maybe I was wrong. Mesa might not support the VII yet. Try amdgpu-pro-opencl by downloading the ubuntu 16 tarball and placing it in /usr/portage/distfiles.

----------

## TigerJr

 *argen wrote:*   

> Do what the error message says and download from https://support.amd.com/en-us/kb-articles/Pages/Radeon-Software-for-Linux-Release-Notes.aspx (it wants the https://www2.ati.com/drivers/linux/amdgpu-pro-18.20-684755-ubuntu-16.04.tar.xz file) and place it in /usr/portage/distfiles.
> 
> Are you sure you need the proprietary drivers? In most cases the open source amdgpu driver is nearly the same performance. OpenCL can be enabled with mesa[opencl].

 

I can't find that file, site drops me on the support page there i need to choose card and OS and than gives me only 19.10 revision of driver

PS

Sorry i clicked second link

----------

## argen

Oh, that's weird. I can see it. This is the link: https://www2.ati.com/drivers/linux/amdgpu-pro-18.20-684755-ubuntu-16.04.tar.xz Unless that was the link you were talking about. You can try 19.10 by unmasking amdgpu-pro-opencl-19.10 if that doesn't work?

----------

## Tony0945

Out of curiosity, I clicked the link. I got a page that said: *Quote:*   

> We’re sorry, but we were unable to complete your download. There could be several reasons for this:
> 
> You were linked to this download from a site outside of AMD.com
> 
> Since we do not allow downloads through sites outside of AMD.com, please download your file directly from our site. We want to make sure you have the right driver for your device and operating system. Choose your product and operating system on the AMD Driver Download page or use the AMD Driver Autodetect to obtain the correct driver for your device.
> ...

 

My advice, stick with the in-kernel radeon driver. Do you really want to support a site trying to out-Oracle Oracle in user unfriendliness?

----------

## TigerJr

Tony0945

Yes, i want to use mesa opencl, but i didn't know why application doesn't see opencl devices, thats why i decide to use amdgpu-pro-opencl

----------

## TigerJr

Worked then i copy all libs and files from centos rpm packages cpio (ver 18.20) to /opt/amdgpu-pro/

thanks strace utility

the problem was that amdgpu-pro-opencl-18.20.684755.ebuild didn't install these files if mesa was build with opencl support

now mesa with opencl support and proprietary drivers those worked with application

eselect opencl set mesa - now makes nothing, application still need /opt/amdgpu-pro/lib64/libamdocl12cl64.so

----------

## TigerJr

Quite easy power management and overclocking with downvolting(shiftig) on 7nm chips via sysfs on amdgpu-pro drivers

Just start kernel via bootloader with these option amdgpu.ppfeaturemask=0xffff7fff i.e.

```
kernel /boot/vmlinuz-5.xx.xx-gentoo amdgpu.ppfeaturemask=0xffff7fff root=/dev/sda1
```

after that you can get simple sysfs file 

/sys/class/drm/card0/device/pp_od_clk_voltage

that file can change mem clock settings and gpu clock and even voltage curve setting  in compatible range 

Just read kernel documentation in that source:

/usr/src/linux/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c

sources show that i can write changes and commit them like:

```

#!/bin/bash

echo 's 1 1900' > /sys/class/drm/card0/device/pp_od_clk_voltage

echo 'm 1 1100' > /sys/class/drm/card0/device/pp_od_clk_voltage

echo 'c' > /sys/class/drm/card0/device/pp_od_clk_voltage

```

or reset values

```

#!/bin/bash

echo 'r' > /sys/class/drm/card0/device/pp_od_clk_voltage

echo 'c' > /sys/class/drm/card0/device/pp_od_clk_voltage

```

It's very easy and makes tune scripts are quite powerfu i.e. 

you can get power, gpu voltage and temperature:

```
#!/bin/bash

cat  /sys/class/drm/card0/device/hwmon/hwmon0/power1_average

cat  /sys/class/drm/card0/device/hwmon/hwmon0/in0_input

cat  /sys/class/drm/card0/device/hwmon/hwmon0/temp1_input
```

----------

