Open picca opened 6 years ago
Hi Fred,
Good to know. In 1.2 spec, there is nothing like this: https://www.khronos.org/news/press/khronos-releases-opencl-1.2-specification
Other project found a trick to enable functions: +#ifdef cl_clang_storage_class_specifiers +#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable +#endif
Could you test if it works for you ? it is breaking on none of our computer.
You want me to put this in the common openCL file ? for_eclipse
here the clinfo
~/Debian/pyfai/pyfai$ clinfo
Number of platforms 1
Platform Name Clover
Platform Vendor Mesa
Platform Version OpenCL 1.1 Mesa 13.0.6
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd
Platform Extensions function suffix MESA
Platform Name Clover
Number of devices 1
Device Name AMD TONGA (DRM 3.10.0 / 4.11.0-0.bpo.1-amd64, LLVM 3.9.1)
Device Vendor AMD
Device Vendor ID 0x1002
Device Version OpenCL 1.1 Mesa 13.0.6
Driver Version 13.0.6
Device OpenCL C Version OpenCL C 1.1
Device Type GPU
Device Profile FULL_PROFILE
Max compute units 28
Max clock frequency 920MHz
Max work item dimensions 3
Max work item sizes 256x256x256
Max work group size 256
Preferred work group size multiple 64
Preferred / native vector sizes
char 16 / 16
short 8 / 8
int 4 / 4
long 2 / 2
half 0 / 0 (n/a)
float 4 / 4
double 2 / 2 (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 No
Round to infinity No
IEEE754-2008 fused multiply-add No
Support is emulated in software No
Correctly-rounded divide and sqrt operations No
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
Correctly-rounded divide and sqrt operations No
Address bits 64, Little-Endian
Global memory size 8588091392 (7.998GiB)
Error Correction support No
Max memory allocation 6011663974 (5.599GiB)
Unified memory for Host and Device Yes
Minimum alignment for any data type 128 bytes
Alignment of base address 1024 bits (128 bytes)
Global Memory cache type None
Image support No
Local memory type Local
Local memory size 32768 (32KiB)
Max constant buffer size 2147483647 (2GiB)
Max number of constant args 16
Max size of kernel argument 1024
Queue properties
Out-of-order execution No
Profiling Yes
Profiling timer resolution 0ns
Execution capabilities
Run OpenCL kernels Yes
Run native kernels No
Device Available Yes
Compiler Available Yes
Device 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_byte_addressable_store cl_khr_fp64
NULL platform behavior
clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) Clover
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) Success [MESA]
clCreateContext(NULL, ...) [default] Success [MESA]
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) Success (1)
Platform Name Clover
Device Name AMD TONGA (DRM 3.10.0 / 4.11.0-0.bpo.1-amd64, LLVM 3.9.1)
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 Clover
Device Name AMD TONGA (DRM 3.10.0 / 4.11.0-0.bpo.1-amd64, LLVM 3.9.1)
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
Could you put it in all the ".cl" files as header.
If it turns out to be working, we could patch specifically at runtime as we perform on the fly compilation
Maybe I can create a patch in order to patch at runtime. This seems easier for me instead of copy and past in all cl files.
I add by hand in all files the snipset, and then I get a segfault...
.......s..sssssss....sssss.ssss....................................................................................................................................................................................ssssssssssssssssEEEEEssssssssssssss.......ssssss...sss
Thread 1 "python2.7" received signal SIGSEGV, Segmentation fault.
0x00007fffdd34cd58 in llvm::SIInstrInfo::getInstSizeInBytes(llvm::MachineInstr const&) const () from /usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1
(gdb) bt
#0 0x00007fffdd34cd58 in llvm::SIInstrInfo::getInstSizeInBytes(llvm::MachineInstr const&) const () from /usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1
#1 0x00007fffdd2e79de in llvm::AMDGPUAsmPrinter::getSIProgramInfo(llvm::AMDGPUAsmPrinter::SIProgramInfo&, llvm::MachineFunction const&) const () from /usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1
#2 0x00007fffdd2ea4b9 in llvm::AMDGPUAsmPrinter::runOnMachineFunction(llvm::MachineFunction&) () from /usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1
#3 0x00007fffdc697651 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) () from /usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1
#4 0x00007fffdc545882 in llvm::FPPassManager::runOnFunction(llvm::Function&) () from /usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1
#5 0x00007fffdc545b9b in llvm::FPPassManager::runOnModule(llvm::Module&) () from /usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1
#6 0x00007fffdc545eb7 in llvm::legacy::PassManagerImpl::run(llvm::Module&) () from /usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1
#7 0x00007fffdf416273 in ?? () from /usr/lib/x86_64-linux-gnu/libMesaOpenCL.so.1
#8 0x00007fffdf416890 in ?? () from /usr/lib/x86_64-linux-gnu/libMesaOpenCL.so.1
#9 0x00007fffdf412e37 in ?? () from /usr/lib/x86_64-linux-gnu/libMesaOpenCL.so.1
#10 0x00007fffdf405319 in ?? () from /usr/lib/x86_64-linux-gnu/libMesaOpenCL.so.1
#11 0x00007fffdf3e375d in ?? () from /usr/lib/x86_64-linux-gnu/libMesaOpenCL.so.1
#12 0x00007fffe0d3037d in _call_func<int (*)(_cl_program*, unsigned int, _cl_device_id* const*, char const*, void (*)(_cl_program*, void*), void*), 0, 1, 2, 3, 4, 5, _cl_program* const&, unsigned long, _cl_device_id**, char const*&, std::nullptr_t&, std::nullptr_t&> (args=..., func=<optimized out>) at src/c_wrapper/function.h:38
#13 call_tuple<int (*&)(_cl_program*, unsigned int, _cl_device_id* const*, char const*, void (*)(_cl_program*, void*), void*), std::tuple<_cl_program* const&, unsigned long, _cl_device_id**, char const*&, std::nullptr_t&, std::nullptr_t&> > (args=<optimized out>, func=<synthetic pointer>: <optimized out>) at src/c_wrapper/function.h:49
#14 ArgPack<CLArg, program const*, pyopencl_buf<_cl_device_id*> const, char const*, decltype(nullptr), decltype(nullptr)>::call<__CLArgGetter, int (*)(_cl_program*, unsigned int, _cl_device_id* const*, char const*, void (*)(_cl_program*, void*), void*)>(int (*)(_cl_program*, unsigned int, _cl_device_id* const*, char const*, void (*)(_cl_program*, void*), void*)) (func=<optimized out>, this=0x7fffffff80a0)
at src/c_wrapper/function.h:108
#15 CLArgPack<program const*, pyopencl_buf<_cl_device_id*> const, char const*, decltype(nullptr), decltype(nullptr)>::clcall<int (*)(_cl_program*, unsigned int, _cl_device_id* const*, char const*, void (*)(_cl_program*, void*), void*)>(int (*)(_cl_program*, unsigned int, _cl_device_id* const*, char const*, void (*)(_cl_program*, void*), void*), char const*) (name=0x7fffe0d41d8a "clBuildProgram", func=<optimized out>,
this=0x7fffffff80a0) at src/c_wrapper/error.h:211
#16 call_guarded<program const*&, pyopencl_buf<_cl_device_id*> const&, char const*&, std::nullptr_t, std::nullptr_t, _cl_program*, unsigned int, _cl_device_id* const*, char const*, void (*)(_cl_program*, void*), void*> (name=0x7fffe0d41d8a "clBuildProgram", func=<optimized out>) at src/c_wrapper/error.h:243
#17 <lambda()>::operator() (__closure=<synthetic pointer>) at src/c_wrapper/program.cpp:184
#18 c_handle_error<program__build(clobj_t, char const*, cl_uint, clbase* const*)::<lambda()> > (func=...) at src/c_wrapper/error.h:296
#19 program (_prog=0x5555588fd8b0, options=<optimized out>, num_devices=num_devices@entry=1, _devices=<optimized out>) at src/c_wrapper/program.cpp:185
#20 0x00007fffe0ce4b58 in _cffi_f_program (self=<optimized out>, args=<optimized out>) at build/temp.linux-x86_64-2.7/pyopencl._cffi.cpp:8773
#21 0x000055555564f3ca in call_function (oparg=<optimized out>, pp_stack=0x7fffffff8260) at ../Python/ceval.c:4352
#22 PyEval_EvalFrameEx () at ../Python/ceval.c:2989
#23 0x000055555564d535 in PyEval_EvalCodeEx () at ../Python/ceval.c:3584
#24 0x0000555555654f19 in fast_function (nk=2, na=<optimized out>, n=<optimized out>, pp_stack=0x7fffffff8470, func=<function at remote 0x7fffe0f7f848>) at ../Python/ceval.c:4447
#25 call_function (oparg=<optimized out>, pp_stack=0x7fffffff8470) at ../Python/ceval.c:4372
#26 PyEval_EvalFrameEx () at ../Python/ceval.c:2989
#27 0x000055555564d535 in PyEval_EvalCodeEx () at ../Python/ceval.c:3584
On Thu, 07 Sep 2017 09:12:48 +0000 (UTC) picca notifications@github.com wrote:
I add by hand in all files the snipset, and then I get a segfault...
I suspect it may work for simple kernels (i.e. azimuthal integrator) but not for fancy stuff like median filter (it is a guess).
Could you run the tests with "runtest -m -vv" to have an output of which test breaks ?
Thanks.
Hello, I have a TONGA AMD graphical card with the mesa clover implementation
But during the test I get these error messages.
Cheers