Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ubuntu 16.04+g++ (Ubuntu 4.9.3-13ubuntu2) 4.9.3 #57

Open
wsqat opened this issue Jul 28, 2020 · 7 comments
Open

ubuntu 16.04+g++ (Ubuntu 4.9.3-13ubuntu2) 4.9.3 #57

wsqat opened this issue Jul 28, 2020 · 7 comments

Comments

@wsqat
Copy link

wsqat commented Jul 28, 2020

I make install success , but when I run this program.

./sample_simple
Segmentation fault (core dumped)

Why?

@wsqat
Copy link
Author

wsqat commented Jul 28, 2020

@CNugteren Could you help me ?

@CNugteren
Copy link
Owner

CNugteren commented Jul 28, 2020

This can be an OpenCL issue. Did you manage to run other OpenCL programs properly on your machine? What does clinfo say? Did CLTune link to the correct OpenCL library? What device are you trying to run on? Would be good to share a bit more info and try some debugging yourself as well :-)

@wsqat
Copy link
Author

wsqat commented Jul 28, 2020

Thank you for your replay.

My PC's information as follows:

`clinfo
Number of platforms 2
Platform Name Intel(R) CPU Runtime for OpenCL(TM) Applications
Platform Vendor Intel(R) Corporation
Platform Version OpenCL 2.1 LINUX
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd 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_depth_images cl_khr_3d_image_writes cl_intel_exec_by_local_thread cl_khr_spir cl_khr_fp64 cl_khr_image2d_from_buffer cl_intel_vec_len_hint
Platform Host timer resolution 1ns
Platform Extensions function suffix INTEL

Platform Name NVIDIA CUDA
Platform Vendor NVIDIA Corporation
Platform Version OpenCL 1.2 CUDA 10.1.120
Platform Profile FULL_PROFILE
Platform 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_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer
Platform Extensions function suffix NV

Platform Name Intel(R) CPU Runtime for OpenCL(TM) Applications
Number of devices 1
Device Name Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
Device Vendor Intel(R) Corporation
Device Vendor ID 0x8086
Device Version OpenCL 2.1 (Build 0)
Driver Version 18.1.0.0920
Device OpenCL C Version OpenCL C 2.0
Device Type CPU
Device Profile FULL_PROFILE
Max compute units 12
Max clock frequency 3200MHz
Device Partition (core)
Max number of sub-devices 12
Supported partition types by counts, equally, by names (Intel)
Max work item dimensions 3
Max work item sizes 8192x8192x8192
Max work group size 8192
Preferred work group size multiple 128
Max sub-groups per work group 1
Preferred / native vector sizes
char 1 / 32
short 1 / 16
int 1 / 8
long 1 / 4
half 0 / 0 (n/a)
float 1 / 8
double 1 / 4 (cl_khr_fp64)
Half-precision Floating-point support (n/a)
Single-precision Floating-point support (core)
Denormals Yes
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 16650358784 (15.51GiB)
Error Correction support No
Max memory allocation 4162589696 (3.877GiB)
Unified memory for Host and Device Yes
Shared Virtual Memory (SVM) capabilities (core)
Coarse-grained buffer sharing Yes
Fine-grained buffer sharing Yes
Fine-grained system sharing Yes
Atomics Yes
Minimum alignment for any data type 128 bytes
Alignment of base address 1024 bits (128 bytes)
Preferred alignment for atomics
SVM 64 bytes
Global 64 bytes
Local 0 bytes
Max size for global variable 65536 (64KiB)
Preferred total size of global vars 65536 (64KiB)
Global Memory cache type Read/Write
Global Memory cache size 262144
Global Memory cache line 64 bytes
Image support Yes
Max number of samplers per kernel 480
Max size for 1D images from buffer 260161856 pixels
Max 1D or 2D image array size 2048 images
Base address alignment for 2D image buffers 64 bytes
Pitch alignment for 2D image buffers 64 bytes
Max 2D image size 16384x16384 pixels
Max 3D image size 2048x2048x2048 pixels
Max number of read image args 480
Max number of write image args 480
Max number of read/write image args 480
Max number of pipe args 16
Max active pipe reservations 21845
Max pipe packet size 1024
Local memory type Global
Local memory size 32768 (32KiB)
Max constant buffer size 131072 (128KiB)
Max number of constant args 480
Max size of kernel argument 3840 (3.75KiB)
Queue properties (on host)
Out-of-order execution Yes
Profiling Yes
Local thread execution (Intel) Yes
Queue properties (on device)
Out-of-order execution Yes
Profiling Yes
Preferred size 4294967295 (4GiB)
Max size 4294967295 (4GiB)
Max queues on device 4294967295
Max events on device 4294967295
Prefer user sync for interop No
Profiling timer resolution 1ns
Execution capabilities
Run OpenCL kernels Yes
Run native kernels Yes
Sub-group independent forward progress No
IL version SPIR-V_1.0
SPIR versions 1.2
printf() buffer size 1048576 (1024KiB)
Built-in kernels
Device Available Yes
Compiler Available Yes
Linker Available Yes
Device Extensions cl_khr_icd 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_depth_images cl_khr_3d_image_writes cl_intel_exec_by_local_thread cl_khr_spir cl_khr_fp64 cl_khr_image2d_from_buffer cl_intel_vec_len_hint

Platform Name NVIDIA CUDA
Number of devices 1
Device Name GeForce GTX 1060 6GB
Device Vendor NVIDIA Corporation
Device Vendor ID 0x10de
Device Version OpenCL 1.2 CUDA
Driver Version 430.64
Device OpenCL C Version OpenCL C 1.2
Device Type GPU
Device Profile FULL_PROFILE
Device Topology (NV) PCI-E, 01:00.0
Max compute units 10
Max clock frequency 1771MHz
Compute Capability (NV) 6.1
Device Partition (core)
Max number of sub-devices 1
Supported partition types None
Max work item dimensions 3
Max work item sizes 1024x1024x64
Max work group size 1024
=== CL_PROGRAM_BUILD_LOG ===
Preferred work group size multiple
Warp size (NV) 32
Preferred / native vector sizes
char 1 / 1
short 1 / 1
int 1 / 1
long 1 / 1
half 0 / 0 (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 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 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
Correctly-rounded divide and sqrt operations No
Address bits 64, Little-Endian
Global memory size 6373572608 (5.936GiB)
Error Correction support No
Max memory allocation 1593393152 (1.484GiB)
Unified memory for Host and Device No
Integrated memory (NV) No
Minimum alignment for any data type 128 bytes
Alignment of base address 4096 bits (512 bytes)
Global Memory cache type Read/Write
Global Memory cache size 163840
Global Memory cache line 128 bytes
Image support Yes
Max number of samplers per kernel 32
Max size for 1D images from buffer 134217728 pixels
Max 1D or 2D image array size 2048 images
Max 2D image size 16384x32768 pixels
Max 3D image size 16384x16384x16384 pixels
Max number of read image args 256
Max number of write image args 16
Local memory type Local
Local memory size 49152 (48KiB)
Registers per block (NV) 65536
Max constant buffer size 65536 (64KiB)
Max number of constant args 9
Max size of kernel argument 4352 (4.25KiB)
Queue properties
Out-of-order execution Yes
Profiling Yes
Prefer user sync for interop No
Profiling timer resolution 1000ns
Execution capabilities
Run OpenCL kernels Yes
Run native kernels No
Kernel execution timeout (NV) Yes
Concurrent copy and kernel execution (NV) Yes
Number of async copy engines 2
printf() buffer size 1048576 (1024KiB)
Built-in kernels
Device Available Yes
Compiler Available Yes
Linker 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_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer

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 [INTEL]
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
NOTE: your OpenCL library only supports OpenCL 2.0,
but some installed platforms support OpenCL 2.1.
Programs using 2.1 features may crash
or behave unexepectedly
`

and
`
~/OCL/CLTune-master/build$ cmake ..
-- The CXX compiler identification is GNU 4.9.3
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building with OpenCL
-- Found OpenCL: /usr/include
-- Configuring done
-- Generating done
-- Build files have been written to: /home/SENSETIME/wangshiqing1/OCL/CLTune-master/build

~/OCL/CLTune-master/build$ make
Scanning dependencies of target cltune
[ 4%] Building CXX object CMakeFiles/cltune.dir/src/cltune.cc.o
[ 9%] Building CXX object CMakeFiles/cltune.dir/src/tuner_impl.cc.o
[ 13%] Building CXX object CMakeFiles/cltune.dir/src/kernel_info.cc.o
[ 18%] Building CXX object CMakeFiles/cltune.dir/src/searcher.cc.o
[ 22%] Building CXX object CMakeFiles/cltune.dir/src/searchers/full_search.cc.o
[ 27%] Building CXX object CMakeFiles/cltune.dir/src/searchers/random_search.cc.o
[ 31%] Building CXX object CMakeFiles/cltune.dir/src/searchers/annealing.cc.o
[ 36%] Building CXX object CMakeFiles/cltune.dir/src/searchers/pso.cc.o
[ 40%] Building CXX object CMakeFiles/cltune.dir/src/ml_model.cc.o
[ 45%] Building CXX object CMakeFiles/cltune.dir/src/ml_models/linear_regression.cc.o
[ 50%] Building CXX object CMakeFiles/cltune.dir/src/ml_models/neural_network.cc.o
[ 54%] Linking CXX shared library libcltune.so
[ 54%] Built target cltune
Scanning dependencies of target sample_simple
[ 59%] Building CXX object CMakeFiles/sample_simple.dir/samples/simple/simple.cc.o
[ 63%] Linking CXX executable sample_simple
[ 63%] Built target sample_simple
Scanning dependencies of target sample_multiple_kernels
[ 68%] Building CXX object CMakeFiles/sample_multiple_kernels.dir/samples/multiple_kernels/multiple_kernels.cc.o
[ 72%] Linking CXX executable sample_multiple_kernels
[ 72%] Built target sample_multiple_kernels
Scanning dependencies of target sample_gemm
[ 77%] Building CXX object CMakeFiles/sample_gemm.dir/samples/gemm/gemm.cc.o
[ 81%] Linking CXX executable sample_gemm
[ 81%] Built target sample_gemm
Scanning dependencies of target sample_conv_simple
[ 86%] Building CXX object CMakeFiles/sample_conv_simple.dir/samples/conv_simple/conv_simple.cc.o
[ 90%] Linking CXX executable sample_conv_simple
[ 90%] Built target sample_conv_simple
Scanning dependencies of target sample_conv
[ 95%] Building CXX object CMakeFiles/sample_conv.dir/samples/conv/conv.cc.o
[100%] Linking CXX executable sample_conv
[100%] Built target sample_conv

./sample_simple
Segmentation fault (core dumped)

`

@CNugteren
Copy link
Owner

Thanks for the additional info. I can't see what would go wrong. A few things you can try:

  • Change the sample_simple program to run on your second platform (platform ID 1) instead and see if that works.
  • Add some printf/cout messages to see how far the sample program reaches: does it succesfully open the platform? and the device?
  • Run the sample program in a debugger and see if that helps you pinpoint the issue.

BTW, you haven't answered whether other OpenCL programs work with your set-up. So it might not be related to CLTune nor the sample program you are running at all!

@wsqat
Copy link
Author

wsqat commented Jul 29, 2020

Please help me , the gdb log as follows:

~/OCL/CLTune-2.7.0/samples/simple$ gdb ./simple core

GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./simple...(no debugging symbols found)...done.
[New LWP 8161]
Error while mapping shared library sections:
linux-vdso.so.1: Not a directory.
Core was generated by `./simple'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007fe80f2ee401 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2 0x00007fe80f2ee469 in std::locale::locale() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007fe80f2eb323 in std::ios_base::Init::Init() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007fe80f5e5770 in _GLOBAL__sub_I_cltune.cc () from /usr/local/lib/libcltune.so
#5 0x00007fe80f828783 in call_init (env=0x7ffffc891f08, argv=0x7ffffc891ef8, argc=1, l=) at dl-init.c:72
#6 _dl_init (main_map=0x7fe80fa41170, argc=1, argv=0x7ffffc891ef8, env=0x7ffffc891f08) at dl-init.c:119
#7 0x00007fe80f8190ca in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#8 0x0000000000000001 in ?? ()
#9 0x00007ffffc892e7a in ?? ()
#10 0x0000000000000000 in ?? ()
(gdb)

@wsqat
Copy link
Author

wsqat commented Jul 29, 2020

May this code resulting in this bug.

cltune::Tuner tuner(size_t{0}, size_t{0});

@CNugteren
Copy link
Owner

I would suggest to compile CLTune in debug mode to get a bit more meaningful trace :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants