diff --git a/lang/intel-compute-runtime/Makefile b/lang/intel-compute-runtime/Makefile index 0cff1f981e71..15d0041c0c3d 100644 --- a/lang/intel-compute-runtime/Makefile +++ b/lang/intel-compute-runtime/Makefile @@ -1,61 +1,61 @@ PORTNAME= compute-runtime -DISTVERSION= 22.17.23034 +DISTVERSION= 22.18.23063 CATEGORIES= lang PKGNAMEPREFIX= intel- PKGNAMESUFFIX= -${FLAVOR} MAINTAINER= jbeich@FreeBSD.org COMMENT= OpenCL implementation for Intel HD 5000 (Gen8) or newer LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE.md ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON= only Intel GPUs on x86 are supported LIB_DEPENDS= libigc.so:devel/intel-graphics-compiler@${FLAVOR} \ libigdgmm.so:multimedia/gmmlib FLAVORS= ${12 11:L:S/^/llvm/} CONFLICTS_INSTALL= ${PORTNAME}-* USES= cmake compiler:c++17-lang localbase:ldflags pkgconfig USE_GITHUB= yes USE_LDCONFIG= yes GH_ACCOUNT= intel CMAKE_ON= RELEASE_WITH_REGKEYS SKIP_UNIT_TESTS SUPPORT_DG1 CMAKE_ARGS= -DNEO_OCL_DRIVER_VERSION:STRING="${DISTVERSIONFULL}" PLIST_FILES= bin/ocloc \ etc/OpenCL/vendors/intel.icd \ include/ocloc_api.h \ lib/intel-opencl/libigdrcl.so \ lib/libocloc.so \ ${NULL} OPTIONS_DEFINE= L0 VAAPI OPTIONS_DEFAULT=L0 VAAPI L0_DESC= oneAPI Level Zero support L0_BUILD_DEPENDS= level-zero>=1.0:devel/level-zero L0_CMAKE_BOOL= BUILD_WITH_L0 L0_CMAKE_ON= -DNEO_VERSION_BUILD:STRING="0" L0_PLIST_FILES= lib/libze_intel_gpu.so.1 \ lib/libze_intel_gpu.so.1.3.0 VAAPI_BUILD_DEPENDS= ${LOCALBASE}/include/va/va.h:multimedia/libva VAAPI_CMAKE_BOOL_OFF= DISABLE_LIBVA post-patch: @${REINPLACE_CMD} -e '/-Werror/d' \ -e '/FORCE_RESPONSE_FILE/d' \ ${WRKSRC}/CMakeLists.txt @${REINPLACE_CMD} -e '/OCL_ICD_VENDORDIR/s,/etc,${PREFIX}&,' \ ${WRKSRC}/package.cmake post-install: # install/strip has no effect on install(FILES), so strip manually ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/* ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/intel-opencl/*.so .include diff --git a/lang/intel-compute-runtime/distinfo b/lang/intel-compute-runtime/distinfo index 310fd1018785..7d517b45782c 100644 --- a/lang/intel-compute-runtime/distinfo +++ b/lang/intel-compute-runtime/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1650469592 -SHA256 (intel-compute-runtime-22.17.23034_GH0.tar.gz) = d46ef4801b202f031d516da62e7e4f7da26288238f8371f67d63e1dd57d98b62 -SIZE (intel-compute-runtime-22.17.23034_GH0.tar.gz) = 5345890 +TIMESTAMP = 1650875994 +SHA256 (intel-compute-runtime-22.18.23063_GH0.tar.gz) = 3dc6a530838cd80c17fa4de64e615e5aa228623029cd7da4564ced378a5264fa +SIZE (intel-compute-runtime-22.18.23063_GH0.tar.gz) = 5355944 diff --git a/lang/intel-compute-runtime/files/patch-userptr b/lang/intel-compute-runtime/files/patch-userptr index bcaa948d75ee..189b17e940a8 100644 --- a/lang/intel-compute-runtime/files/patch-userptr +++ b/lang/intel-compute-runtime/files/patch-userptr @@ -1,61 +1,61 @@ Try unsynchronized userptr if regular one fails. https://github.com/FreeBSDDesktop/kms-drm/issues/197 Process 51117 stopped * thread #1, name = 'clinfo', stop reason = signal SIGABRT frame #0: 0x000000080044fe7a libc.so.7`__sys_thr_kill at thr_kill.S:4 (lldb) bt * thread #1, name = 'clinfo', stop reason = signal SIGABRT * frame #0: 0x000000080044fe7a libc.so.7`__sys_thr_kill at thr_kill.S:4 frame #1: 0x000000080044f7e4 libc.so.7`__raise(s=6) at raise.c:52:10 frame #2: 0x00000008003b3a89 libc.so.7`abort at abort.c:67:8 frame #3: 0x000000080043a711 libc.so.7`__assert(func=, file=, line=, failedexpr=) at assert.c:51:2 frame #4: 0x0000000800e255ad libigdrcl.so`NEO::debugBreak(line=58, file="compute-runtime-19.48.14977/runtime/os_interface/linux/drm_memory_manager.cpp") at debug_helpers.cpp:19:9 frame #5: 0x000000080104b4e5 libigdrcl.so`NEO::DrmMemoryManager::DrmMemoryManager(this=0x00000008018e7300, mode=gemCloseWorkerActive, forcePinAllowed=true, validateHostPtrMemory=true, executionEnvironment=0x00000008018f6180) at drm_memory_manager.cpp:58:9 frame #6: 0x0000000800f07bb1 libigdrcl.so`std::__1::__unique_if::__unique_single std::__1::make_unique(__args=0x00007fffffffda4c, __args=0x00007fffffffda4b, __args=0x00007fffffffda4a, __args=0x00000008018f6180) at memory:3003:32 frame #7: 0x0000000800f07ad4 libigdrcl.so`NEO::MemoryManager::createMemoryManager(executionEnvironment=0x00000008018f6180) at create_drm_memory_manager.cpp:16:12 frame #8: 0x0000000800fbce8b libigdrcl.so`NEO::ExecutionEnvironment::initializeMemoryManager(this=0x00000008018f6180) at execution_environment.cpp:63:25 frame #9: 0x0000000801058c9d libigdrcl.so`NEO::Platform::initialize(this=0x00000008025ea0a0) at platform.cpp:144:27 frame #10: 0x0000000800e259f2 libigdrcl.so`::clGetPlatformIDs(numEntries=1, platforms=0x0000000800251500, numPlatforms=0x0000000000000000) at api.cpp:82:35 frame #11: 0x0000000800e25c54 libigdrcl.so`::clIcdGetPlatformIDsKHR(numEntries=1, platforms=0x0000000800251500, numPlatforms=0x0000000000000000) at api.cpp:112:14 frame #12: 0x000000080025d0e0 libOpenCL.so.1`__initClIcd + 3392 frame #13: 0x00000008006a61a8 libthr.so.3`_thr_once(once_control=0x000000080026e038, init_routine=(libOpenCL.so.1`__initClIcd)) at thr_once.c:98:2 frame #14: 0x000000080025b670 libOpenCL.so.1`clGetPlatformIDs_hid + 320 frame #15: 0x000000000020f9cd clinfo`main(argc=, argv=0x00007fffffffe188) at clinfo.c:2656:10 frame #16: 0x000000000020713d clinfo`_start(ap=, cleanup=) at crt1.c:76:7 (lldb) f 5 frame #5: 0x000000080104b4e5 libigdrcl.so`NEO::DrmMemoryManager::DrmMemoryManager(this=0x00000008018e7300, mode=gemCloseWorkerActive, forcePinAllowed=true, validateHostPtrMemory=true, executionEnvironment=0x00000008018f6180) at drm_memory_manager.cpp:58:9 50 51 if (forcePinEnabled || validateHostPtrMemory) { 52 pinBB = allocUserptr(reinterpret_cast(memoryForPinBB), MemoryConstants::pageSize, 0, 0); 53 } 54 55 if (!pinBB) { 56 alignedFreeWrapper(memoryForPinBB); 57 memoryForPinBB = nullptr; -> 58 DEBUG_BREAK_IF(true); 59 UNRECOVERABLE_IF(validateHostPtrMemory); 60 } 61 } ---- shared/source/os_interface/linux/drm_memory_manager.cpp.orig 2020-02-28 16:16:42 UTC +--- shared/source/os_interface/linux/drm_memory_manager.cpp.orig 2022-04-25 08:39:54 UTC +++ shared/source/os_interface/linux/drm_memory_manager.cpp -@@ -148,7 +148,17 @@ NEO::BufferObject *DrmMemoryManager::allocUserptr(uint - userptr.flags = static_cast(flags); +@@ -246,7 +246,17 @@ NEO::BufferObject *DrmMemoryManager::allocUserptr(uint + auto &drm = this->getDrm(rootDeviceIndex); - if (this->getDrm(rootDeviceIndex).ioctl(DRM_IOCTL_I915_GEM_USERPTR, &userptr) != 0) { + if (drm.ioctl(DRM_IOCTL_I915_GEM_USERPTR, &userptr) != 0) { - return nullptr; + if (errno == ENODEV && userptr.flags == 0) { + userptr.flags = I915_USERPTR_UNSYNCHRONIZED; -+ if (this->getDrm(rootDeviceIndex).ioctl(DRM_IOCTL_I915_GEM_USERPTR, &userptr) != 0) { ++ if (drm.ioctl(DRM_IOCTL_I915_GEM_USERPTR, &userptr) != 0) { + if (geteuid() != 0) { + printDebugString(true, stderr, "%s", "ioctl(I915_GEM_USERPTR) failed. Try running as root but expect poor stability.\n"); + } + return nullptr; + } + } else { + return nullptr; + } } - auto res = new (std::nothrow) BufferObject(&getDrm(rootDeviceIndex), userptr.handle, rootDeviceIndex); + PRINT_DEBUG_STRING(DebugManager.flags.PrintBOCreateDestroyResult.get(), stdout, "Created new BO with GEM_USERPTR, handle: BO-%d\n", userptr.handle);