Bug 218644 - fix build lang/beignet with llvm 4.0
Summary: fix build lang/beignet with llvm 4.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-x11 (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-13 19:59 UTC by Eric Camachat
Modified: 2017-11-27 13:45 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (x11)


Attachments
fix build lang/beignet with llvm 4.0 (120.29 KB, patch)
2017-04-13 19:59 UTC, Eric Camachat
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Camachat 2017-04-13 19:59:56 UTC
Created attachment 181768 [details]
fix build lang/beignet with llvm 4.0

Add fix for compiling with LLVM 4.0 from upstream.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2017-06-30 19:32:25 UTC
Does runtime actually work with the patch, not just builds? Can you try the patch in review D11377 instead?
Comment 2 Eric Camachat 2017-06-30 21:41:31 UTC
(In reply to Jan Beich from comment #1)
It runs with UFS, but not ZFS. On ZFS it will get mlock() EAGIN error.
I will try review D11377.
Comment 3 Eric Camachat 2017-06-30 21:42:54 UTC
(In reply to Eric Camachat from comment #2)
Pasted into wrong bug, please ignore it, sorry.
Comment 4 Eric Camachat 2017-06-30 21:52:22 UTC
(In reply to Jan Beich from comment #1)
No it will stick:
% clinfo                                    
unable to load /usr/local/lib/beignet//libgbeinterp.so which is part of the driver, please check!                                                                                     
Number of platforms                               1                                        
  Platform Name                                   Intel Gen OCL Driver                     
  Platform Vendor                                 Intel                                    
  Platform Version                                OpenCL 2.0 beignet 1.3                   
  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_byte_addressable_store cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_depth_images cl_khr_icd cl_intel_accelerator cl_intel_subgroups cl_intel_subgroups_short cl_khr_gl_sharing                            
  Platform Extensions function suffix             Intel                                    


^C

I am testing review D11377.
Comment 5 Eric Camachat 2017-07-01 00:35:34 UTC
(In reply to Eric Camachat from comment #2)
D11377 has the same hang:
% clinfo
Number of platforms                               1
  Platform Name                                   Intel Gen OCL Driver
  Platform Vendor                                 Intel
  Platform Version                                OpenCL 2.0 beignet 1.4
  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_byte_addressable_store cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_depth_images cl_khr_spir cl_khr_icd cl_intel_accelerator cl_intel_subgroups cl_intel_subgroups_short cl_intel_media_block_io cl_intel_planar_yuv cl_khr_gl_sharing
  Platform Extensions function suffix             Intel

^C
$ truss clinfo
...
mmap(0x0,28672,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34508562432 (0x808dee000)
fstatat(AT_FDCWD,"/usr/local/lib/beignet/include",{ mode=drwxr-xr-x ,inode=213101,size=31,blksize=4096 },0x0) = 0 (0x0)
fstatat(AT_FDCWD,"/usr/local/lib/beignet/include/ocl_types.h",{ mode=-rw-r--r-- ,inode=205780,size=4523,blksize=4608 },0x0) = 0 (0x0)
fstatat(AT_FDCWD,"/usr/local/lib/beignet/include/ocl_defines.h",{ mode=-rw-r--r-- ,inode=205763,size=6593,blksize=6656 },0x0) = 0 (0x0)
openat(AT_FDCWD,"/usr/local/lib/beignet/include/ocl_types.h",O_RDONLY,00) = 5 (0x5)
fstatat(AT_FDCWD,"/usr",{ mode=drwxr-xr-x ,inode=9,size=17,blksize=4096 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
fstatat(AT_FDCWD,"/usr/local",{ mode=drwxr-xr-x ,inode=159,size=18,blksize=4096 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
fstatat(AT_FDCWD,"/usr/local/lib",{ mode=drwxr-xr-x ,inode=16470,size=578,blksize=16384 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
fstatat(AT_FDCWD,"/usr/local/lib/beignet",{ mode=drwxr-xr-x ,inode=213095,size=10,blksize=4096 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
fstatat(AT_FDCWD,"/usr/local/lib/beignet/include",{ mode=drwxr-xr-x ,inode=213101,size=31,blksize=4096 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
fstatat(AT_FDCWD,"/usr/local/lib/beignet/include/ocl_types.h",{ mode=-rw-r--r-- ,inode=205780,size=4523,blksize=4608 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
pread(5,"/*\n * Copyright \M-B\M-) 2012 -"...,4523,0x0) = 4523 (0x11ab)
sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
close(5)                                         = 0 (0x0)
sigprocmask(SIG_SETMASK,{ },0x0)                 = 0 (0x0)
Comment 6 Jan Beich freebsd_committer freebsd_triage 2017-07-15 04:01:41 UTC
(In reply to Eric Camachat from comment #4)
Can you reproduce with llvm39? On what FreeBSD version? Can you press Ctrl+T to check wait message[1] ?

I have a similar issue on 12.0 amd64 (with drm-next merged) where the process is stuck on [umtxn]. Prepending LD_PRELOAD=/lib/libthr.so.3 makes it work fine. The first bad appears to be base r319971, bisecting which is complicated by FREEBSD-diffs.

[1] https://wiki.freebsd.org/WaitChannels
Comment 7 Jan Beich freebsd_committer freebsd_triage 2017-07-16 15:23:48 UTC
Moved to bug 220767. Let's keep this bug about LLVM 4.0.
Comment 8 Eric Camachat 2017-07-17 17:39:36 UTC
(In reply to Jan Beich from comment #6)
Ctrl-T outputs:
load: 2.17  cmd: clinfo 492603 [umtxn] 3.79r 0.01u 0.03s 0% 16348k
load: 2.08  cmd: clinfo 492603 [umtxn] 6.68r 0.01u 0.03s 0% 16348k
load: 2.08  cmd: clinfo 492603 [umtxn] 7.31r 0.01u 0.03s 0% 16348k
load: 2.08  cmd: clinfo 492603 [umtxn] 7.94r 0.01u 0.03s 0% 16348k
load: 2.08  cmd: clinfo 492603 [umtxn] 8.46r 0.01u 0.03s 0% 16348k
load: 2.08  cmd: clinfo 492603 [umtxn] 9.14r 0.01u 0.03s 0% 16348k
load: 2.08  cmd: clinfo 492603 [umtxn] 9.58r 0.01u 0.03s 0% 16348k

# env LD_PRELOAD=/lib/libthr.so.3 clinfo                             
Number of platforms                               1                                      
  Platform Name                                   Intel Gen OCL Driver                   
  Platform Vendor                                 Intel                                  
  Platform Version                                OpenCL 2.0 beignet 1.4                 
  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_extende$_atomics cl_khr_byte_addressable_store cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_depth_images cl_khr_spir cl_khr_icd cl_intel_accelerator cl_intel_subgroups cl_int$l_subgroups_short cl_intel_media_block_io cl_intel_planar_yuv cl_khr_gl_sharing          
  Platform Extensions function suffix             Intel                                  
Beignet: self-test failed: (3, 7, 5) + (5, 7, 3) returned (3, 7, 5)                      
See README.md or http://www.freedesktop.org/wiki/Software/Beignet/                       
Beignet: disabling non-working device       

  Platform Name                                   Intel Gen OCL Driver                   
Number of devices                                 0                                      

NULL platform behavior                      
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Intel Gen OCL Driver                   
Beignet: disabling non-working device       
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Intel Gen OCL Driver                   
  clCreateContext(NULL, ...) [default]            No devices found in platform           
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform        
Beignet: disabling non-working device       
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in platform        
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform     
Beignet: disabling non-working device       
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No devices found in platform

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
Nothing to output !
Comment 9 commit-hook freebsd_committer freebsd_triage 2017-10-06 22:05:49 UTC
A commit references this bug:

Author: jbeich
Date: Fri Oct  6 22:05:14 UTC 2017
New revision: 451413
URL: https://svnweb.freebsd.org/changeset/ports/451413

Log:
  lang/beignet: update to 1.3.1.52 (Release_v1.3 branch snapshot)

  Changes:	https://github.com/intel/beignet/compare/be0ae74...afd050f6
  PR:		217635 218644
  Approved by:	maintainer timeout (2 months)
  MFH:		2017Q2 (requires r437953), 2017Q3 (regression fix for r435144)
  Differential Revision:	https://reviews.freebsd.org/D11377

Changes:
  head/lang/beignet/Makefile
  head/lang/beignet/distinfo
  head/lang/beignet/files/patch-src_cl__program.c
  head/lang/beignet/files/patch-utests_CMakeLists.txt
Comment 10 commit-hook freebsd_committer freebsd_triage 2017-10-06 22:05:51 UTC
A commit references this bug:

Author: jbeich
Date: Fri Oct  6 22:05:35 UTC 2017
New revision: 451414
URL: https://svnweb.freebsd.org/changeset/ports/451414

Log:
  lang/beignet: switch to LLVM 4.0 by default (like Mesa)

  PR:		218644
  Approved by:	maintainer timeout (2 months)
  MFH:		2017Q4 2017Q3 (consistency, minor optimizations)
  Differential Revision:	https://reviews.freebsd.org/D11377

Changes:
  head/lang/beignet/Makefile
Comment 11 commit-hook freebsd_committer freebsd_triage 2017-11-27 13:45:21 UTC
A commit references this bug:

Author: jbeich
Date: Mon Nov 27 13:44:27 UTC 2017
New revision: 454953
URL: https://svnweb.freebsd.org/changeset/ports/454953

Log:
  MFH: r451413 r453205

  lang/beignet: update to 1.3.2

  Changes:	https://01.org/beignet/downloads/beignet-1.3.2-2017-10-26
  PR:		217635 218644
  Approved by:	maintainer timeout (2 months)
  Approved by:	ports-secteam (swills)
  Differential Revision:	https://reviews.freebsd.org/D11377

Changes:
_U  branches/2017Q4/
  branches/2017Q4/lang/beignet/Makefile
  branches/2017Q4/lang/beignet/distinfo
  branches/2017Q4/lang/beignet/files/patch-src_cl__program.c
  branches/2017Q4/lang/beignet/files/patch-utests_CMakeLists.txt