sailfish example fails on ubuntu 14.04 with catalyst and amd app sdk 2.9

117 views
Skip to first unread message

fffffff7

unread,
Aug 16, 2015, 8:06:07 AM8/16/15
to sailfish-cfd
Hi I am looking into sailfish and would like to try it on my personal computer with amd graphics card. I therefore chose opencl, and installed the amd app sdk with sudo.

When I try to run the example I get this message:

me@Me-Desktop:~/Downloads/sailfish/sailfish$ export PYTHONPATH=$PWD:$PYTHONPATH
me@Me-Desktop:~/Downloads/sailfish/sailfish$ cd examples/
me@Me-Desktop:~/Downloads/sailfish/sailfish/examples$ ./sc_drop.py
[  1134  INFO Master/Me-Desktop] Machine master starting with PID 7784 at 2015-08-16 11:29:31 UTC
[  1134  INFO Master/Me-Desktop] Simulation started with: ./sc_drop.py
[  1161  INFO Master/Me-Desktop] Sailfish version: c9d0052568c8ff9ee73d551712d8c6ab82cb048a
[  1162  INFO Master/Me-Desktop] Handling subdomains: [0]
[  1163  INFO Master/Me-Desktop] Subdomain -> GPU map: {0: 0}
[  1164  INFO Master/Me-Desktop] Selected backend: opencl
[  1912  INFO Subdomain/0] Initializing subdomain.
[  1912  INFO Subdomain/0] Required memory:
[  1912  INFO Subdomain/0] . distributions: 5 MiB
[  1912  INFO Subdomain/0] . fields: 0 MiB
[  1987  INFO Subdomain/0] On-GPU invalid result check disabled as the device does not support all required features.
/home/me/Downloads/sailfish/sailfish/sailfish/backend_opencl.py:156: UserWarning: Received OpenCL source code in Unicode, should be ASCII string. Attempting conversion.
  return cl.Program(self.ctx, preamble + source).build() #'-cl-single-precision-constant -cl-fast-relaxed-math')
Process Subdomain/0:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/home/me/Downloads/sailfish/sailfish/sailfish/master.py", line 65, in _start_subdomain_runner
    runner.run()
  File "/home/me/Downloads/sailfish/sailfish/sailfish/subdomain_runner.py", line 1523, in run
    self._init_compute()
  File "/home/me/Downloads/sailfish/sailfish/sailfish/subdomain_runner.py", line 803, in _init_compute
    self._update_compute_code()
  File "/home/me/Downloads/sailfish/sailfish/sailfish/subdomain_runner.py", line 799, in _update_compute_code
    self.module = self.backend.build(code)
  File "/home/me/Downloads/sailfish/sailfish/sailfish/backend_opencl.py", line 156, in build
    return cl.Program(self.ctx, preamble + source).build() #'-cl-single-precision-constant -cl-fast-relaxed-math')
  File "/usr/lib/python2.7/dist-packages/pyopencl/__init__.py", line 166, in build
    options=options, source=self._source)
  File "/usr/lib/python2.7/dist-packages/pyopencl/__init__.py", line 206, in _build_and_catch_errors
    raise err
RuntimeError: clBuildProgram failed: build program failure -

Build on <pyopencl.Device 'Barts' on 'AMD Accelerated Parallel Processing' at 0x19d5d60>:

"/tmp/OCL7789T5.cl", line 1: error: can't enable all OpenCL extensions or
          unrecognized OpenCL extension
  #pragma OPENCL EXTENSION cl_khr_fp64: enable
                           ^

1 error detected in the compilation of "/tmp/OCL7789T5.cl".
Frontend phase failed compilation.

(options: -I /usr/lib/python2.7/dist-packages/pyopencl/cl)
(source saved as /tmp/tmpMi7rE_.cl)
me@Me-Desktop:~/Downloads/sailfish/sailfish/examples$



What can I do now?

kind regards,

Harald

fffffff7

unread,
Aug 19, 2015, 8:04:28 AM8/19/15
to sailfish-cfd
I tried the single precision option as well:


me@Me-Desktop:~/Downloads/sailfish/sailfish$ export PYTHONPATH=$PWD:$PYTHONPATH
me@Me-Desktop:~/Downloads/sailfish/sailfish$ cd examples/
me@Me-Desktop:~/Downloads/sailfish/sailfish/examples$ ./sc_drop.py --precision=single
[   724  INFO Master/Me-Desktop] Machine master starting with PID 8253 at 2015-08-19 12:02:47 UTC
[   724  INFO Master/Me-Desktop] Simulation started with: ./sc_drop.py --precision=single
[   734  INFO Master/Me-Desktop] Sailfish version: c9d0052568c8ff9ee73d551712d8c6ab82cb048a
[   734  INFO Master/Me-Desktop] Handling subdomains: [0]
[   734  INFO Master/Me-Desktop] Subdomain -> GPU map: {0: 0}
[   735  INFO Master/Me-Desktop] Selected backend: opencl
[  1018  INFO Subdomain/0] Initializing subdomain.
[  1019  INFO Subdomain/0] Required memory:
[  1019  INFO Subdomain/0] . distributions: 5 MiB
[  1020  INFO Subdomain/0] . fields: 0 MiB
[  1098  INFO Subdomain/0] On-GPU invalid result check disabled as the device does not support all required features.

/home/me/Downloads/sailfish/sailfish/sailfish/backend_opencl.py:156: UserWarning: Received OpenCL source code in Unicode, should be ASCII string. Attempting conversion.
  return cl.Program(self.ctx, preamble + source).build() #'-cl-single-precision-constant -cl-fast-relaxed-math')
Process Subdomain/0:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/home/me/Downloads/sailfish/sailfish/sailfish/master.py", line 65, in _start_subdomain_runner
    runner.run()
  File "/home/me/Downloads/sailfish/sailfish/sailfish/subdomain_runner.py", line 1523, in run
    self._init_compute()
  File "/home/me/Downloads/sailfish/sailfish/sailfish/subdomain_runner.py", line 803, in _init_compute
    self._update_compute_code()
  File "/home/me/Downloads/sailfish/sailfish/sailfish/subdomain_runner.py", line 799, in _update_compute_code
    self.module = self.backend.build(code)
  File "/home/me/Downloads/sailfish/sailfish/sailfish/backend_opencl.py", line 156, in build
    return cl.Program(self.ctx, preamble + source).build() #'-cl-single-precision-constant -cl-fast-relaxed-math')
  File "/usr/lib/python2.7/dist-packages/pyopencl/__init__.py", line 166, in build
    options=options, source=self._source)
  File "/usr/lib/python2.7/dist-packages/pyopencl/__init__.py", line 206, in _build_and_catch_errors
    raise err
RuntimeError: clBuildProgram failed: build program failure -

Build on <pyopencl.Device 'Barts' on 'AMD Accelerated Parallel Processing' at 0x31c1820>:

"/tmp/OCL8258T5.cl", line 1: error: can't enable all OpenCL extensions or

          unrecognized OpenCL extension
  #pragma OPENCL EXTENSION cl_khr_fp64: enable
                           ^

1 error detected in the compilation of "/tmp/OCL8258T5.cl".

Frontend phase failed compilation.

(options: -I /usr/lib/python2.7/dist-packages/pyopencl/cl)
(source saved as /tmp/tmpyO5PnX.cl)


fffffff7

unread,
Aug 19, 2015, 9:48:52 AM8/19/15
to sailfish-cfd
Ok changing line 53 of sailfish/backen_opencl.py

from

devices = platform.get_devices(device_type=cl.device_type.GPU)

to

devices = platform.get_devices(device_type=cl.device_type.CPU)

did the job, but now I am running sailfish without GPU support, which is not really the idea.

My CPU has double precision support, the GPU does not, maybe sailfish checks for the extension support, finds it at the cpu and tries to run the GPU with it?

me@me-Desktop:~/Downloads/sailfish/sailfish/examples$ clinfo
Number of platforms:                 1
  Platform Profile:                 FULL_PROFILE
  Platform Version:                 OpenCL 2.0 AMD-APP (1729.3)
  Platform Name:                 AMD Accelerated Parallel Processing
  Platform Vendor:                 Advanced Micro Devices, Inc.
  Platform Extensions:                 cl_khr_icd cl_amd_event_callback cl_amd_offline_devices


  Platform Name:                 AMD Accelerated Parallel Processing
Number of devices:                 2
  Device Type:                     CL_DEVICE_TYPE_GPU
  Vendor ID:                     1002h
  Board name:                     AMD Radeon HD 6800 Series
  Device Topology:                 PCI[ B#1, D#0, F#0 ]
  Max compute units:                 12
  Max work items dimensions:             3
    Max work items[0]:                 256
    Max work items[1]:                 256
    Max work items[2]:                 256
  Max work group size:                 256
  Preferred vector width char:             16
  Preferred vector width short:             8
  Preferred vector width int:             4
  Preferred vector width long:             2
  Preferred vector width float:             4
  Preferred vector width double:         0
  Native vector width char:             16
  Native vector width short:             8
  Native vector width int:             4
  Native vector width long:             2
  Native vector width float:             4
  Native vector width double:             0
  Max clock frequency:                 775Mhz
  Address bits:                     32
  Max memory allocation:             134217728
  Image support:                 Yes
  Max number of images read arguments:         128
  Max number of images write arguments:         8
  Max image 2D width:                 16384
  Max image 2D height:                 16384
  Max image 3D width:                 2048
  Max image 3D height:                 2048
  Max image 3D depth:                 2048
  Max samplers within kernel:             16
  Max size of kernel argument:             1024
  Alignment (bits) of base address:         2048
  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:                     None
  Cache line size:                 0
  Cache size:                     0
  Global memory size:                 536870912
  Constant buffer size:                 65536
  Max number of constant args:             8
  Local memory type:                 Scratchpad
  Local memory size:                 32768
  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 properties:                 
    Out-of-Order:                 No
    Profiling :                     Yes
  Platform ID:                     0x00007fc0ac17c8f0
  Name:                         Barts
  Vendor:                     Advanced Micro Devices, Inc.
  Device OpenCL C version:             OpenCL C 1.2
  Driver version:                 1729.3
  Profile:                     FULL_PROFILE
  Version:                     OpenCL 1.2 AMD-APP (1729.3)
  Extensions:                     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_3d_image_writes cl_khr_byte_addressable_store cl_khr_gl_sharing cl_ext_atomic_counters_32 cl_amd_device_attribute_query cl_amd_vec3 cl_amd_printf cl_amd_media_ops cl_amd_media_ops2 cl_amd_popcnt cl_amd_image2d_from_buffer_read_only cl_khr_spir cl_khr_gl_event


  Device Type:                     CL_DEVICE_TYPE_CPU
  Vendor ID:                     1002h
  Board name:                     
  Max compute units:                 6
  Max work items dimensions:             3
    Max work items[0]:                 1024
    Max work items[1]:                 1024
    Max work items[2]:                 1024
  Max work group size:                 1024
  Preferred vector width char:             16
  Preferred vector width short:             8
  Preferred vector width int:             4
  Preferred vector width long:             2
  Preferred vector width float:             4
  Preferred vector width double:         2
  Native vector width char:             16
  Native vector width short:             8
  Native vector width int:             4
  Native vector width long:             2
  Native vector width float:             4
  Native vector width double:             2
  Max clock frequency:                 800Mhz
  Address bits:                     64
  Max memory allocation:             2147483648
  Image support:                 Yes
  Max number of images read arguments:         128
  Max number of images write arguments:         64
  Max image 2D width:                 8192
  Max image 2D height:                 8192
  Max image 3D width:                 2048
  Max image 3D height:                 2048
  Max image 3D depth:                 2048
  Max samplers within kernel:             16
  Max size of kernel argument:             4096
  Alignment (bits) of base address:         1024
  Minimum alignment (bytes) for any datatype:     128
  Single precision floating point capability
    Denorms:                     Yes
    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:                     65536
  Global memory size:                 8372682752
  Constant buffer size:                 65536
  Max number of constant args:             8
  Local memory type:                 Global
  Local memory size:                 32768
  Kernel Preferred work group size multiple:     1
  Error correction support:             0
  Unified memory for Host and Device:         1
  Profiling timer resolution:             1
  Device endianess:                 Little
  Available:                     Yes
  Compiler available:                 Yes
  Execution capabilities:                 
    Execute OpenCL kernels:             Yes
    Execute native function:             Yes
  Queue properties:                 
    Out-of-Order:                 No
    Profiling :                     Yes
  Platform ID:                     0x00007fc0ac17c8f0
  Name:                         AMD Phenom(tm) II X6 1055T Processor
  Vendor:                     AuthenticAMD
  Device OpenCL C version:             OpenCL C 1.2
  Driver version:                 1729.3 (sse2)
  Profile:                     FULL_PROFILE
  Version:                     OpenCL 1.2 AMD-APP (1729.3)
  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_ext_device_fission cl_amd_device_attribute_query cl_amd_vec3 cl_amd_printf cl_amd_media_ops cl_amd_media_ops2 cl_amd_popcnt cl_khr_spir cl_khr_gl_event

Michal Januszewski

unread,
Aug 20, 2015, 3:49:09 AM8/20/15
to sailfi...@googlegroups.com
The problem you are experiencing can be fixed with the following patch:

I will push it to the main sailfish repository later today.

--

---
You received this message because you are subscribed to the Google Groups "sailfish-cfd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sailfish-cfd...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

fffffff7

unread,
Aug 22, 2015, 7:23:37 AM8/22/15
to sailfish-cfd
I did another git clone, but no changes so far, are the changes already available?

Michal Januszewski

unread,
Aug 24, 2015, 2:50:51 PM8/24/15
to sailfi...@googlegroups.com
They are now. Sorry about the delay.
Reply all
Reply to author
Forward
0 new messages