Coder Social home page Coder Social logo

mblenn / amdgpu-ocl Goto Github PK

View Code? Open in Web Editor NEW
10.0 4.0 0.0 13 KB

The script packages the OpenCL part from AMDGPU-PRO into a single .deb package to enable OpenCL on Debian, Ubuntu and Mint.

License: MIT License

Shell 100.00%
amdgpu-pro amdgpu opencl linux debian-packaging boinc ubuntu driver

amdgpu-ocl's Introduction

amdgpu-ocl

WARNING

As of 14.01.2021 the script does not yet work with the new ROCr based OpenCL driver in amdgpu-pro 20.45. Since 20.45 is only required for Big Navi and known to have several issues, stick with 20.40 for Polaris, Vega and Navi.

This script extracts the OpenCL bits and bobs from the official AMDGPU-PRO driver provided by AMD. These files are then packaged into a .deb file with very few dependencies. Installing the resulting file on top of the open source amdgpu driver, you will be able to use official AMDGPU-PRO OpenCL on unsupported distributions like Ubuntu's interim releases, Debian or Mint.

Download the latest AMDGPU-PRO driver for Ubuntu and run the script with the archive as its only parameter. The archive can be in the same directory or placed elsewhere. In the later case the script copies it to the local directory.

Usage:

root@hostname:~# ./create_amdgpu-ocl-pkg.sh amdgpu-pro-20.40-1147286-ubuntu-20.04.tar.xz
Processing driver archive:
 Extracting amdgpu-pro-20.40-1147286-ubuntu-20.04.tar.xz  done
  Extracting opencl-amdgpu-pro-icd_20.40-1147286_amd64.deb done
    Extracting data.tar.xz done
  Extracting opencl-orca-amdgpu-pro-icd_20.40-1147286_amd64.deb done
    Extracting data.tar.xz done
  Extracting libdrm-amdgpu-amdgpu1_2.4.100-1147286_amd64.deb done
    Extracting data.tar.xz done
Copying files to package directory done

Building package (allow up to 2min):
dpkg-deb: building package 'amdgpu-ocl' in 'amdgpu-ocl_20.40-1147286.deb'.

amdgpu-ocl_20.40-1147286.deb content:
drwxr-xr-x root/root         0 2020-10-10 00:12 ./
drwxr-xr-x root/root         0 2020-09-23 03:03 ./etc/
drwxr-xr-x root/root         0 2020-09-23 03:03 ./etc/OpenCL/
drwxr-xr-x root/root         0 2020-09-23 03:03 ./etc/OpenCL/vendors/
-rw-r--r-- root/root        20 2020-09-23 03:03 ./etc/OpenCL/vendors/amdocl-orca64.icd
-rw-r--r-- root/root        15 2020-09-23 03:03 ./etc/OpenCL/vendors/amdocl64.icd
drwxr-xr-x root/root         0 2020-10-10 00:12 ./opt/
drwxr-xr-x root/root         0 2020-10-10 00:12 ./opt/amdgpu/
drwxr-xr-x root/root         0 2020-10-10 00:12 ./opt/amdgpu/share/
drwxr-xr-x root/root         0 2020-10-10 00:12 ./opt/amdgpu/share/libdrm/
drwxr-xr-x root/root         0 2020-10-10 00:12 ./usr/
drwxr-xr-x root/root         0 2020-10-10 00:12 ./usr/lib/
-rw-r--r-- root/root  85284568 2020-10-10 00:12 ./usr/lib/libamdocl-orca64.so
-rw-r--r-- root/root  36847400 2020-09-23 03:03 ./usr/lib/libamdocl12cl64.so
-rw-r--r-- root/root  93898608 2020-09-23 03:03 ./usr/lib/libamdocl64.so
-rw-r--r-- root/root     51840 2020-09-23 03:03 ./usr/lib/libdrm_amdgpo.so.1.0.0
lrwxrwxrwx root/root         0 2020-10-10 00:12 ./opt/amdgpu/share/libdrm/amdgpu.ids -> /usr/share/libdrm/amdgpu.ids
lrwxrwxrwx root/root         0 2020-10-10 00:12 ./usr/lib/libdrm_amdgpo.so.1 -> libdrm_amdgpo.so.1.0.0

Use dpkg -i amdgpu-ocl_20.40-1147286.deb to install it.

Install the driver with

dpkg -i amdgpu-ocl_20.40-1147286.deb

On Ubuntu and most likely other Debian derivatives you will also need to install the ICD loader ocl-icd-libopencl1. Use clinfo to verify the OpenCL part of amdgpu-pro is in place and active:

user@hostname:~# clinfo | egrep "Platform Version|Device Version|Driver Version"
  Platform Version                                OpenCL 2.1 AMD-APP (3180.7)
  Device Version                                  OpenCL 2.0 AMD-APP (3180.7)
  Driver Version                                  3180.7 (PAL,HSAIL)
user@hostname:~# 

These device and driver strings confirm that the AMDGPU-PRO OpenCL driver is in place. In case ROCm or Mesa OpenCL driver were present, these strings would look differently.

Mesa + clover:

  Platform Version                                OpenCL 1.1 Mesa 17.3.0
  Device Version                                  OpenCL 1.1 Mesa 17.3.0
  Driver Version                                  17.3.0

Your GPU can now be used for OpenCL work.
Go find some gravitational waves or gamma-ray pulsar binaries at https://einsteinathome.org/

amdgpu-ocl's People

Contributors

mblenn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

amdgpu-ocl's Issues

PPA for Ubuntu LTS and Regularrelease

The script is a great idea. However in my opinion it would be great to have an ppa for Ubuntu to make the Installation and updates more userfriendly.

Does the package created by the script install any kernelmodules or are the files just userspace components?

OpenCL devices not detected with RX 5700

I used this script previously to enable OpenCL on an RX 480 on Debian 10. I've since upgraded that card to an RX 5700 expecting it to be a drop-in upgrade, but this is apparently not the case. I've tried upgrading the kernel and firmware from backports and fully reinstalled the drivers and rebuilt the OpenCL package with this script.

The card is detected by Linux:

$ lspci | grep VGA
0b:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 (rev c1)

clinfo reports as follows:

Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.1 AMD-APP (3180.7)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_amd_event_callback cl_amd_offline_devices 
  Platform Host timer resolution                  1ns
  Platform Extensions function suffix             AMD

  Platform Name                                   AMD Accelerated Parallel Processing
Number of devices                                 0

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  AMD Accelerated Parallel Processing
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   
  clCreateContext(NULL, ...) [default]            No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No devices found in platform

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.12
  ICD loader Profile                              OpenCL 2.2

I'm using amdgpu-pro version 20.40. What am I missing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.