Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ROC - Radeon Open Compute
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
justXi
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2007
Posts: 85

PostPosted: Sun Mar 18, 2018 4:17 pm    Post subject: ROC - Radeon Open Compute Reply with quote

Hello,

I am interessted in getting ROC from AMD to work and emerge on Gentoo.
Is someone working on it?

I created a few ebuilds and uploaded them to https://bugs.gentoo.org/650804.
It is possbile to emerge the "thunk-interface", "runtime" and "opencl".
It works with kernel 4.13 from https://github.com/RadeonOpenCompute/ROCK-Kernel-Driver. (firmware is taken from the ubuntu packages)
Running "clinfo" using the library "libamdocl64.so" gives some information about the device.
My next step is to check OpenCL programs with the installed libs.

I am working also on an ebuild for the compiler "hcc" (https://github.com/RadeonOpenCompute/hcc), all is building and installing fine.
But the compiler does not work, because of missing files.

If there are already ebuilds to test or a Gentoo project working on that, please let me know where to find it.
If not and there are people who are interessted in ROC too, sharing informations would be nice.
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


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

PostPosted: Sun Mar 18, 2018 4:42 pm    Post subject: Reply with quote

This topic is relevant to my interests.

Did you already get OpenCL to work? If you did, can you paste the output of clinfo?
_________________
..: 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
justXi
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2007
Posts: 85

PostPosted: Sun Mar 18, 2018 7:59 pm    Post subject: Reply with quote

This is the output of clinfo (from portage) as root:

Code:

Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.0 AMD-APP.internal.dbg (2545.0)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_amd_object_metadata cl_amd_event_callback
  Platform Extensions function suffix             AMD

  Platform Name                                   AMD Accelerated Parallel Processing
Number of devices                                 1
  Device Name                                     gfx803
  Device Vendor                                   Advanced Micro Devices, Inc.
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.2
  Driver Version                                  2545.0 (HSA1.1,LC)
  Device OpenCL C Version                         OpenCL C 2.0
  Device Type                                     GPU
  Device Available                                Yes
  Device Profile                                  FULL_PROFILE
  Device Board Name (AMD)                         Baffin [Radeon RX 460/560D / Pro 450/455/460/560]
  Device Topology (AMD)                           PCI-E, 23:00.0
  Max compute units                               14
  SIMD per compute unit (AMD)                     4
  SIMD width (AMD)                                16
  SIMD instruction width (AMD)                    1
  Max clock frequency                             1176MHz
  Graphics IP (AMD)                               8.3
  Device Partition                                (core)
    Max number of sub-devices                     14
    Supported partition types                     none specified
  Max work item dimensions                        3
  Max work item sizes                             1024x1024x1024
  Max work group size                             256
  Compiler Available                              Yes
  Linker Available                                Yes
  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        (cl_khr_fp16)
    float                                                1 / 1       
    double                                               1 / 1        (cl_khr_fp64)
  Half-precision Floating-point support           (cl_khr_fp16)
    Denormals                                     No
    Infinity and NANs                             No
    Round to nearest                              No
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
  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                              4294967296 (4GiB)
  Global free memory (AMD)                        4192256 (3.998GiB)
  Global memory channels (AMD)                    4
  Global memory banks per channel (AMD)           4
  Global memory bank width (AMD)                  256 bytes
  Error Correction support                        No
  Max memory allocation                           3650722201 (3.4GiB)
  Unified memory for Host and Device              No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        16384 (16KiB)
  Global Memory cache line size                   64 bytes
  Image support                                   No
  Local memory type                               Local
  Local memory size                               65536 (64KiB)
  Local memory syze per CU (AMD)                  65536 (64KiB)
  Local memory banks (AMD)                        32
  Max constant buffer size                        3650722201 (3.4GiB)
  Max number of constant args                     8
  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)        0ns (Thu Jan  1 01:00:00 1970)
  Execution capabilities                         
    Run OpenCL kernels                            Yes
    Run native kernels                            No
    Thread trace supported (AMD)                  No
  printf() buffer size                            4194304 (4MiB)
  Built-in kernels                               
  Device Extensions                               cl_khr_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_fp16 cl_khr_gl_sharing cl_amd_device_attribute_query cl_amd_media_ops cl_amd_media_ops2 cl_khr_subgroups cl_khr_depth_images cl_amd_copy_buffer_p2p

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  No platform
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No platform
  clCreateContext(NULL, ...) [default]            No platform
  clCreateContext(NULL, ...) [other]              Success [AMD]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No platform
Back to top
View user's profile Send private message
justXi
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2007
Posts: 85

PostPosted: Sun Mar 18, 2018 8:02 pm    Post subject: Reply with quote

Output from clinfo shipped with the ROCm-OpenCL-Runtime package, as root:

Code:

Number of platforms:             1
  Platform Profile:             FULL_PROFILE
  Platform Version:             OpenCL 2.0 AMD-APP.internal.dbg (2545.0)
  Platform Name:             AMD Accelerated Parallel Processing
  Platform Vendor:             Advanced Micro Devices, Inc.
  Platform Extensions:             cl_khr_icd cl_amd_object_metadata cl_amd_event_callback


  Platform Name:             AMD Accelerated Parallel Processing
Number of devices:             1
  Device Type:                CL_DEVICE_TYPE_GPU
  Vendor ID:                1002h
  Board name:                Baffin [Radeon RX 460/560D / Pro 450/455/460/560]
  Device Topology:             PCI[ B#35, D#0, F#0 ]
  Max compute units:             14
  Max work items dimensions:          3
    Max work items[0]:             1024
    Max work items[1]:             1024
    Max work items[2]:             1024
  Max work group size:             256
  Preferred vector width char:          4
  Preferred vector width short:          2
  Preferred vector width int:          1
  Preferred vector width long:          1
  Preferred vector width float:          1
  Preferred vector width double:       1
  Native vector width char:          4
  Native vector width short:          2
  Native vector width int:          1
  Native vector width long:          1
  Native vector width float:          1
  Native vector width double:          1
  Max clock frequency:             1176Mhz
  Address bits:                64
  Max memory allocation:          3650722201
  Image support:             No
  Max size of kernel argument:          1024
  Alignment (bits) of base address:       1024
  Minimum alignment (bytes) for any datatype:    128
  Single precision floating point capability
    Denorms:                No
    Quiet NaNs:                Yes
    Round to nearest even:          Yes
    Round to zero:             Yes
    Round to +ve and infinity:          Yes
    IEEE754-2008 fused multiply-add:       Yes
  Cache type:                Read/Write
  Cache line size:             64
  Cache size:                16384
  Global memory size:             4294967296
  Constant buffer size:             3650722201
  Max number of constant args:          8
  Local memory type:             Scratchpad
  Local memory size:             65536
  Max pipe arguments:             16
  Max pipe active reservations:          16
  Max pipe packet size:             3650722201
  Max global variable size:          3650722201
  Max global variable preferred total size:    4294967296
  Max read/write image args:          0
  Max on device events:             0
  Queue on device max size:          0
  Max on device queues:             0
  Queue on device preferred size:       0
  SVM capabilities:            
    Coarse grain buffer:          Yes
    Fine grain buffer:             Yes
    Fine grain system:             No
    Atomics:                No
  Preferred platform atomic alignment:       0
  Preferred global atomic alignment:       0
  Preferred local atomic alignment:       0
  Kernel Preferred work group size multiple:    64
  Error correction support:          0
  Unified memory for Host and Device:       0
  Profiling timer resolution:          1
  Device endianess:             Little
  Available:                Yes
  Compiler available:             Yes
  Execution capabilities:            
    Execute OpenCL kernels:          Yes
    Execute native function:          No
  Queue on Host properties:            
    Out-of-Order:             No
    Profiling :                Yes
  Queue on Device properties:            
    Out-of-Order:             No
    Profiling :                No
  Platform ID:                0x7f1fe60b43e0
  Name:                   gfx803
  Vendor:                Advanced Micro Devices, Inc.
  Device OpenCL C version:          OpenCL C 2.0
  Driver version:             2545.0 (HSA1.1,LC)
  Profile:                FULL_PROFILE
  Version:                OpenCL 1.2
  Extensions:                cl_khr_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_fp16 cl_khr_gl_sharing cl_amd_device_attribute_query cl_amd_media_ops cl_amd_media_ops2 cl_khr_subgroups cl_khr_depth_images cl_amd_copy_buffer_p2p
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


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

PostPosted: Sun Mar 18, 2018 8:54 pm    Post subject: Reply with quote

I'm currently using the OpenCl implementation from amdgpu-pro drivers, while still using the opensource amdgpu driver for general graphics. I should maybe switch then...
_________________
..: 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
justXi
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2007
Posts: 85

PostPosted: Tue Mar 20, 2018 5:17 pm    Post subject: Reply with quote

Do you know what this means....
Is it OpenCL 2.0 capable or not?

Code:


Number of platforms:             1
  Platform Profile:             FULL_PROFILE
  Platform Version:             OpenCL 2.0 AMD-APP.internal.dbg (2545.0)
  Platform Name:             AMD Accelerated Parallel Processing
  Platform Vendor:             Advanced Micro Devices, Inc.
  Platform Extensions:             cl_khr_icd cl_amd_object_metadata cl_amd_event_callback
...
  Vendor:                Advanced Micro Devices, Inc.
  Device OpenCL C version:          OpenCL C 2.0
  Driver version:             2545.0 (HSA1.1,LC)
  Profile:                FULL_PROFILE
  Version:                OpenCL 1.2
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


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

PostPosted: Tue Mar 20, 2018 6:33 pm    Post subject: Reply with quote

My guess is, it's cabable of both standards: OpenCL 1.2 and 2.0.
_________________
..: 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
justXi
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2007
Posts: 85

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

I will try it with an OpenCL 2.0 example, when I find one.

In the meantime I found: https://github.com/RadeonOpenCompute/ROCK-Kernel-Driver/issues/46

and https://www.phoronix.com/scan.php?page=news_item&px=AMDKFD-dGPU-GPUVM

Currently the only kernel which works for me is version 4.13.0 from get ROC git respository.
It seems that the drivers can be used with a mainline kernel in the near future.
Back to top
View user's profile Send private message
Accipiter
Tux's lil' helper
Tux's lil' helper


Joined: 24 Feb 2003
Posts: 87
Location: Buffalo, NY

PostPosted: Sun Apr 22, 2018 8:04 pm    Post subject: Reply with quote

I'm also very interested in giving these a spin. I have a little experience with ebuild development, and would like to help if I can.
Back to top
View user's profile Send private message
justXi
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2007
Posts: 85

PostPosted: Mon Apr 23, 2018 4:19 pm    Post subject: Reply with quote

Accipiter wrote:
I'm also very interested in giving these a spin. I have a little experience with ebuild development, and would like to help if I can.


I think any help is appreciated.
I want to run the ebuilds on a fresh installation to find missing dependencies.
And I want to try the git-sources-4.17-rc2 if there is support for dGPU.
Back to top
View user's profile Send private message
MarcoMarin
Apprentice
Apprentice


Joined: 12 Mar 2014
Posts: 151

PostPosted: Wed May 02, 2018 10:31 pm    Post subject: help Reply with quote

yet another aspiring amd openCL'er here reporting..

my card probably won't be able to run the new ROC stuff but I'll settle for studying openCL.

I have an old Gentoo box which had already managed to run openCL stuff, but it runs the old fglx driver. On a new Gentoo installation I'm trying to get openCL on the new drivers. Everything works (fbcon, etc) except emerging the amdgpu-pro-opencl libraries.

I download it manually, as per Zucca awesome work (on another thread) and the good soul who placed it on main gentoo overlay.
But portage can't find the file:

1st) Asks me to place it in /var/tmp/(some random string)/portage/dev-libs (etc, the distdir directory), but it always asks for a different random string!

2nd) If I say Y to emerge, then it gets more reasonable and asks for it to be placed in the normal directory (/var/tmp/portage/dev-libs/amdgpu-pro-opencl(version)/distdir) BUT when I do that, it says it cannot find it and deletes the file.

So far I managed to emerge ocl-icd, but I'm stuck without the libraries.

What am I doing wrong?
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


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

PostPosted: Wed May 02, 2018 11:27 pm    Post subject: Re: help Reply with quote

MarcoMarin wrote:
1st) Asks me to place it in /var/tmp/(some random string)/portage/dev-libs (etc, the distdir directory), but it always asks for a different random string!

2nd) If I say Y to emerge, then it gets more reasonable and asks for it to be placed in the normal directory (/var/tmp/portage/dev-libs/amdgpu-pro-opencl(version)/distdir) BUT when I do that, it says it cannot find it and deletes the file.
Can you post the output of emerge command of what it is telling you to do?
_________________
..: 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
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21633

PostPosted: Thu May 03, 2018 2:01 am    Post subject: Re: help Reply with quote

MarcoMarin wrote:
Everything works (fbcon, etc) except emerging the amdgpu-pro-opencl libraries.

I download it manually, as per Zucca awesome work (on another thread) and the good soul who placed it on main gentoo overlay.
But portage can't find the file:

1st) Asks me to place it in /var/tmp/(some random string)/portage/dev-libs (etc, the distdir directory), but it always asks for a different random string!
This is a known bug with a messy explanation. In short, the package shows you $DISTDIR as seen by the function telling you to do the download. Historically, this was the real DISTDIR, but the specification never promised that. Recently, the developers involved decided that since the specification never promised this would work, they would change DISTDIR handling and declare that any ebuild using DISTDIR in this phase, including for diagnostic output like this, was buggy and needed to be changed. See [Tracker] Ebuilds accessing DISTDIR in pkg_* phases among others. Personally, this feels like a case where the reality of ebuilds showing this variable should override the technicality that it was not guaranteed to work.

As I understand it, you are supposed to (1) bug the maintainer of the ebuild to make it not print this variable, since the variable is misleading instead of useful and (2) ignore the apparent value of DISTDIR and instead put the file in your real, persistent DISTDIR (default value /usr/portage/distfiles).
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


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

PostPosted: Thu May 03, 2018 10:17 am    Post subject: Re: help Reply with quote

Hu wrote:
This is a known bug with a messy explanation. In short, the package shows you $DISTDIR as seen by the function telling you to do the download. Historically, this was the real DISTDIR, but the specification never promised that. Recently, the developers involved decided that since the specification never promised this would work, they would change DISTDIR handling and declare that any ebuild using DISTDIR in this phase, including for diagnostic output like this, was buggy and needed to be changed.
Why I don't remember stumbling into this even when I have made an ebuild which specifically "abuses" DISTDIR..?
Oh well. Sourcing or grepping make.conf for the destination directory isn't nice either. Although one can assume it's /usr/share/portage/distfiles if there isn't one defined in make.conf. But there's a change that someone uses portage bashrc to set it for example. So all methods of getting the persistent DISTDIR inside pkg_* -functions are considered hacks now?
_________________
..: 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
MarcoMarin
Apprentice
Apprentice


Joined: 12 Mar 2014
Posts: 151

PostPosted: Fri May 04, 2018 12:31 am    Post subject: Reply with quote

It is curious though that the 2nd one is "correct", I have only a vague idea of how ebuilds work, so the best I could suggest would be to try to use the 2nd kind (of function?), assuming this is not all automated of course.

okay, I placed the archive on /usr/portage/distfiles (the directory "/usr/share/portage/distfiles doesn't seem to exist :) ), will test first thing in the morning. Let me know whether you still need the output from emerge.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21633

PostPosted: Fri May 04, 2018 1:40 am    Post subject: Reply with quote

When did you last execute the pkg_nofetch of that ebuild, Zucca? I think this change in Portage is relatively recent. The only way to use $DISTDIR in pkg_nofetch is as advice to the user, which mitigates the negative effect of this change. Even so, I think it is a bad change.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Fri May 04, 2018 4:00 pm    Post subject: Reply with quote

Hu wrote:
The only way to use $DISTDIR in pkg_nofetch is as advice to the user, which mitigates the negative effect of this change. Even so, I think it is a bad change.
Concur. We have a DISTDIR, it is variable from the point-of-view of the ebuild, and there is no reason to ban its usage.

Honestly, it reminds me of the idiocy the gcc developers used to pull around UB (and perhaps still do.)
Effectively it ends up being developers "thinking through" policy decisions that are not their business; a "modern" failing.
Back to top
View user's profile Send private message
MarcoMarin
Apprentice
Apprentice


Joined: 12 Mar 2014
Posts: 151

PostPosted: Fri May 04, 2018 10:18 pm    Post subject: Reply with quote

It works! \o/

Here is some output:
Code:
>>> Unpacking source...
>>> Unpacking amdgpu-pro-17.50-511655.tar.xz to /var/tmp/portage/dev-libs/amdgpu-pro-opencl-17.50.511655/work
>>> Unpacking opencl-amdgpu-pro-icd_17.50-511655_amd64.deb to /var/tmp/portage/dev-libs/amdgpu-pro-opencl-17.50.511655/work/amdgpu-pro-17.50-511655
>>> Unpacking data.tar.xz to /var/tmp/portage/dev-libs/amdgpu-pro-opencl-17.50.511655/work/amdgpu-pro-17.50-511655
>>> Unpacking libdrm-amdgpu-amdgpu1_2.4.82-511655_amd64.deb to /var/tmp/portage/dev-libs/amdgpu-pro-opencl-17.50.511655/work/amdgpu-pro-17.50-511655
>>> Unpacking data.tar.xz to /var/tmp/portage/dev-libs/amdgpu-pro-opencl-17.50.511655/work/amdgpu-pro-17.50-511655
>>> Unpacking ids-amdgpu_1.0.0-511655_all.deb to /var/tmp/portage/dev-libs/amdgpu-pro-opencl-17.50.511655/work/amdgpu-pro-17.50-511655
>>> Unpacking data.tar.xz to /var/tmp/portage/dev-libs/amdgpu-pro-opencl-17.50.511655/work/amdgpu-pro-17.50-511655
>>> Source unpacked in

Apparently, only the files "opencl-amdgpu-pro-icd, data.tar.xz, libdrm-amdgpu-amdgpu, ids-amdgpu" are needed (although there is more going on behind the scenes, "data" for instance is used 3 times), in case we could carve out the over half a Gigabyte archive into a more manageable size.

Then I grabbed an official openCL hello_world and issued "gcc cl_util.c hello_world.c -I/usr/lib/OpenCL/global/include/ -lOpenCL -L/usr/lib64/OpenCL/vendors/ocl-icd/"

Maybe we could add the libs to the default path as a nicety? (or are we indeed supposed to do that for extraneous libraries?)

I had to "mv ./libOpenCL.so.1 /usr/lib" though, so at least a symlink there would be needed. Here's the output:
Code:
There are 1 platforms.
There are 1 GPU devices.
clCreateContext() succeeded.
clCreateCommandQueue() failed: CL_OUT_OF_HOST_MEMORY


No idea what's going on. :(
Back to top
View user's profile Send private message
MarcoMarin
Apprentice
Apprentice


Joined: 12 Mar 2014
Posts: 151

PostPosted: Tue May 22, 2018 10:26 pm    Post subject: Reply with quote

trying to install Xorg, apparently had some progress with this:

Code:
./a.out: /usr/lib64/OpenCL/vendors/mesa/libOpenCL.so.1: no version information available (required by ./a.out)
There are 1 platforms.
There are 1 GPU devices.
clCreateContext() succeeded.
clCreateCommandQueue() succeeded.
clCreateProgramWithSource() suceeded.
clBuildProgram() suceeded.
clCreateKernel() suceeded.
clCreateBuffer() succeeded.
clSetKernelArg() succeeded.
clEnqueueNDRangeKernel() suceeded.
clFinish() succeeded.
clEnqueueReadBuffer() suceeded.
pi = 3.141590


Then I checked eselect opencl, and it had MESA selected!

Now if I eselect back to ocl-icd, it segfaults! O.o

Let me know if anyone wants that source code (hello world). Gonna try some libraries next.
Back to top
View user's profile Send private message
schwarzygesetzlos
Apprentice
Apprentice


Joined: 11 Dec 2004
Posts: 185
Location: Funeralopolis

PostPosted: Thu Dec 06, 2018 5:46 pm    Post subject: Reply with quote

@justXi: Thanks for your great ebuild! Saved me lots of time to install ROCm manually! I hope it will find it's way in portage.

I only got one problem, OpenCL via ROCm works with my Radeon RX 570, 580 and Radeon Nano but not on my Radeon RX Vega 56. The card is detected by rocminfo but clinfo shows 0 cards.

Code:
=====================   
HSA System Attributes   
=====================   
Runtime Version:         1.1
System Timestamp Freq.:  1000.000000MHz
Sig. Max Wait Duration:  18446744073709551615 (0xFFFFFFFFFFFFFFFF) (timestamp count)
Machine Model:           LARGE                             
System Endianness:       LITTLE                             

==========               
HSA Agents               
==========               
*******                 
Agent 1                 
*******                 
  Name:                    AMD A8-6600K APU with Radeon(tm) HD Graphics
  Vendor Name:             CPU                               
  Feature:                 None specified                     
  Profile:                 FULL_PROFILE                       
  Float Round Mode:        NEAR                               
  Max Queue Number:        0(0x0)                             
  Queue Min Size:          0(0x0)                             
  Queue Max Size:          0(0x0)                             
  Queue Type:              MULTI                             
  Node:                    0                                 
  Device Type:             CPU                               
  Cache Info:             
  Chip ID:                 0(0x0)                             
  Cacheline Size:          64(0x40)                           
  Max Clock Frequency (MHz):3700                               
  BDFID:                   0(0x0)                             
  Compute Unit:            4(0x4)                             
  Features:                None
  Pool Info:               
    Pool 1                   
      Segment:                 GLOBAL; FLAGS: KERNARG, FINE GRAINED
      Size:                    16441176(0xfadf58) KB             
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                               
      Alloc Alignment:         4KB                               
      Acessible by all:        TRUE                               
    Pool 2                   
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED     
      Size:                    16441176(0xfadf58) KB             
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                               
      Alloc Alignment:         4KB                               
      Acessible by all:        TRUE                               
  ISA Info:               
    N/A                     
*******                 
Agent 2                 
*******                 
  Name:                    gfx900                             
  Vendor Name:             AMD                               
  Feature:                 KERNEL_DISPATCH                   
  Profile:                 BASE_PROFILE                       
  Float Round Mode:        NEAR                               
  Max Queue Number:        128(0x80)                         
  Queue Min Size:          4096(0x1000)                       
  Queue Max Size:          131072(0x20000)                   
  Queue Type:              MULTI                             
  Node:                    1                                 
  Device Type:             GPU                               
  Cache Info:             
    L1:                      16(0x10) KB                       
  Chip ID:                 26751(0x687f)                     
  Cacheline Size:          64(0x40)                           
  Max Clock Frequency (MHz):1590                               
  BDFID:                   768(0x300)                         
  Compute Unit:            56(0x38)                           
  Features:                KERNEL_DISPATCH
  Fast F16 Operation:      FALSE                             
  Wavefront Size:          64(0x40)                           
  Workgroup Max Size:      1024(0x400)                       
  Workgroup Max Size per Dimension:
    x                        1024(0x400)                       
    y                        1024(0x400)                       
    z                        1024(0x400)                       
  Waves Per CU:            40(0x28)                           
  Max Work-item Per CU:    2560(0xa00)                       
  Grid Max Size:           4294967295(0xffffffff)             
  Grid Max Size per Dimension:
    x                        4294967295(0xffffffff)             
    y                        4294967295(0xffffffff)             
    z                        4294967295(0xffffffff)             
  Max number Of fbarriers Per Workgroup:32                                 
  Pool Info:               
    Pool 1                   
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED     
      Size:                    8372224(0x7fc000) KB               
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                               
      Alloc Alignment:         4KB                               
      Acessible by all:        FALSE                             
    Pool 2                   
      Segment:                 GROUP                             
      Size:                    64(0x40) KB                       
      Allocatable:             FALSE                             
      Alloc Granule:           0KB                               
      Alloc Alignment:         0KB                               
      Acessible by all:        FALSE                             
  ISA Info:               
    ISA 1                   
      Name:                    amdgcn-amd-amdhsa--gfx900         
      Machine Models:          HSA_MACHINE_MODEL_LARGE           
      Profiles:                HSA_PROFILE_BASE                   
      Default Rounding Mode:   NEAR                               
      Default Rounding Mode:   NEAR                               
      Fast f16:                TRUE                               
      Workgroup Max Size:      1024(0x400)                       
      Workgroup Max Size per Dimension:
        x                        1024(0x400)                       
        y                        1024(0x400)                       
        z                        1024(0x400)                       
      Grid Max Size:           4294967295(0xffffffff)             
      Grid Max Size per Dimension:
        x                        4294967295(0xffffffff)             
        y                        4294967295(0xffffffff)             
        z                        4294967295(0xffffffff)             
      FBarrier Max Size:       32                                 
*** Done ***             


I am running gentoo-sources-4.19.7 + media-libs/ROCm-OpenCL-Runtime-1.9.9999. Any ideas what I may have forgotten?
_________________
Talos II. [Gentoo Linux] | PMac G5 11,2. PMac G4 3,6. PBook G4 5,8. [MorphOS 3.18 / Gentoo Linux] | Vampire V4 SA [ApolloOS / Amiga OS 3.2.2]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
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