diff --git a/lang/intel-compute-runtime/Makefile b/lang/intel-compute-runtime/Makefile index 5e651f6c09c3..63f05e23d43f 100644 --- a/lang/intel-compute-runtime/Makefile +++ b/lang/intel-compute-runtime/Makefile @@ -1,61 +1,61 @@ PORTNAME= compute-runtime -DISTVERSION= 21.26.20194 +DISTVERSION= 21.28.20343 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 MAINTAINER= jbeich@FreeBSD.org COMMENT= OpenCL implementation for Intel HD 5000 (Gen8) or newer LICENSE= MIT -LICENSE_FILE= ${WRKSRC}/LICENSE +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= 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.1.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 99580dd554f9..982f267b4996 100644 --- a/lang/intel-compute-runtime/distinfo +++ b/lang/intel-compute-runtime/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1624469270 -SHA256 (intel-compute-runtime-21.26.20194_GH0.tar.gz) = 6bcc4490056ed19daf855522dad27477895592f904c9d826ef8e74b43a510fae -SIZE (intel-compute-runtime-21.26.20194_GH0.tar.gz) = 4118495 +TIMESTAMP = 1625585536 +SHA256 (intel-compute-runtime-21.28.20343_GH0.tar.gz) = 96df25eaea7b414f0a23237b36c16f1d1c029e2abbda08883cec7a98f9cd7fbb +SIZE (intel-compute-runtime-21.28.20343_GH0.tar.gz) = 4248628 SHA256 (4a926516c3ea.patch) = 1a9c4694dbe892f01a7d3be5c5229b6b3bb34222848d61054f7bdf91134ca60f SIZE (4a926516c3ea.patch) = 1691 diff --git a/lang/intel-compute-runtime/files/patch-max_freq b/lang/intel-compute-runtime/files/patch-max_freq index f1789e82aaa4..8f1d8c50571b 100644 --- a/lang/intel-compute-runtime/files/patch-max_freq +++ b/lang/intel-compute-runtime/files/patch-max_freq @@ -1,102 +1,107 @@ /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 2020-04-17 18:43:38 UTC +--- shared/source/os_interface/linux/drm_query.cpp.orig 2021-07-16 13:20:44 UTC +++ shared/source/os_interface/linux/drm_query.cpp -@@ -11,10 +11,37 @@ +@@ -15,6 +15,13 @@ #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"; -@@ -26,6 +53,7 @@ int Drm::getMaxGpuFrequency(HardwareInfo &hwInfo, int +@@ -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 2020-11-07 13:04:57 UTC +--- 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 -@@ -13,11 +13,38 @@ +@@ -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) { + 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"; -@@ -29,6 +56,7 @@ int Drm::getMaxGpuFrequency(HardwareInfo &hwInfo, int +@@ -48,6 +75,7 @@ int Drm::getMaxGpuFrequency(HardwareInfo &hwInfo, int ifs >> maxGpuFrequency; ifs.close(); +#endif return 0; }