Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
OpenCL on AMD GPU
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Tue Mar 20, 2018 12:40 am    Post subject: Reply with quote

Did brief battle again tonight. If I add USE=opencl mandelbulber fails to build because cl.hpp is a dangling symlink. So after looking through this thread a bit more, I installed opencl-clhpp from the science overlay. I know there is a fixed version in the zucca overlay, but it's not in stock layman and I didn't feel like looking up the pointer to it - yet. Anyway, the stock installation from science overlay drops the files in /usr/include/CL - not where they're being looked for. So I added a few symlinks:
Code:
# ls -l /usr/include/CL
total 0
lrwxrwxrwx 1 root root 15 Mar 19 20:28 cl2.hpp -> /usr/CL/cl2.hpp
lrwxrwxrwx 1 root root 49 Mar 17 22:16 cl_egl.h -> //usr/lib64/OpenCL/global/include/CL-1.2/cl_egl.h
lrwxrwxrwx 1 root root 49 Mar 17 22:16 cl_ext.h -> //usr/lib64/OpenCL/global/include/CL-1.2/cl_ext.h
lrwxrwxrwx 1 root root 52 Mar 17 22:16 cl_gl_ext.h -> //usr/lib64/OpenCL/global/include/CL-1.2/cl_gl_ext.h
lrwxrwxrwx 1 root root 48 Mar 17 22:16 cl_gl.h -> //usr/lib64/OpenCL/global/include/CL-1.2/cl_gl.h
lrwxrwxrwx 1 root root 45 Mar 17 22:16 cl.h -> //usr/lib64/OpenCL/global/include/CL-1.2/cl.h
lrwxrwxrwx 1 root root 14 Mar 19 20:28 cl.hpp -> /usr/CL/cl.hpp
lrwxrwxrwx 1 root root 43 Feb 25 19:56 cl.hpp-orig -> ../../lib64/OpenCL/global/include/CL/cl.hpp
lrwxrwxrwx 1 root root 54 Mar 17 22:16 cl_platform.h -> //usr/lib64/OpenCL/global/include/CL-1.2/cl_platform.h
lrwxrwxrwx 1 root root 49 Mar 17 22:16 opencl.h -> //usr/lib64/OpenCL/global/include/CL-1.2/opencl.h


With this, mandelbulber builds. But as soon as I go into preferences and try to enable OpenCL, it segfaults. Soon I'll look a bit harder and get the zucca version of opencl-clhpp and see if that's any better. Enough fiddling for tonight. I don't stay up as late as I used to.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3310
Location: Rasi, Finland

PostPosted: Tue Mar 20, 2018 10:00 am    Post subject: Reply with quote

depontius wrote:
Soon I'll look a bit harder and get the zucca version of opencl-clhpp and see if that's any better.
It's not any better than your current manual symlinking. :( It only has -DCMAKE_INSTALL_PREFIX adjusted correctly so that the files get installed into the right directory.
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Tue Mar 20, 2018 7:40 pm    Post subject: Reply with quote

Zucca wrote:
depontius wrote:
Soon I'll look a bit harder and get the zucca version of opencl-clhpp and see if that's any better.
It's not any better than your current manual symlinking. :( It only has -DCMAKE_INSTALL_PREFIX adjusted correctly so that the files get installed into the right directory.


Are you able to run mandelbulber with OpenCL on your setup? I don't think of eselect stuff as really being "in the path" more setting the paths for other packages. With that, the big difference I see between us is that you're getting ocl-icd from gentoo-gpu and I'm getting it from the base.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3310
Location: Rasi, Finland

PostPosted: Sun Apr 29, 2018 8:39 pm    Post subject: Reply with quote

This topic somehow got buried. :|
depontius wrote:
Are you able to run mandelbulber with OpenCL on your setup? I don't think of eselect stuff as really being "in the path" more setting the paths for other packages. With that, the big difference I see between us is that you're getting ocl-icd from gentoo-gpu and I'm getting it from the base.
Yes. I can use OpenCL with every program I have installed which uses it.
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
kanyck
n00b
n00b


Joined: 06 Jan 2013
Posts: 28

PostPosted: Tue May 08, 2018 7:56 am    Post subject: Reply with quote

Hi!
Zucca wrote:
This topic somehow got buried. :|

Not yet. I have exactly the same problem with fresh 18.10
Previously I tried 17.XX, they *almost* work, but produced artifacts (looking much alike a corrupted memory) on my Cape Verde GCN 1.0 card with darktable and all other apps I tried.
After the upgrade I got
Code:
Number of platforms                               0

no matter what I tried...
Everything looks just fine but doesn't work...
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3310
Location: Rasi, Finland

PostPosted: Tue May 08, 2018 7:06 pm    Post subject: Reply with quote

I'm in the middle of a huge rebuild process (and qt5 causing many blockers). After I've adjusted all the USE -flags and rebuilt many packages I'll see if I stuble upon any problems mentioned in this trhead and then try to create a solution for it.
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
kanyck
n00b
n00b


Joined: 06 Jan 2013
Posts: 28

PostPosted: Tue May 08, 2018 8:05 pm    Post subject: Reply with quote

Oh! Thanks! But I'm starting to think it's a hit-and-miss to some extent (however, that's what ebuild comment exactly says, so no wander). I've no idea how two libdrm-s can co-exist together, for example.

JFYI: This thread is about 18.20 beta.
https://www.phoronix.com/forums/forum/phoronix/latest-phoronix-articles/1022861-radeon-software-18-20-preview-offers-early-support-for-ubuntu-18-04-lts-rhel-7-5
It says that dkms driver is stiil needed to run opencl. However my experience is different. I tried both amdgpu-pro-17.40 (full stack) with dkms driver for kernel 4.9 and open stack plus amdgpu-pro-opencl with exactly the same result: kinda works but produces artifacts on my 7770...
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Wed May 09, 2018 12:39 am    Post subject: Reply with quote

I'm bored so I gave this a try. Getting the same 0 platforms thing.

Sequence of events so far:
  • Rebuilt my system with USE=opencl globally (no amdgpu-pro at this point)
  • Verified that clinfo detects my GPU (a RX550)
  • Verified that clover runs exactly zero interesting opencl programs
  • Installed amdgpu-pro-opencl-17.50-511655 (after doing a bunch of dodgy stuff I found in a web search[1] to obtain the distfile because it's been hidden from their site)
  • eselect opencl set ocl-icd, verified /usr/include/CL/ is in order
  • clinfo now returns nothing.

But: running it in strace, I can see it looking for amdoclsc64.so. The amdgpu-pro package didn't install that, and it doesn't seem to be present inside any of the .deb files within. Maybe that's the source of everyone's problem here?
[1]:
cd $DISTDIR
wget https://www2.ati.com/drivers/linux/ubuntu/amdgpu-pro-17.50-511655.tar.xz --referer http://support.amd.com/en-us/kb-articles/Pages/Radeon-Software-for-Linux-Release-Notes.aspx
Back to top
View user's profile Send private message
kanyck
n00b
n00b


Joined: 06 Jan 2013
Posts: 28

PostPosted: Wed May 09, 2018 6:21 am    Post subject: Reply with quote

18.10 doesn't have this file either. However they've changed some names. Here's my /opt/amdgpu with amdgpu-pro-opencl-18.10 installed:
Code:
[kanyck: ~]$ tree /opt/amdgpu/
/opt/amdgpu/
├── lib64
│   ├── libamdocl64.so
│   ├── libdrm_amdgpu.so.1 -> libdrm_amdgpu.so.1.0.0
│   └── libdrm_amdgpu.so.1.0.0
└── share
    └── libdrm
        └── amdgpu.ids

BTW I wander if there's a place to file bugs for amdgpu-pro. I tried few usual places, like kernel.org and freedesktop's bugzillas with no apparent success -- they all were ignored for months. On phoronix bridgman encouraged people to file bugs but never discovered where to, even being asked explicitly. And very few chances are to get help on phoronix, too. Meanwhile there are some things, like env vars, to be set to get apps working. Setting the following moved me one step further when I attempted this issue last time few months ago:
Code:
export GPU_FORCE_64BIT_PTR=1
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=90
export GPU_SINGLE_ALLOC_PERCENT=90
export GPU_MAX_HEAP_SIZE=90

I've found this on forums, but couldn't trace where those came from, neither if there are some other important things to get it working...
Back to top
View user's profile Send private message
xdarma
l33t
l33t


Joined: 08 Dec 2003
Posts: 719
Location: tra veneto e friuli (italy)

PostPosted: Tue May 15, 2018 7:45 pm    Post subject: Reply with quote

kanyck wrote:

BTW I wander if there's a place to file bugs for amdgpu-pro. I tried few usual places, like kernel.org and freedesktop's bugzillas with no apparent success -- they all were ignored for months. On phoronix bridgman encouraged people to file bugs but never discovered where to, even being asked explicitly. And very few chances are to get help on phoronix, too.

At the bottom of driver download page, there is a link: AMD Issue Reporting Form
A place with some information: AMD Support Community
_________________
proud user of faKeDE-4.7.3 -> back to windowmaker -> moved to LXQt
Back to top
View user's profile Send private message
kanyck
n00b
n00b


Joined: 06 Jan 2013
Posts: 28

PostPosted: Wed May 16, 2018 6:13 am    Post subject: Reply with quote

xdarma wrote:

At the bottom of driver download page, there is a link: AMD Issue Reporting Form
A place with some information: AMD Support Community

Oh! Thanks! I've never scrolled down that far :roll:
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Thu May 17, 2018 7:04 pm    Post subject: Reply with quote

I haven't had time to fiddle with this for quite a while, though someday I'll get back to it. In the meantime, I saw this on Phoronix the other day, which seems relevant to this discussion. The comments are worth checking out, too.

https://www.phoronix.com/scan.php?page=news_item&px=ROCm-PAL-Future
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
azp
Guru
Guru


Joined: 16 Nov 2003
Posts: 456
Location: Sweden

PostPosted: Mon Jun 18, 2018 2:59 pm    Post subject: Reply with quote

Has anybody tried the getting OpenCL working with the 18.20 drivers yet? I modified an ebuild to fetch the new package, but I can't get it working. I get "Number of platforms 0" when I run clinfo.

Code:
peter@skare ~ $ ll /opt/amdgpu/lib64/
total 70M
-rwxr-xr-x 1 root root 70M 17 jun 20.53 libamdocl64.so*
lrwxrwxrwx 1 root root  22 17 jun 20.53 libdrm_amdgpu.so.1 -> libdrm_amdgpu.so.1.0.0*
-rwxr-xr-x 1 root root 55K 17 jun 20.53 libdrm_amdgpu.so.1.0.0*
lrwxrwxrwx 1 root root  15 17 jun 20.53 libdrm.so.2 -> libdrm.so.2.4.0*
-rwxr-xr-x 1 root root 83K 17 jun 20.53 libdrm.so.2.4.0*
lrwxrwxrwx 1 root root  15 17 jun 20.53 libkms.so.1 -> libkms.so.1.0.0*
-rwxr-xr-x 1 root root 15K 17 jun 20.53 libkms.so.1.0.0*
peter@skare ~ $ ll /opt/amdgpu/share/libdrm/
total 8,0K
-rw-r--r-- 1 root root 5,8K 17 jun 20.53 amdgpu.ids
peter@skare ~ $ eselect opencl list
Available OpenCL implementations:
  [1]   mesa
  [2]   ocl-icd *

_________________
Weeks of coding can save you hours of planning.


Last edited by azp on Mon Jun 25, 2018 7:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
happysmash27
Apprentice
Apprentice


Joined: 28 Mar 2016
Posts: 220

PostPosted: Thu Jun 21, 2018 3:48 am    Post subject: Reply with quote

I have, but I have the exact same problem :/
Back to top
View user's profile Send private message
bloodyTribology
n00b
n00b


Joined: 28 Jun 2018
Posts: 4
Location: UK

PostPosted: Thu Jun 28, 2018 12:05 pm    Post subject: Reply with quote

azp wrote:
Has anybody tried the getting OpenCL working with the 18.20 drivers yet? I modified an ebuild to fetch the new package, but I can't get it working. I get "Number of platforms 0" when I run clinfo.


With the ebuild added to the in the main repo on the 24th of Jun, openCL seems to work using Darktable's openCL test and can be enabled from it's options. I built mesa without openCL support so you may need to do that.
Back to top
View user's profile Send private message
azp
Guru
Guru


Joined: 16 Nov 2003
Posts: 456
Location: Sweden

PostPosted: Sat Jun 30, 2018 6:04 pm    Post subject: Reply with quote

bloodyTribology wrote:
azp wrote:
Has anybody tried the getting OpenCL working with the 18.20 drivers yet? I modified an ebuild to fetch the new package, but I can't get it working. I get "Number of platforms 0" when I run clinfo.


With the ebuild added to the in the main repo on the 24th of Jun, openCL seems to work using Darktable's openCL test and can be enabled from it's options. I built mesa without openCL support so you may need to do that.


Do you disable the opencl use-flag globally, or just for Mesa? I have a problem where Blender/Darktable/etc are pulling in OpenCL on Mesa, since they have enabled opencl flags, even though I've disabled it specifically for Mesa.
_________________
Weeks of coding can save you hours of planning.
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Sat Jun 30, 2018 8:17 pm    Post subject: Reply with quote

Fascinating...

A month or two back I installed amd-gpupro-opencl-17.xxxxx. It responded to clinfo OK, but I wasn't actually able to do anything with it. I installed Mandelbulber just to try it out, and whenever I tried enabling opencl, it crashed.

More recently I recompiled my whole system with gcc-7.3, and amd-gpupro-opencl failed to build, but since it never worked in the first place, I never got around to debugging it.

Seeing this, I decided to try amd-gpupro-opencl-18.xxxxx. It compiled OK, and it works! Picking one of their examples, rendering on just the CPU takes about 9.3 seconds. Enabling OpenCL, the first render takes 1.7 seconds, with some of that time spent "compiling OpenCL programs". Subsequent renderings take 0.6 seconds.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
azp
Guru
Guru


Joined: 16 Nov 2003
Posts: 456
Location: Sweden

PostPosted: Sun Jul 01, 2018 1:05 am    Post subject: Reply with quote

depontius wrote:
Fascinating...

A month or two back I installed amd-gpupro-opencl-17.xxxxx. It responded to clinfo OK, but I wasn't actually able to do anything with it. I installed Mandelbulber just to try it out, and whenever I tried enabling opencl, it crashed.

More recently I recompiled my whole system with gcc-7.3, and amd-gpupro-opencl failed to build, but since it never worked in the first place, I never got around to debugging it.

Seeing this, I decided to try amd-gpupro-opencl-18.xxxxx. It compiled OK, and it works! Picking one of their examples, rendering on just the CPU takes about 9.3 seconds. Enabling OpenCL, the first render takes 1.7 seconds, with some of that time spent "compiling OpenCL programs". Subsequent renderings take 0.6 seconds.


What does clinfo tell you now?
_________________
Weeks of coding can save you hours of planning.
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Sun Jul 01, 2018 2:29 am    Post subject: Reply with quote

Code:
$ clinfo
Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.1 AMD-APP (2639.3)
  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                                 1
  Device Name                                     Spectre
  Device Vendor                                   Advanced Micro Devices, Inc.
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.2 AMD-APP (2639.3)
  Driver Version                                  2639.3
  Device OpenCL C Version                         OpenCL C 1.2
  Device Type                                     GPU
  Device Board Name (AMD)                         AMD Radeon Graphics
  Device Topology (AMD)                           PCI-E, 00:01.0
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               8
  SIMD per compute unit (AMD)                     4
  SIMD width (AMD)                                16
  SIMD instruction width (AMD)                    1
  Max clock frequency                             720MHz
  Graphics IP (AMD)                               7.1
  Device Partition                                (core)
    Max number of sub-devices                     8
    Supported partition types                     (n/a)
    Supported affinity domains                    (n/a)
  Max work item dimensions                        3
  Max work item sizes                             1024x1024x1024
  Max work group size                             256
  Preferred work group size (AMD)                 256
  Max work group size (AMD)                       1024
  Preferred work group size multiple              64
  Wavefront width (AMD)                           64
  Preferred / native vector sizes                 
    char                                                 4 / 4       
    short                                                2 / 2       
    int                                                  1 / 1       
    long                                                 1 / 1       
    half                                                 1 / 1        (n/a)
    float                                                1 / 1       
    double                                               1 / 1        (cl_khr_fp64)
  Half-precision Floating-point support           (n/a)
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  Yes
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              2638061568 (2.457GiB)
  Global free memory (AMD)                        4109604 (3.919GiB)
  Global memory channels (AMD)                    4
  Global memory banks per channel (AMD)           8
  Global memory bank width (AMD)                  256 bytes
  Error Correction support                        No
  Max memory allocation                           1369020825 (1.275GiB)
  Unified memory for Host and Device              Yes
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       2048 bits (256 bytes)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        16384 (16KiB)
  Global Memory cache line size                   64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             16
    Max size for 1D images from buffer            134217728 pixels
    Max 1D or 2D image array size                 2048 images
    Base address alignment for 2D image buffers   256 bytes
    Pitch alignment for 2D image buffers          256 pixels
    Max 2D image size                             16384x16384 pixels
    Max 3D image size                             2048x2048x2048 pixels
    Max number of read image args                 128
    Max number of write image args                8
  Local memory type                               Local
  Local memory size                               32768 (32KiB)
  Local memory syze per CU (AMD)                  65536 (64KiB)
  Local memory banks (AMD)                        32
  Max number of constant args                     8
  Max constant buffer size                        1369020825 (1.275GiB)
  Preferred constant buffer size (AMD)            16384 (16KiB)
  Max size of kernel argument                     1024
  Queue properties                               
    Out-of-order execution                        No
    Profiling                                     Yes
  Prefer user sync for interop                    Yes
  Profiling timer resolution                      1ns
  Profiling timer offset since Epoch (AMD)        1530351041009569074ns (Sat Jun 30 05:30:41 2018)
  Execution capabilities                         
    Run OpenCL kernels                            Yes
    Run native kernels                            No
    Thread trace supported (AMD)                  Yes
    Number of async queues (AMD)                  2
    Max real-time compute queues (AMD)            0
    Max real-time compute units (AMD)             0
    SPIR versions                                 1.2
  printf() buffer size                            4194304 (4MiB)
  Built-in kernels                                (n/a)
  Device Extensions                               cl_khr_fp64 cl_amd_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_gl_sharing cl_amd_device_attribute_query cl_amd_vec3 cl_amd_printf cl_amd_media_ops cl_amd_media_ops2 cl_amd_popcnt cl_khr_image2d_from_buffer cl_khr_spir cl_khr_gl_event

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  AMD Accelerated Parallel Processing
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [AMD]
  clCreateContext(NULL, ...) [default]            Success [AMD]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   Spectre
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   Spectre
  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)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   Spectre

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.11
  ICD loader Profile                              OpenCL 2.1

_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
bloodyTribology
n00b
n00b


Joined: 28 Jun 2018
Posts: 4
Location: UK

PostPosted: Sun Jul 01, 2018 3:48 pm    Post subject: Reply with quote

azp wrote:
Do you disable the opencl use-flag globally, or just for Mesa? I have a problem where Blender/Darktable/etc are pulling in OpenCL on Mesa, since they have enabled opencl flags, even though I've disabled it specifically for Mesa.


I have -opencl specifically on Mesa; after amdgpu-pro-opencl is installed darktable shoudn't try and pull it in from Mesa.
Back to top
View user's profile Send private message
azp
Guru
Guru


Joined: 16 Nov 2003
Posts: 456
Location: Sweden

PostPosted: Sun Jul 01, 2018 8:26 pm    Post subject: Reply with quote

bloodyTribology wrote:
azp wrote:
Do you disable the opencl use-flag globally, or just for Mesa? I have a problem where Blender/Darktable/etc are pulling in OpenCL on Mesa, since they have enabled opencl flags, even though I've disabled it specifically for Mesa.


I have -opencl specifically on Mesa; after amdgpu-pro-opencl is installed darktable shoudn't try and pull it in from Mesa.


Hm, mine does. It specifically needs Mesa with opencl flag, according to portage. But perhaps it wasn't because of darktable but because I have the global opencl use flag enabled.
_________________
Weeks of coding can save you hours of planning.
Back to top
View user's profile Send private message
bloodyTribology
n00b
n00b


Joined: 28 Jun 2018
Posts: 4
Location: UK

PostPosted: Mon Jul 02, 2018 1:03 pm    Post subject: Reply with quote

azp wrote:
Hm, mine does. It specifically needs Mesa with opencl flag, according to portage. But perhaps it wasn't because of darktable but because I have the global opencl use flag enabled.


Just checked, and I don't have opencl in my make.conf. It is in my package.use/darktable though.
Back to top
View user's profile Send private message
azp
Guru
Guru


Joined: 16 Nov 2003
Posts: 456
Location: Sweden

PostPosted: Mon Jul 02, 2018 6:21 pm    Post subject: Reply with quote

bloodyTribology wrote:
azp wrote:
Hm, mine does. It specifically needs Mesa with opencl flag, according to portage. But perhaps it wasn't because of darktable but because I have the global opencl use flag enabled.

Just checked, and I don't have opencl in my make.conf. It is in my package.use/darktable though.

That's weird. I just disabled my global opencl use flag, and enabled it only for Blender and Darktable. But when running "emerge -uDN world" I still get:
Code:
The following USE changes are necessary to proceed:
 (see "package.use" in the portage(5) man page for more details)
# required by virtual/opencl-0-r5::gentoo
# required by media-gfx/darktable-2.4.4::gentoo
# required by @selected
# required by @world (argument)
>=media-libs/mesa-18.1.2 opencl

so it seems Darktable is still pulling it in.

It doesn't seem than opencl or anything else depends on amdgpu-pro-opencl yet.

Code:
root@skare$ equery depends amdgpu-pro-opencl
 * These packages depend on amdgpu-pro-opencl:
root@skare$

_________________
Weeks of coding can save you hours of planning.
Back to top
View user's profile Send private message
ali3nx
l33t
l33t


Joined: 21 Sep 2003
Posts: 722
Location: Winnipeg, Canada

PostPosted: Sat Jul 07, 2018 1:07 am    Post subject: Reply with quote

Just a heads up clinfo ebuilds will not build unless mesa is built with opencl support. I've submitted a bug for this

https://bugs.gentoo.org/660572

I've managed to install both versions of amdgpu-pro-opencl to test if ether version would function with the big picture goal to get ethminer functional on gentoo using RX480/580 graphics cards without needing the entire amdgpu-pro stack however both clinfo and ethminer reply with No OpenCL platforms found with mesa built with or without opencl support

The 17.50 ebuild for amdgpu-pro-opencl was updated to EAPI-7 but the ebuild itself was not updated to reflect eapi changes with dolib requiring a change to dolib.so and addressing that minor issue the 17.50 ebuild worked perfectly fine.

Code:
src_install() {
        into "/opt/amdgpu"
        dolib.so opt/${SUPER_PN}/lib/x86_64-linux-gnu/*
        dolib.so opt/amdgpu/lib/x86_64-linux-gnu/*
        insinto "/opt/amdgpu"
        doins -r opt/amdgpu/share

        insinto /etc/OpenCL/vendors/
        echo "/opt/amdgpu/$(get_libdir)/libamdocl64.so" > "${SUPER_PN}.icd" || die "Failed to generate ICD file"
        doins "${SUPER_PN}.icd"
}


amdgpu driver's all loaded and eselect opencl is set but still 0 devices found by ethminer or clinfo. I do currently have amdgpu kernel driver built as a module with the firmware being loaded from userland of that matters. The amdgpu graphics cards will all be secondary display devices to the intel igpu with this configuration.

If anyone has a suggestion i'm certainly interested.

Code:
vargur ~ # clinfo
Number of platforms 0


Code:
vargur /home/xartin/ethminer-0.14.0-Linux # ./ethminer -G --list-devices
  ▒  19:13:20|ethminer|  No OpenCL platforms found


Code:
vargur ~ # eselect opencl list
Available OpenCL implementations:
  [1]   mesa
  [2]   ocl-icd *


One possible discrepancy with the above eselect entries i discovered is there is an icd file added for amdgpu-pro.icd but that listing is not available in eselect opencl. I dont know if this is an eselect config bug with the relevant package that could directly be responsible for opencl compute detection not functioning.

Code:
vargur ~ # ls -l /etc/OpenCL/vendors/
total 8
-rw-r--r-- 1 root root 33 Jul  6 18:26 amdgpu-pro.icd
-rw-r--r-- 1 root root 47 Jul  6 06:48 ocl-icd.icd
vargur ~ # cat /etc/OpenCL/vendors/amdgpu-pro.icd
/opt/amdgpu/lib64/libamdocl64.so
vargur ~ # cat /etc/OpenCL/vendors/ocl-icd.icd
/usr/lib64/OpenCL/vendors/ocl-icd/libOpenCL.so



Code:
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/580] (rev e7)
        Subsystem: Sapphire Technology Limited Radeon RX 570
        Kernel modules: amdgpu
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 580]
        Subsystem: Sapphire Technology Limited Ellesmere [Radeon RX 580]
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel
02:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/580] (rev c7)
        Subsystem: PC Partner Limited / Sapphire Technology Radeon RX 470/480
        Kernel modules: amdgpu
02:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 580]
        Subsystem: PC Partner Limited / Sapphire Technology Ellesmere [Radeon RX 580]
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/580] (rev c7)
        Subsystem: PC Partner Limited / Sapphire Technology Radeon RX 470/480
        Kernel modules: amdgpu
05:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 580]
        Subsystem: PC Partner Limited / Sapphire Technology Ellesmere [Radeon RX 580]
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel
06:00.0 USB controller: ASMedia Technology Inc. Device 2142
        Subsystem: ASUSTeK Computer Inc. Device 8732
        Kernel driver in use: xhci_hcd
07:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/580] (rev c7)
        Subsystem: PC Partner Limited / Sapphire Technology Ellesmere [Radeon RX 470/480/570/580]
        Kernel modules: amdgpu
07:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 580]
        Subsystem: PC Partner Limited / Sapphire Technology Ellesmere [Radeon RX 580]
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel


Code:
vargur ~ # emerge --info
Portage 2.3.40 (python 3.6.5-final-0, default/linux/amd64/17.0/desktop/plasma/systemd, gcc-7.3.0, glibc-2.26-r7, 4.17.4-gentoo x86_64)
=================================================================
System uname: Linux-4.17.4-gentoo-x86_64-Intel-R-_Pentium-R-_CPU_G4560_@_3.50GHz-with-gentoo-2.4.1
KiB Mem:     8028448 total,   2177992 free
KiB Swap:    2097148 total,   2096380 free
Timestamp of repository gentoo: Fri, 06 Jul 2018 00:30:01 +0000
Head commit of repository gentoo: 615edeecfa74bf1040b12d87c0f0cd5b5a24dce8
sh bash 4.4_p12
ld GNU ld (Gentoo 2.30 p2) 2.30.0
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.4_p12::gentoo
dev-lang/perl:            5.24.3-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.6.5::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r2::gentoo
sys-devel/binutils:       2.30-r2::gentoo
sys-devel/gcc:            7.3.0-r3::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r7::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts:
    sync-rsync-verify-metamanifest: yes

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --complete-graph y"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs candy config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="10bit 12bit X a52 aac acl acpi activities alsa amd64 berkdb bluetooth bluray branding bzip2 cairo caps cdda cdr cjk cli client conntrack cracklib crypt cryptsetup cups cxx dbus declarative device-mapper dri dts dvd dvdr emboss encode exif fam flac fortran gallium gdbm gif glamor gpm gtk iconv idn iproute2 ipv6 ithreads jpeg kde kipi kwallet lcms ldap libnotify libtirpc lz4 lzma lzo mad mng modules mp3 mp4 mpeg multilib nat ncurses netlink nftables nls nptl ogg opencl opengl openmp openssl opus pam pango pcre pdf phonon pic pie plasma png policykit posix ppds pwquality python qml qt5 rar readline samba sdl seccomp semantic-desktop spell ssl startup-notification svg systemd tcpd theora threads tiff truetype udev udisks unicode upower urandom usb user-session v4l v4l2 vaapi vdpau vorbis vulkan widgets wxwidgets x264 x265 xattr xcb xcomposite xml xv xvid zip zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="ratelimit lbmethod_bybusyness lbmethod_byrequests lbmethod_bytraffic lbmethod_heartbeat http2 cgid unixd authn_core authz_core authz_dbd socache_shmcb apache2_modules_unixd actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status slotmem_shm unique_id userdir usertrack vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="openssl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby23" USERLAND="GNU" VIDEO_CARDS="intel i915 amdgpu radeon radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

_________________
Compiling Gentoo since version 1.4
Thousands of Gentoo Installs Completed
Emerged on every continent but Antarctica
Compile long and Prosper!


Last edited by ali3nx on Sat Jul 07, 2018 3:29 am; edited 1 time in total
Back to top
View user's profile Send private message
candrews
Developer
Developer


Joined: 10 Aug 2005
Posts: 162

PostPosted: Sat Jul 07, 2018 3:10 am    Post subject: Reply with quote

For what it's worth, all I had to do to get working opencl support was:
* use ~amd64
* use a recent kernel (4.17 is what I'm using)
* use the amdgpu driver
* set the "opencl" use flag globally
* emerge dev-libs/amdgpu-pro-opencl (currently version 18.20.606296)
* make sure "ocl-icd" is selcted in "eselect opencl list"

I'm not using any overlays.

dev-util/clinfo (again, not from any overlays) shows 1 platform named "AMD Accelerated Parallel Processing"

I suspect that there's a lot of cruft left over on systems from before it was this easy as well as some broken stuff being used from overlays. Please try to stick to what's in Gentoo without overlays (if you do find something great from overlay, get it into Gentoo), try to report bugs (thanks for reporting the clinfo one, ali3nx!) and submit PRs to fix things.
_________________
I'm working on a variety of random things throughout Gentoo.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Goto page Previous  1, 2, 3, 4, 5  Next
Page 4 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum