Date: Sat, 14 Nov 2020 19:42:18 +0000 (UTC) From: Jan Beich <jbeich@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r555140 - in head/lang/intel-compute-runtime: . files Message-ID: <202011141942.0AEJgIqN069072@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jbeich Date: Sat Nov 14 19:42:17 2020 New Revision: 555140 URL: https://svnweb.freebsd.org/changeset/ports/555140 Log: lang/intel-compute-runtime: enable DG1 (Intel Xe) support No kernel support yet. To catch regressions early. Modified: head/lang/intel-compute-runtime/Makefile (contents, props changed) head/lang/intel-compute-runtime/files/patch-max_freq (contents, props changed) Modified: head/lang/intel-compute-runtime/Makefile ============================================================================== --- head/lang/intel-compute-runtime/Makefile Sat Nov 14 19:42:07 2020 (r555139) +++ head/lang/intel-compute-runtime/Makefile Sat Nov 14 19:42:17 2020 (r555140) @@ -2,7 +2,7 @@ PORTNAME= compute-runtime DISTVERSION= 20.45.18403 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= lang PKGNAMEPREFIX= intel- @@ -25,7 +25,7 @@ USES= cmake compiler:c++14-lang localbase:ldflags pkg USE_GITHUB= yes USE_LDCONFIG= yes GH_ACCOUNT= intel -CMAKE_ON= SKIP_UNIT_TESTS +CMAKE_ON= SKIP_UNIT_TESTS SUPPORT_DG1 CMAKE_ARGS= -DNEO_OCL_DRIVER_VERSION:STRING="${DISTVERSIONFULL}" PLIST_FILES= bin/ocloc \ etc/OpenCL/vendors/intel.icd \ Modified: head/lang/intel-compute-runtime/files/patch-max_freq ============================================================================== --- head/lang/intel-compute-runtime/files/patch-max_freq Sat Nov 14 19:42:07 2020 (r555139) +++ head/lang/intel-compute-runtime/files/patch-max_freq Sat Nov 14 19:42:17 2020 (r555140) @@ -51,3 +51,52 @@ 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 +@@ -13,11 +13,38 @@ + + #include <fstream> + ++#if defined(__FreeBSD__) ++#include <sys/param.h> ++#include <sys/sysctl.h> ++#include <cstdio> ++#include <cstdlib> ++#endif ++ + namespace NEO { + class OsContext; + + 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 + + ifs >> maxGpuFrequency; + ifs.close(); ++#endif + return 0; + } +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011141942.0AEJgIqN069072>