svn commit: r520762 - in head/lang/intel-compute-runtime: . files
Jan Beich
jbeich at FreeBSD.org
Tue Dec 24 00:26:33 UTC 2019
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;
+ }
+
More information about the svn-ports-head
mailing list