diff --git a/lang/intel-compute-runtime/Makefile b/lang/intel-compute-runtime/Makefile index f393ca4d606e..47168dd162bf 100644 --- a/lang/intel-compute-runtime/Makefile +++ b/lang/intel-compute-runtime/Makefile @@ -1,61 +1,61 @@ PORTNAME= compute-runtime -DISTVERSION= 21.36.20889 +DISTVERSION= 21.37.20939 CATEGORIES= lang PKGNAMEPREFIX= intel- PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/ -PATCHFILES+= 4a926516c3ea.patch:-p1 # https://github.com/intel/compute-runtime/pull/361 +PATCHFILES+= aa5a39a2db79.patch:-p1 # https://github.com/intel/compute-runtime/pull/361 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 i386 ONLY_FOR_ARCHS_REASON= Only Intel GPUs on x86 are supported LIB_DEPENDS= libigc.so:devel/intel-graphics-compiler \ libigdgmm.so:multimedia/gmmlib 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= VAAPI OPTIONS_DEFAULT=VAAPI OPTIONS_DEFINE_amd64= L0 OPTIONS_DEFAULT_amd64= L0 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.2.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 05cce936a145..1c7b088321da 100644 --- a/lang/intel-compute-runtime/distinfo +++ b/lang/intel-compute-runtime/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1630693229 -SHA256 (intel-compute-runtime-21.36.20889_GH0.tar.gz) = a6865bae0be21f13917da0da73329c0fa5ec7d899b4402947eaea36d4cc86631 -SIZE (intel-compute-runtime-21.36.20889_GH0.tar.gz) = 4569511 -SHA256 (4a926516c3ea.patch) = 1a9c4694dbe892f01a7d3be5c5229b6b3bb34222848d61054f7bdf91134ca60f -SIZE (4a926516c3ea.patch) = 1691 +TIMESTAMP = 1631283767 +SHA256 (intel-compute-runtime-21.37.20939_GH0.tar.gz) = 306fac63d58fd08c9ae1e5fceab8bb89c2c892c6e1579f66c4d936e5b581eb4b +SIZE (intel-compute-runtime-21.37.20939_GH0.tar.gz) = 4576917 +SHA256 (aa5a39a2db79.patch) = fc2290d950fed2bcde8fd6ce13cefb64d90ca348ae364a46a480c1d2509f67f9 +SIZE (aa5a39a2db79.patch) = 1691 diff --git a/lang/intel-compute-runtime/files/patch-max_freq b/lang/intel-compute-runtime/files/patch-max_freq index 8f1d8c50571b..3c5afd6896a6 100644 --- a/lang/intel-compute-runtime/files/patch-max_freq +++ b/lang/intel-compute-runtime/files/patch-max_freq @@ -1,107 +1,56 @@ /sys/bus/pci/devices doesn't exist as kms-drm exports sysfs via sysctl $ clinfo | fgrep clock Max clock frequency 0MHz ---- shared/source/os_interface/linux/drm_query.cpp.orig 2021-07-16 13:20:44 UTC -+++ shared/source/os_interface/linux/drm_query.cpp -@@ -15,6 +15,13 @@ - - #include +--- shared/source/os_interface/linux/drm_neo.cpp.orig 2021-09-10 14:22:47 UTC ++++ shared/source/os_interface/linux/drm_neo.cpp +@@ -34,6 +34,13 @@ + #include + #include +#if defined(__FreeBSD__) +#include +#include +#include +#include +#endif + namespace NEO { namespace IoctlHelper { -@@ -35,6 +42,26 @@ std::string getIoctlParamStringRemaining(int param) { - - int Drm::getMaxGpuFrequency(HardwareInfo &hwInfo, int &maxGpuFrequency) { - maxGpuFrequency = 0; -+#if defined(__FreeBSD__) -+ char name[SPECNAMELEN + 1]; -+ if (!fdevname_r(getFileDescriptor(), name, sizeof(name))) { -+ return 0; -+ } -+ int id; -+ if (!sscanf(name, "drm/%d", &id) && !sscanf(name, "dri/renderD%d", &id)) { -+ return 0; -+ } -+ -+ char oid[MAXPATHLEN + 1]; -+ char max_freq[PAGE_SIZE]; -+ size_t len = sizeof(max_freq); -+ snprintf(oid, sizeof(oid), "sys.class.drm.card%d.gt_max_freq_mhz", id - 128); -+ if (sysctlbyname(oid, &max_freq, &len, NULL, 0)) { -+ return 0; -+ } -+ -+ maxGpuFrequency = std::stoi(max_freq); -+#else - std::string clockSysFsPath = getSysFsPciPath(); - - clockSysFsPath += "/gt_max_freq_mhz"; -@@ -46,6 +73,7 @@ int Drm::getMaxGpuFrequency(HardwareInfo &hwInfo, int - - ifs >> maxGpuFrequency; - ifs.close(); -+#endif - return 0; - } - ---- shared/source/os_interface/linux/drm_query_dg1.cpp.orig 2021-07-16 13:20:44 UTC -+++ shared/source/os_interface/linux/drm_query_dg1.cpp -@@ -16,6 +16,13 @@ - - #include - -+#if defined(__FreeBSD__) -+#include -+#include -+#include -+#include -+#endif -+ - namespace NEO { - class OsContext; - -@@ -37,6 +44,26 @@ std::string getIoctlParamStringRemaining(int param) { +@@ -800,6 +807,26 @@ bool Drm::sysmanQueryEngineInfo() { - int Drm::getMaxGpuFrequency(HardwareInfo &hwInfo, int &maxGpuFrequency) { + int getMaxGpuFrequencyOfDevice(Drm &drm, std::string &sysFsPciPath, int &maxGpuFrequency) { maxGpuFrequency = 0; +#if defined(__FreeBSD__) + char name[SPECNAMELEN + 1]; -+ if (!fdevname_r(getFileDescriptor(), name, sizeof(name))) { ++ if (!fdevname_r(drm.getFileDescriptor(), name, sizeof(name))) { + return 0; + } + int id; + if (!sscanf(name, "drm/%d", &id) && !sscanf(name, "dri/renderD%d", &id)) { + return 0; + } + + char oid[MAXPATHLEN + 1]; + char max_freq[PAGE_SIZE]; + size_t len = sizeof(max_freq); + snprintf(oid, sizeof(oid), "sys.class.drm.card%d.gt_max_freq_mhz", id - 128); + if (sysctlbyname(oid, &max_freq, &len, NULL, 0)) { + return 0; + } + + maxGpuFrequency = std::stoi(max_freq); +#else - std::string clockSysFsPath = getSysFsPciPath(); + std::string clockSysFsPath = sysFsPciPath + "/gt_max_freq_mhz"; - clockSysFsPath += "/gt_max_freq_mhz"; -@@ -48,6 +75,7 @@ int Drm::getMaxGpuFrequency(HardwareInfo &hwInfo, int + std::ifstream ifs(clockSysFsPath.c_str(), std::ifstream::in); +@@ -809,6 +836,7 @@ int getMaxGpuFrequencyOfDevice(Drm &drm, std::string & ifs >> maxGpuFrequency; ifs.close(); +#endif return 0; }