Browse Source

WIP large pages for randomx

rx-largepages
Duke Leto 2 years ago
parent
commit
88effe9a18
  1. 17
      src/miner.cpp

17
src/miner.cpp

@ -1068,14 +1068,19 @@ void static RandomXMiner()
miningTimer.start(); miningTimer.start();
randomx_flags flags = randomx_get_flags(); randomx_flags flags = randomx_get_flags();
// TODO: attempt to use large pages and fall back to no large pages // attempt to use large pages and fall back to no large pages
// flags |= RANDOMX_FLAG_LARGE_PAGES;
flags |= RANDOMX_FLAG_FULL_MEM; flags |= RANDOMX_FLAG_FULL_MEM;
//flags |= RANDOMX_FLAG_JIT; //flags |= RANDOMX_FLAG_JIT;
randomx_cache *randomxCache = randomx_alloc_cache(flags); //flags |= RANDOMX_FLAG_LARGE_PAGES;
if (randomxCache == NULL) { randomx_cache *randomxCache = randomx_alloc_cache(flags | RANDOMX_FLAG_LARGE_PAGES);
LogPrintf("RandomX cache is null, something is wrong, cannot mine!\n"); if (randomxCache == nullptr) {
return; fprintf(stderr,"%s: unable to allocate with large pages\n", __func__);
LogPrintf("Unable to use randomx large pages, trying without...\n");
randomx_cache *randomxCache = randomx_alloc_cache(flags);
if (randomxCache == nullptr) {
LogPrintf("Unable to create randomx cache, cannot mine!\n");
return;
}
} }
rxdebug("%s: created randomx flags + cache\n"); rxdebug("%s: created randomx flags + cache\n");
randomx_dataset *randomxDataset = randomx_alloc_dataset(flags); randomx_dataset *randomxDataset = randomx_alloc_dataset(flags);

Loading…
Cancel
Save