Date: Tue, 24 Dec 2019 00:26:32 +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: r520762 - in head/lang/intel-compute-runtime: . files Message-ID: <201912240026.xBO0QWUl071580@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jbeich Date: Tue Dec 24 00:26:32 2019 New Revision: 520762 URL: https://svnweb.freebsd.org/changeset/ports/520762 Log: lang/intel-compute-runtime: fix CL_DEVICE_MAX_CLOCK_FREQUENCY Added: head/lang/intel-compute-runtime/files/patch-max_freq (contents, props changed) Modified: head/lang/intel-compute-runtime/Makefile (contents, props changed) Modified: head/lang/intel-compute-runtime/Makefile ============================================================================== --- head/lang/intel-compute-runtime/Makefile Tue Dec 24 00:26:23 2019 (r520761) +++ head/lang/intel-compute-runtime/Makefile Tue Dec 24 00:26:32 2019 (r520762) @@ -2,7 +2,7 @@ PORTNAME= compute-runtime DISTVERSION= 19.50.15079 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= lang PKGNAMEPREFIX= intel- Added: head/lang/intel-compute-runtime/files/patch-max_freq ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/intel-compute-runtime/files/patch-max_freq Tue Dec 24 00:26:32 2019 (r520762) @@ -0,0 +1,44 @@ +/sys/bus/pci/devices doesn't exist as kms-drm exports sysfs via sysctl + + $ clinfo | fgrep clock + Max clock frequency 0MHz + +--- runtime/os_interface/linux/drm_neo.cpp.orig 2019-12-09 17:18:41 UTC ++++ runtime/os_interface/linux/drm_neo.cpp +@@ -16,6 +16,11 @@ + #include <cstring> + #include <fstream> + ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ++#include <sys/param.h> ++#include <sys/sysctl.h> ++#endif ++ + namespace NEO { + + const char *Drm::sysFsDefaultGpuPath = "/drm/card0"; +@@ -66,6 +71,16 @@ int Drm::getEnabledPooledEu(int &enabled) { + + int Drm::getMaxGpuFrequency(int &maxGpuFrequency) { + maxGpuFrequency = 0; ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ++ char max_freq[PAGE_SIZE]; ++ size_t len = sizeof(max_freq); ++ ++ if (sysctlbyname("sys.class.drm.card0.gt_max_freq_mhz", &max_freq, &len, NULL, 0)) { ++ return 0; ++ } ++ ++ maxGpuFrequency = std::stoi(max_freq); ++#else + int deviceID = 0; + int ret = getDeviceID(deviceID); + if (ret != 0) { +@@ -87,6 +102,7 @@ int Drm::getMaxGpuFrequency(int &maxGpuFrequency) { + + ifs >> maxGpuFrequency; + ifs.close(); ++#endif + return 0; + } +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912240026.xBO0QWUl071580>