1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-26 22:12:53 -05:00

Compare commits

..

4 Commits

Author SHA1 Message Date
Alik Aslanyan
cf6fa5a599 Merge 062f3f6d2d into ef14d55aa5 2024-08-26 18:19:56 -04:00
xmrig
ef14d55aa5 Merge pull request #3529 from eltociear/patch-1
docs: update ghostrider/README.md
2024-08-12 03:01:13 +07:00
Ikko Eltociear Ashimine
e682f89298 docs: update ghostrider/README.md
nubmer -> number
2024-08-12 03:54:26 +09:00
Alik Aslanyan
062f3f6d2d Implement pause-on-active for Linux 2021-04-01 08:31:35 +04:00
3 changed files with 61 additions and 2 deletions

View File

@@ -187,6 +187,13 @@ else()
)
set(EXTRA_LIBS pthread rt dl)
find_package(X11)
if(X11_FOUND)
include_directories(${X11_INCLUDE_DIR})
add_definitions(-DXMRIG_X11_FOUND)
endif()
elseif (XMRIG_OS_FREEBSD)
set(EXTRA_LIBS kvm pthread)
endif()

View File

@@ -38,7 +38,6 @@
#include <fstream>
#include <limits>
#include "base/kernel/Platform.h"
#include "version.h"
@@ -172,8 +171,61 @@ bool xmrig::Platform::isOnBatteryPower()
return false;
}
#if defined(XMRIG_OS_LINUX) && defined(XMRIG_X11_FOUND)
#include <dlfcn.h>
#include <X11/extensions/scrnsaver.h>
template<typename T>
void bind_symbol(T& var, void *library, const char* name) {
var = reinterpret_cast<T>(::dlsym(library, name));
}
uint64_t xmrig::Platform::idleTime()
{
// libX11
static Display* (*XOpenDisplay)(const char *name) = {};
// libXss
static XScreenSaverInfo* (*XScreenSaverAllocInfo)() = {};
static Status (*XScreenSaverQueryInfo)(Display *dpy, Drawable drawable,
XScreenSaverInfo *saver_info) = {};
static bool initialized = false;
static Display *dpy = {};
static XScreenSaverInfo *info = {};
if(!initialized) {
static void *libx11 = dlopen("/usr/lib/libX11.so", RTLD_LAZY);
static void *libxss = dlopen("/usr/lib/libXss.so", RTLD_LAZY);
if(!libxss || !libx11) {
initialized = true;
return std::numeric_limits<uint64_t>::max();
}
bind_symbol(XOpenDisplay, libx11, "XOpenDisplay");
bind_symbol(XScreenSaverAllocInfo, libxss, "XScreenSaverAllocInfo");
bind_symbol(XScreenSaverQueryInfo, libxss, "XScreenSaverQueryInfo");
dpy = XOpenDisplay(nullptr);
info = XScreenSaverAllocInfo();
initialized = true;
}
if (!dpy) {
return std::numeric_limits<uint64_t>::max();
}
XScreenSaverQueryInfo(dpy, DefaultRootWindow(dpy), info);
return info->idle;
}
#else
uint64_t xmrig::Platform::idleTime() {
return std::numeric_limits<uint64_t>::max();
}
#endif

View File

@@ -16,7 +16,7 @@ xmrig -a gr -o rtm.suprnova.cc:4273 --tls -u WALLET_ADDRESS -p x
You can use **rtm_ghostrider_example.cmd** as a template and put pool URL and your wallet address there. The general XMRig documentation is available [here](https://xmrig.com/docs/miner).
**Using `--threads` or `-t` option is NOT recommended because it turns off advanced built-in config.** If you want to tweak the nubmer of threads used for GhostRider, it's recommended to start using config.json instead of command line. The best suitable command line option for this is `--cpu-max-threads-hint=N` where N can be between 0 and 100.
**Using `--threads` or `-t` option is NOT recommended because it turns off advanced built-in config.** If you want to tweak the number of threads used for GhostRider, it's recommended to start using config.json instead of command line. The best suitable command line option for this is `--cpu-max-threads-hint=N` where N can be between 0 and 100.
## Performance