[Bug 1110722] New: pocl uses compile-time CPU detection
http://bugzilla.opensuse.org/show_bug.cgi?id=1110722 Bug ID: 1110722 Summary: pocl uses compile-time CPU detection Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: openSUSE Factory Status: NEW Severity: Major Priority: P5 - None Component: Development Assignee: osukup@suse.com Reporter: bwiedemann@suse.com QA Contact: qa-bugs@suse.de CC: mpluskal@suse.com Blocks: 1100677 Found By: Development Blocker: --- Steps to Reproduce: osc co Factory/pocl && cd $_ osc build --no-service --vm-type=kvm --build-opt=--vm-custom-opt="-cpu qemu64" +compare result to one without build-opt using /usr/lib/build/pkg-diff.sh $rpm1 $rpm2 Was previously solved with https://build.opensuse.org/request/show/626138 /usr/lib64/libpocl.so.2.2.0 differs in assembler output --- /tmp/tmp.3iZr1DZRz5/tmp.MomrQD5u2D 2018-09-26 04:41:09.682694138 +0000 +++ /tmp/tmp.3iZr1DZRz5/tmp.3XC0iGKeQV 2018-09-26 04:41:09.750694493 +0000 @@ -93827,10 +93827,10 @@ lea offset(%rsp),%rdi lea offset(%rsp),%rsi callq <_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_assignERKS4_@plt> - mov %r12,%rax - sub offset(%rsp),%rax - cmp $something,%rax - jbe <_ZL14kernel_libraryP13_cl_device_id + ofs> + mov offset(%rsp),%rax + or $something,%rax + cmp %r12,%rax + je <_ZL14kernel_libraryP13_cl_device_id + ofs> lea offset(%rip),%rsi # <supported_image_formats + ofs> In the build-root I can see: /home/abuild/rpmbuild/BUILD/pocl-1.2/build/CMakeCache.txt 2033-10-28 17:46:42.015636815 +0000 @@ -411,7 +411,7 @@ LINK_COMMAND:FILEPATH=/usr/bin/ld //The Host CPU to use with llc -LLC_HOST_CPU:STRING=haswell +LLC_HOST_CPU:STRING=pentium2 //LLVM assembler LLVM_AS:FILEPATH=/usr/bin/llvm-as @@ -837,7 +837,7 @@ Hwloc_hwloc_PREFIX:INTERNAL= Hwloc_hwloc_VERSION:INTERNAL= //Autodetected CPU -LLC_HOST_CPU_AUTO:INTERNAL=haswell +LLC_HOST_CPU_AUTO:INTERNAL=pentium2 might be an upstream pocl bug, where the result of CPU detection accidentally gets used during build -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1110722 http://bugzilla.opensuse.org/show_bug.cgi?id=1110722#c1 --- Comment #1 from Bernhard Wiedemann <bwiedemann@suse.com> --- Maybe related: Binary files 5/.mount/home/abuild/rpmbuild/BUILD/pocl-1.2/build/lib/CL/CMakeFiles/lib_cl_llvm.dir/pocl_llvm_build.cc.o and 5b/.mount/home/abuild/rpmbuild/BUILD/pocl-1.2/build/lib/CL/CMakeFiles/lib_cl_llvm.dir/pocl_llvm_build.cc.o differ Binary files .5/.mount/home/abuild/rpmbuild/BUILD/pocl-1.2/build/lib/CL/CMakeFiles/lib_cl_llvm.dir/pocl_llvm_utils.cc.o and 5b/.mount/home/abuild/rpmbuild/BUILD/pocl-1.2/build/lib/CL/CMakeFiles/lib_cl_llvm.dir/pocl_llvm_utils.cc.o differ Binary files 5/.mount/home/abuild/rpmbuild/BUILD/pocl-1.2/build/lib/CL/devices/basic/CMakeFiles/pocl-devices-basic.dir/basic.c.o and 5b/.mount/home/abuild/rpmbuild/BUILD/pocl-1.2/build/lib/CL/devices/basic/CMakeFiles/pocl-devices-basic.dir/basic.c.o differ and comparing objdump -d pocl_llvm_build.cc.o shows the above diff The compilation uses /usr/bin/clang++ -I../lib/CL/../../fix-include/OpenCL -I../fix-include -I../include -I. -I../lib/CL/devices -I../lib/CL/. -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -DNDEBUG -O2 -g -DNDEBUG -fPIC -Werror=implicit-function-declaration -I/usr/include -O2 -D_FORTIFY_SOURCE=0 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -fno-strict-aliasing -fPIC -fvisibility-inlines-hidden -std=c++11 -ffunction-sections -fdata-sections -O2 -g -DNDEBUG -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I"/home/abuild/rpmbuild/BUILD/pocl-1.2/lib/CL/../llvmopencl" -MD -MT lib/CL/CMakeFiles/lib_cl_llvm.dir/pocl_llvm_build.cc.o -MF lib/CL/CMakeFiles/lib_cl_llvm.dir/pocl_llvm_build.cc.o.d -o lib/CL/CMakeFiles/lib_cl_llvm.dir/pocl_llvm_build.cc.o -c ../lib/CL/pocl_llvm_build.cc so at least no explicit -march is used. Maybe a clang/llvm bug? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1110722 http://bugzilla.opensuse.org/show_bug.cgi?id=1110722#c2 --- Comment #2 from Bernhard Wiedemann <bwiedemann@suse.com> --- Not a llvm bug, but /home/abuild/rpmbuild/BUILD/pocl-1.2/build/config.h @@ -135,7 +135,7 @@ /* used in lib/CL/devices/basic */ #define OCL_KERNEL_TARGET "x86_64-unknown-linux-gnu" -#define OCL_KERNEL_TARGET_CPU "haswell" +#define OCL_KERNEL_TARGET_CPU "pentium2" being used in all 3 differing .o files: lib/CL/devices/basic/basic.c: dev->llvm_cpu = OCL_KERNEL_TARGET_CPU; lib/CL/pocl_llvm_utils.cc: OCL_KERNEL_TARGET_CPU " for -target-cpu\n"); lib/CL/pocl_llvm_utils.cc: r = llvm::StringRef(OCL_KERNEL_TARGET_CPU); lib/CL/pocl_llvm_build.cc: kernellib_fallback += OCL_KERNEL_TARGET_CPU; -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1110722 http://bugzilla.opensuse.org/show_bug.cgi?id=1110722#c3 Martin Pluskal <mpluskal@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|Major |Minor --- Comment #3 from Martin Pluskal <mpluskal@suse.com> --- Definitely not major issue -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1110722 http://bugzilla.opensuse.org/show_bug.cgi?id=1110722#c4 Bernhard Wiedemann <bwiedemann@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |IN_PROGRESS --- Comment #4 from Bernhard Wiedemann <bwiedemann@suse.com> --- Proposing this patch upstream: https://github.com/pocl/pocl/pull/667 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1110722 http://bugzilla.opensuse.org/show_bug.cgi?id=1110722#c5 Bernhard Wiedemann <bwiedemann@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|IN_PROGRESS |CONFIRMED Severity|Minor |Normal --- Comment #5 from Bernhard Wiedemann <bwiedemann@suse.com> --- The PR had been merged, but pocl-1.4 had new compile-time CPU-detection: https://github.com/pocl/pocl/issues/793 This can cause crashes when compiled on new CPUs and run on old CPUs. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com