mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-06 15:42:38 -05:00
Compare commits
93 Commits
v4.0.1-bet
...
v4.2.1-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96b2560f79 | ||
|
|
923d47fff0 | ||
|
|
542a27a032 | ||
|
|
a7e8ac6cf8 | ||
|
|
42fd146c2b | ||
|
|
34468782cd | ||
|
|
3badeb56a0 | ||
|
|
bc18b5d0be | ||
|
|
158d2e4302 | ||
|
|
f60118ee79 | ||
|
|
6bc217e985 | ||
|
|
3560b6a3c2 | ||
|
|
77eecdd2c2 | ||
|
|
f4943b77f3 | ||
|
|
c908ef2489 | ||
|
|
d21155f3c6 | ||
|
|
da39ed2ce0 | ||
|
|
06500761fb | ||
|
|
919a6c0cc4 | ||
|
|
467e5115b0 | ||
|
|
c495802f64 | ||
|
|
66e48ed2d7 | ||
|
|
ac4cd3eb9b | ||
|
|
5d73402651 | ||
|
|
427b6516e0 | ||
|
|
eae9009b98 | ||
|
|
166d8dd53c | ||
|
|
680081b93b | ||
|
|
e66eeefb14 | ||
|
|
8e9e8cd169 | ||
|
|
f96538dfba | ||
|
|
9ad174c129 | ||
|
|
17b40ac4ad | ||
|
|
4453727754 | ||
|
|
d086318f4e | ||
|
|
5b7f1fe853 | ||
|
|
4c357d2d60 | ||
|
|
0eb5588454 | ||
|
|
5ba8b43fb8 | ||
|
|
0eb754d76e | ||
|
|
7c463849cc | ||
|
|
daed23422e | ||
|
|
550e332909 | ||
|
|
43f26dcd76 | ||
|
|
e1d1a5226c | ||
|
|
82aaa89ab6 | ||
|
|
aac384f54f | ||
|
|
ffccaa8817 | ||
|
|
bd488a6182 | ||
|
|
41ec1b4cb2 | ||
|
|
18bf9d3d95 | ||
|
|
56e070b3d1 | ||
|
|
88a9f8d892 | ||
|
|
0f367ab117 | ||
|
|
838f078fa5 | ||
|
|
d6f0555771 | ||
|
|
3ee3d13f0f | ||
|
|
6267ecc3dc | ||
|
|
1487a037ed | ||
|
|
1bba25e080 | ||
|
|
c6096c3c34 | ||
|
|
2604705bab | ||
|
|
5f948d0d96 | ||
|
|
3e42fa28df | ||
|
|
d9dc6a396f | ||
|
|
bdb72684b0 | ||
|
|
0f05936e63 | ||
|
|
290493e485 | ||
|
|
637301d340 | ||
|
|
c7e4815d79 | ||
|
|
54d73b7ac5 | ||
|
|
cbdf1e6c09 | ||
|
|
2e49930b94 | ||
|
|
9da0cb2ad1 | ||
|
|
cf6bd0e772 | ||
|
|
dc686bd1bf | ||
|
|
e002dbf57e | ||
|
|
38f4f4f695 | ||
|
|
a4bc548fe5 | ||
|
|
e57798360f | ||
|
|
3cbbc94249 | ||
|
|
cbc08e696f | ||
|
|
6e45ab599e | ||
|
|
e55fb68a29 | ||
|
|
7a1ff6bfed | ||
|
|
18809ddf0b | ||
|
|
05b2c66aaf | ||
|
|
50038516cb | ||
|
|
f6752310b4 | ||
|
|
1cd1f13fee | ||
|
|
7af3e4e340 | ||
|
|
171762d1aa | ||
|
|
78fd2fd0ac |
28
CHANGELOG.md
28
CHANGELOG.md
@@ -1,3 +1,23 @@
|
||||
# v4.2.1-beta
|
||||
- [#1150](https://github.com/xmrig/xmrig/issues/1150) Fixed build on FreeBSD.
|
||||
- [#1175](https://github.com/xmrig/xmrig/issues/1175) Fixed support for systems where total count of NUMA nodes not equal usable nodes count.
|
||||
- [#1199](https://github.com/xmrig/xmrig/issues/1199) Fixed excessive memory allocation for OpenCL threads with low intensity.
|
||||
- [#1212](https://github.com/xmrig/xmrig/issues/1212) Fixed low RandomX performance after fast algorithm switching.
|
||||
|
||||
# v4.2.0-beta
|
||||
- [#1202](https://github.com/xmrig/xmrig/issues/1202) Fixed algorithm verification in donate strategy.
|
||||
- Added per pool option `coin` with single possible value `monero` for pools without algorithm negotiation, for upcoming Monero fork.
|
||||
- Added config option `cpu/max-threads-hint` and command line option `--cpu-max-threads-hint`.
|
||||
|
||||
# v4.1.0-beta
|
||||
- **OpenCL backend disabled by default.**.
|
||||
- [#1183](https://github.com/xmrig/xmrig/issues/1183) Fixed compatibility with systemd.
|
||||
- [#1185](https://github.com/xmrig/xmrig/pull/1185) Added JIT compiler for RandomX on ARMv8.
|
||||
- Improved API endpoint `GET /2/backends` and added support for this endpoint to [workers.xmrig.info](http://workers.xmrig.info).
|
||||
- Added command line option `--no-cpu` to disable CPU backend.
|
||||
- Added OpenCL specific command line options: `--opencl`, `--opencl-devices`, `--opencl-platform`, `--opencl-loader` and `--opencl-no-cache`.
|
||||
- Removed command line option `--http-enabled`, HTTP API enabled automatically if any other `--http-*` option provided.
|
||||
|
||||
# v4.0.1-beta
|
||||
- [#1177](https://github.com/xmrig/xmrig/issues/1177) Fixed compatibility with old AMD drivers.
|
||||
- [#1180](https://github.com/xmrig/xmrig/issues/1180) Fixed possible duplicated shares after algorithm switching.
|
||||
@@ -9,6 +29,14 @@
|
||||
- [#268](https://github.com/xmrig/xmrig-amd/pull/268) [#270](https://github.com/xmrig/xmrig-amd/pull/270) [#271](https://github.com/xmrig/xmrig-amd/pull/271) [#273](https://github.com/xmrig/xmrig-amd/pull/273) [#274](https://github.com/xmrig/xmrig-amd/pull/274) [#1171](https://github.com/xmrig/xmrig/pull/1171) Added RandomX support for OpenCL, thanks [@SChernykh](https://github.com/SChernykh).
|
||||
- Algorithm `cn/wow` removed, as no longer alive.
|
||||
|
||||
# v3.2.0
|
||||
- Added per pool option `coin` with single possible value `monero` for pools without algorithm negotiation, for upcoming Monero fork.
|
||||
- [#1183](https://github.com/xmrig/xmrig/issues/1183) Fixed compatibility with systemd.
|
||||
|
||||
# v3.1.3
|
||||
- [#1180](https://github.com/xmrig/xmrig/issues/1180) Fixed possible duplicated shares after algorithm switching.
|
||||
- Fixed wrong config file permissions after write (only gcc builds on recent Windows 10 affected).
|
||||
|
||||
# v3.1.2
|
||||
- Many RandomX optimizations and fixes.
|
||||
- [#1132](https://github.com/xmrig/xmrig/issues/1132) Fixed build on CentOS 7.
|
||||
|
||||
@@ -71,6 +71,7 @@ set(HEADERS_CRYPTO
|
||||
src/crypto/cn/skein_port.h
|
||||
src/crypto/cn/soft_aes.h
|
||||
src/crypto/common/Algorithm.h
|
||||
src/crypto/common/Coin.h
|
||||
src/crypto/common/keccak.h
|
||||
src/crypto/common/Nonce.h
|
||||
src/crypto/common/portable/mm_malloc.h
|
||||
@@ -108,6 +109,7 @@ set(SOURCES_CRYPTO
|
||||
src/crypto/cn/CnCtx.cpp
|
||||
src/crypto/cn/CnHash.cpp
|
||||
src/crypto/common/Algorithm.cpp
|
||||
src/crypto/common/Coin.cpp
|
||||
src/crypto/common/keccak.cpp
|
||||
src/crypto/common/Nonce.cpp
|
||||
src/crypto/common/VirtualMemory.cpp
|
||||
@@ -143,7 +145,7 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Android")
|
||||
EXECUTE_PROCESS(COMMAND uname -o COMMAND tr -d '\n' OUTPUT_VARIABLE OPERATING_SYSTEM)
|
||||
if (OPERATING_SYSTEM MATCHES "Android")
|
||||
set(EXTRA_LIBS ${EXTRA_LIBS} log)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# XMRig
|
||||
|
||||
**:warning: [Monero will change PoW algorithm to RandomX on November 30.](https://github.com/xmrig/xmrig/issues/1204)**
|
||||
|
||||
[](https://github.com/xmrig/xmrig/releases)
|
||||
[](https://github.com/xmrig/xmrig/releases)
|
||||
[](https://github.com/xmrig/xmrig/releases)
|
||||
@@ -26,7 +28,7 @@ XMRig is a high performance RandomX and CryptoNight CPU miner, with official sup
|
||||
* Clone with `git clone https://github.com/xmrig/xmrig.git` :hammer: [Build instructions](https://github.com/xmrig/xmrig/wiki/Build).
|
||||
|
||||
## Usage
|
||||
Preferend way to configure miner is [JSON config file](src/config.json) as more flexible and human frendly, command line interface not cover all features, for example mining profiles for different algorithms. Most impotant options can be changed in runtime without miner restart by editing config or via API.
|
||||
The preferred way to configure the miner is the [JSON config file](src/config.json) as it is more flexible and human friendly. The command line interface does not cover all features, such as mining profiles for different algorithms. Important options can be changed during runtime without miner restart by editing the config file or executing API calls.
|
||||
|
||||
### Options
|
||||
```
|
||||
|
||||
@@ -51,6 +51,13 @@ if (WITH_RANDOMX)
|
||||
)
|
||||
# cheat because cmake and ccache hate each other
|
||||
set_property(SOURCE src/crypto/randomx/jit_compiler_x86_static.S PROPERTY LANGUAGE C)
|
||||
elseif (XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
list(APPEND SOURCES_CRYPTO
|
||||
src/crypto/randomx/jit_compiler_a64_static.S
|
||||
src/crypto/randomx/jit_compiler_a64.cpp
|
||||
)
|
||||
# cheat because cmake and ccache hate each other
|
||||
set_property(SOURCE src/crypto/randomx/jit_compiler_a64_static.S PROPERTY LANGUAGE C)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
|
||||
@@ -1,34 +1,20 @@
|
||||
# Algorithms
|
||||
|
||||
Since version 3 mining [algorithm](#algorithm-names) should specified for each pool separately (`algo` option), earlier versions was use one global `algo` option and per pool `variant` option (this option was removed in v3). If your pool support [mining algorithm negotiation](https://github.com/xmrig/xmrig-proxy/issues/168) you may not specify this option at all.
|
||||
|
||||
#### Example
|
||||
```json
|
||||
{
|
||||
"pools": [
|
||||
{
|
||||
"url": "...",
|
||||
"algo": "cn/r",
|
||||
...
|
||||
}
|
||||
],
|
||||
...
|
||||
}
|
||||
```
|
||||
Algorithm can be defined in 3 ways:
|
||||
|
||||
#### Pools with mining algorithm negotiation support.
|
||||
1. By pool, using algorithm negotiation, in this case no need specify algorithm on miner side.
|
||||
2. Per pool `coin` option, currently only usable value for this option is `monero`.
|
||||
3. Per pool `algo` option.
|
||||
|
||||
* [www.hashvault.pro](https://www.hashvault.pro/)
|
||||
* [moneroocean.stream](https://moneroocean.stream)
|
||||
|
||||
## Algorithm names
|
||||
Option `coin` useful for pools without algorithm negotiation support or daemon to allow automatically switch algorithm in next hard fork.
|
||||
|
||||
## Algorithm names
|
||||
|
||||
| Name | Memory | Version | Notes |
|
||||
|------|--------|---------|-------|
|
||||
| `rx/0` | 2 MB | 3.2.0+ | RandomX (Monero). |
|
||||
| `argon2/chukwa` | 512 KB | 3.1.0+ | Argon2id (Chukwa). |
|
||||
| `argon2/wrkz` | 256 KB | 3.1.0+ | Argon2id (WRKZ) |
|
||||
| `rx/test` | 2 MB | 3.0.0+ | RandomX (reference configuration). |
|
||||
| `rx/0` | 2 MB | 3.0.0+ | RandomX (reference configuration), reserved for future use. |
|
||||
| `rx/wow` | 1 MB | 3.0.0+ | RandomWOW. |
|
||||
| `rx/loki` | 2 MB | 3.0.0+ | RandomXL. |
|
||||
| `cn/fast` | 2 MB | 3.0.0+ | CryptoNight variant 1 with half iterations. |
|
||||
@@ -50,3 +36,21 @@ Since version 3 mining [algorithm](#algorithm-names) should specified for each p
|
||||
| `cn-lite/1` | 1 MB | 2.5.0+ | CryptoNight-Lite variant 1. |
|
||||
| `cn-lite/0` | 1 MB | 0.8.0+ | CryptoNight-Lite variant 0. |
|
||||
| `cn/0` | 2 MB | 0.5.0+ | CryptoNight (original). |
|
||||
|
||||
## Migration to v3
|
||||
Since version 3 mining [algorithm](#algorithm-names) should specified for each pool separately (`algo` option), earlier versions was use one global `algo` option and per pool `variant` option (this option was removed in v3). If your pool support [mining algorithm negotiation](https://github.com/xmrig/xmrig-proxy/issues/168) you may not specify this option at all.
|
||||
|
||||
#### Example
|
||||
```json
|
||||
{
|
||||
"pools": [
|
||||
{
|
||||
"url": "...",
|
||||
"algo": "cn/r",
|
||||
"coin": null
|
||||
...
|
||||
}
|
||||
],
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
@@ -94,3 +94,6 @@ Enable/configure or disable ASM optimizations. Possible values: `true`, `false`,
|
||||
|
||||
#### `argon2-impl` (since v3.1.0)
|
||||
Allow override automatically detected Argon2 implementation, this option added mostly for debug purposes, default value `null` means autodetect. Other possible values: `"x86_64"`, `"SSE2"`, `"SSSE3"`, `"XOP"`, `"AVX2"`, `"AVX-512F"`. Manual selection has no safe guards, if you CPU not support required instuctions, miner will crash.
|
||||
|
||||
#### `max-threads-hint` (since v4.2.0)
|
||||
Maximum CPU threads count (in percentage) hint for autoconfig. [CPU_MAX_USAGE.md](CPU_MAX_USAGE.md)
|
||||
|
||||
26
doc/CPU_MAX_USAGE.md
Normal file
26
doc/CPU_MAX_USAGE.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Maximum CPU usage
|
||||
|
||||
Please read this document carefully, `max-threads-hint` (was known as `max-cpu-usage`) option is most confusing option in the miner with many myth and legends.
|
||||
This option is just hint for automatic configuration and can't precise define CPU usage.
|
||||
|
||||
### Option definition
|
||||
#### Config file:
|
||||
```json
|
||||
{
|
||||
...
|
||||
"cpu": {
|
||||
"max-threads-hint": 100,
|
||||
...
|
||||
},
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
#### Command line
|
||||
`--cpu-max-threads-hint 100`
|
||||
|
||||
### Known issues and usage
|
||||
|
||||
* This option has no effect if miner already generated CPU configuration, to prevent config generation use `"autosave":false,`.
|
||||
* Only threads count can be changed, for 1 core CPU this option has no effect, for 2 core CPU only 2 values possible 50% and 100%, for 4 cores: 25%, 50%, 75%, 100%. etc.
|
||||
* You CPU may limited by other factors, eg cache.
|
||||
262
doc/topology/AMD_Opteron_6344_x2_N4_win7_2_0_4_bug.xml
Normal file
262
doc/topology/AMD_Opteron_6344_x2_N4_win7_2_0_4_bug.xml
Normal file
@@ -0,0 +1,262 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE topology SYSTEM "hwloc2.dtd">
|
||||
<topology version="2.0">
|
||||
<object type="Machine" os_index="0" cpuset="0x00ffffff" complete_cpuset="0x00ffffff" allowed_cpuset="0x00ffffff" nodeset="0x0000000f" complete_nodeset="0x0000000f" allowed_nodeset="0x0000000f" gp_index="1">
|
||||
<info name="Backend" value="Windows"/>
|
||||
<info name="hwlocVersion" value="2.0.4"/>
|
||||
<object type="Package" cpuset="0x00000fff" complete_cpuset="0x00000fff" nodeset="0x00000003" complete_nodeset="0x00000003" gp_index="36">
|
||||
<info name="CPUVendor" value="AuthenticAMD"/>
|
||||
<info name="CPUFamilyNumber" value="21"/>
|
||||
<info name="CPUModelNumber" value="2"/>
|
||||
<info name="CPUModel" value="AMD Opteron(tm) Processor 6344 "/>
|
||||
<info name="CPUStepping" value="0"/>
|
||||
<object type="L3Cache" cpuset="0x0000003f" complete_cpuset="0x0000003f" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="20" cache_size="12582912" depth="3" cache_linesize="64" cache_associativity="1" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="NUMANode" os_index="0" cpuset="0x0000003f" complete_cpuset="0x0000003f" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="80" local_memory="7009357824">
|
||||
<page_type size="4096" count="0"/>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000001" complete_cpuset="0x00000001" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="4" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000001" complete_cpuset="0x00000001" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="3" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00000001" complete_cpuset="0x00000001" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="2">
|
||||
<object type="PU" os_index="0" cpuset="0x00000001" complete_cpuset="0x00000001" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="85"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000002" complete_cpuset="0x00000002" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="7" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000002" complete_cpuset="0x00000002" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="6" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00000002" complete_cpuset="0x00000002" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="5">
|
||||
<object type="PU" os_index="1" cpuset="0x00000002" complete_cpuset="0x00000002" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="86"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000004" complete_cpuset="0x00000004" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="10" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000004" complete_cpuset="0x00000004" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="9" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00000004" complete_cpuset="0x00000004" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="8">
|
||||
<object type="PU" os_index="2" cpuset="0x00000004" complete_cpuset="0x00000004" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="87"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000008" complete_cpuset="0x00000008" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="13" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000008" complete_cpuset="0x00000008" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="12" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00000008" complete_cpuset="0x00000008" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="11">
|
||||
<object type="PU" os_index="3" cpuset="0x00000008" complete_cpuset="0x00000008" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="88"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000010" complete_cpuset="0x00000010" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="16" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000010" complete_cpuset="0x00000010" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="15" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00000010" complete_cpuset="0x00000010" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="14">
|
||||
<object type="PU" os_index="4" cpuset="0x00000010" complete_cpuset="0x00000010" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="89"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000020" complete_cpuset="0x00000020" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="19" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000020" complete_cpuset="0x00000020" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="18" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00000020" complete_cpuset="0x00000020" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="17">
|
||||
<object type="PU" os_index="5" cpuset="0x00000020" complete_cpuset="0x00000020" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="90"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L3Cache" cpuset="0x00000fc0" complete_cpuset="0x00000fc0" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="40" cache_size="12582912" depth="3" cache_linesize="64" cache_associativity="1" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="NUMANode" os_index="1" cpuset="0x00000fc0" complete_cpuset="0x00000fc0" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="81" local_memory="8018194432">
|
||||
<page_type size="4096" count="0"/>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000040" complete_cpuset="0x00000040" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="23" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000040" complete_cpuset="0x00000040" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="22" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00000040" complete_cpuset="0x00000040" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="21">
|
||||
<object type="PU" os_index="6" cpuset="0x00000040" complete_cpuset="0x00000040" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="91"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000080" complete_cpuset="0x00000080" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="26" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000080" complete_cpuset="0x00000080" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="25" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00000080" complete_cpuset="0x00000080" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="24">
|
||||
<object type="PU" os_index="7" cpuset="0x00000080" complete_cpuset="0x00000080" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="92"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000100" complete_cpuset="0x00000100" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="29" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000100" complete_cpuset="0x00000100" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="28" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00000100" complete_cpuset="0x00000100" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="27">
|
||||
<object type="PU" os_index="8" cpuset="0x00000100" complete_cpuset="0x00000100" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="93"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000200" complete_cpuset="0x00000200" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="32" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000200" complete_cpuset="0x00000200" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="31" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00000200" complete_cpuset="0x00000200" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="30">
|
||||
<object type="PU" os_index="9" cpuset="0x00000200" complete_cpuset="0x00000200" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="94"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000400" complete_cpuset="0x00000400" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="35" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000400" complete_cpuset="0x00000400" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="34" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00000400" complete_cpuset="0x00000400" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="33">
|
||||
<object type="PU" os_index="10" cpuset="0x00000400" complete_cpuset="0x00000400" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="95"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000800" complete_cpuset="0x00000800" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="39" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000800" complete_cpuset="0x00000800" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="38" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00000800" complete_cpuset="0x00000800" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="37">
|
||||
<object type="PU" os_index="11" cpuset="0x00000800" complete_cpuset="0x00000800" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="96"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="Package" cpuset="0x00fff000" complete_cpuset="0x00fff000" nodeset="0x0000000c" complete_nodeset="0x0000000c" gp_index="75">
|
||||
<info name="CPUVendor" value="AuthenticAMD"/>
|
||||
<info name="CPUFamilyNumber" value="21"/>
|
||||
<info name="CPUModelNumber" value="2"/>
|
||||
<info name="CPUModel" value="AMD Opteron(tm) Processor 6344 "/>
|
||||
<info name="CPUStepping" value="0"/>
|
||||
<object type="L3Cache" cpuset="0x0003f000" complete_cpuset="0x0003f000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="59" cache_size="12582912" depth="3" cache_linesize="64" cache_associativity="1" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="NUMANode" os_index="2" cpuset="0x0003f000" complete_cpuset="0x0003f000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="82" local_memory="8035020800">
|
||||
<page_type size="4096" count="0"/>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00001000" complete_cpuset="0x00001000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="43" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00001000" complete_cpuset="0x00001000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="42" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00001000" complete_cpuset="0x00001000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="41">
|
||||
<object type="PU" os_index="12" cpuset="0x00001000" complete_cpuset="0x00001000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="97"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00002000" complete_cpuset="0x00002000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="46" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00002000" complete_cpuset="0x00002000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="45" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00002000" complete_cpuset="0x00002000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="44">
|
||||
<object type="PU" os_index="13" cpuset="0x00002000" complete_cpuset="0x00002000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="98"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00004000" complete_cpuset="0x00004000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="49" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00004000" complete_cpuset="0x00004000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="48" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00004000" complete_cpuset="0x00004000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="47">
|
||||
<object type="PU" os_index="14" cpuset="0x00004000" complete_cpuset="0x00004000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="99"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00008000" complete_cpuset="0x00008000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="52" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00008000" complete_cpuset="0x00008000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="51" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00008000" complete_cpuset="0x00008000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="50">
|
||||
<object type="PU" os_index="15" cpuset="0x00008000" complete_cpuset="0x00008000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="100"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00010000" complete_cpuset="0x00010000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="55" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00010000" complete_cpuset="0x00010000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="54" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00010000" complete_cpuset="0x00010000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="53">
|
||||
<object type="PU" os_index="16" cpuset="0x00010000" complete_cpuset="0x00010000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="101"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00020000" complete_cpuset="0x00020000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="58" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00020000" complete_cpuset="0x00020000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="57" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00020000" complete_cpuset="0x00020000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="56">
|
||||
<object type="PU" os_index="17" cpuset="0x00020000" complete_cpuset="0x00020000" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="102"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L3Cache" cpuset="0x00fc0000" complete_cpuset="0x00fc0000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="79" cache_size="12582912" depth="3" cache_linesize="64" cache_associativity="1" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="NUMANode" os_index="3" cpuset="0x00fc0000" complete_cpuset="0x00fc0000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="83" local_memory="8097337344">
|
||||
<page_type size="4096" count="0"/>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00040000" complete_cpuset="0x00040000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="62" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00040000" complete_cpuset="0x00040000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="61" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00040000" complete_cpuset="0x00040000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="60">
|
||||
<object type="PU" os_index="18" cpuset="0x00040000" complete_cpuset="0x00040000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="103"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00080000" complete_cpuset="0x00080000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="65" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00080000" complete_cpuset="0x00080000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="64" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00080000" complete_cpuset="0x00080000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="63">
|
||||
<object type="PU" os_index="19" cpuset="0x00080000" complete_cpuset="0x00080000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="104"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00100000" complete_cpuset="0x00100000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="68" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00100000" complete_cpuset="0x00100000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="67" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00100000" complete_cpuset="0x00100000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="66">
|
||||
<object type="PU" os_index="20" cpuset="0x00100000" complete_cpuset="0x00100000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="105"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00200000" complete_cpuset="0x00200000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="71" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00200000" complete_cpuset="0x00200000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="70" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00200000" complete_cpuset="0x00200000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="69">
|
||||
<object type="PU" os_index="21" cpuset="0x00200000" complete_cpuset="0x00200000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="106"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00400000" complete_cpuset="0x00400000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="74" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00400000" complete_cpuset="0x00400000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="73" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00400000" complete_cpuset="0x00400000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="72">
|
||||
<object type="PU" os_index="22" cpuset="0x00400000" complete_cpuset="0x00400000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="107"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00800000" complete_cpuset="0x00800000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="78" cache_size="2097152" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00800000" complete_cpuset="0x00800000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="77" cache_size="16384" depth="1" cache_linesize="64" cache_associativity="4" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" cpuset="0x00800000" complete_cpuset="0x00800000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="76">
|
||||
<object type="PU" os_index="23" cpuset="0x00800000" complete_cpuset="0x00800000" nodeset="0x00000008" complete_nodeset="0x00000008" gp_index="108"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</topology>
|
||||
399
doc/topology/AMD_Opteron_6348_x4_N8_linux_2_0_4.xml
Normal file
399
doc/topology/AMD_Opteron_6348_x4_N8_linux_2_0_4.xml
Normal file
@@ -0,0 +1,399 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE topology SYSTEM "hwloc2.dtd">
|
||||
<topology version="2.0">
|
||||
<object type="Machine" os_index="0" cpuset="0xffffffff" complete_cpuset="0xffffffff" allowed_cpuset="0xffffffff" nodeset="0x00000066" complete_nodeset="0x000000ff" allowed_nodeset="0x00000066" gp_index="1">
|
||||
<info name="DMIProductName" value="H8QG6"/>
|
||||
<info name="DMIProductVersion" value="1234567890"/>
|
||||
<info name="DMIProductSerial" value="1234567890"/>
|
||||
<info name="DMIProductUUID" value="0"/>
|
||||
<info name="DMIBoardVendor" value="Supermicro"/>
|
||||
<info name="DMIBoardName" value="H8QG6"/>
|
||||
<info name="DMIBoardVersion" value="1234567890"/>
|
||||
<info name="DMIBoardSerial" value="0"/>
|
||||
<info name="DMIBoardAssetTag" value="1234567890"/>
|
||||
<info name="DMIChassisVendor" value="Supermicro"/>
|
||||
<info name="DMIChassisType" value="3"/>
|
||||
<info name="DMIChassisVersion" value="1234567890"/>
|
||||
<info name="DMIChassisSerial" value="1234567890."/>
|
||||
<info name="DMIChassisAssetTag" value="1234567890"/>
|
||||
<info name="DMIBIOSVendor" value="American Megatrends Inc."/>
|
||||
<info name="DMIBIOSVersion" value="080016 "/>
|
||||
<info name="DMIBIOSDate" value="10/11/2010"/>
|
||||
<info name="DMISysVendor" value="Supermicro"/>
|
||||
<info name="Backend" value="Linux"/>
|
||||
<info name="LinuxCgroup" value="/"/>
|
||||
<info name="OSName" value="Linux"/>
|
||||
<info name="OSRelease" value="4.15.0-20-generic"/>
|
||||
<info name="OSVersion" value="#21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018"/>
|
||||
<info name="HostName" value="host"/>
|
||||
<info name="Architecture" value="x86_64"/>
|
||||
<info name="hwlocVersion" value="2.0.4"/>
|
||||
<info name="ProcessName" value="xmrig"/>
|
||||
<object type="Package" os_index="0" cpuset="0x000000ff" complete_cpuset="0x000000ff" nodeset="0x00000002" complete_nodeset="0x00000003" gp_index="2">
|
||||
<info name="CPUVendor" value="AuthenticAMD"/>
|
||||
<info name="CPUFamilyNumber" value="16"/>
|
||||
<info name="CPUModelNumber" value="9"/>
|
||||
<info name="CPUModel" value="AMD Opteron(tm) Processor 6128"/>
|
||||
<info name="CPUStepping" value="1"/>
|
||||
<object type="L3Cache" cpuset="0x0000000f" complete_cpuset="0x0000000f" nodeset="0x0" complete_nodeset="0x00000001" gp_index="7" cache_size="5240832" depth="3" cache_linesize="64" cache_associativity="48" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L2Cache" cpuset="0x00000001" complete_cpuset="0x00000001" nodeset="0x0" complete_nodeset="0x00000001" gp_index="6" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000001" complete_cpuset="0x00000001" nodeset="0x0" complete_nodeset="0x00000001" gp_index="5" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="0" cpuset="0x00000001" complete_cpuset="0x00000001" nodeset="0x0" complete_nodeset="0x00000001" gp_index="3">
|
||||
<object type="PU" os_index="0" cpuset="0x00000001" complete_cpuset="0x00000001" nodeset="0x0" complete_nodeset="0x00000001" gp_index="4"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000002" complete_cpuset="0x00000002" nodeset="0x0" complete_nodeset="0x00000001" gp_index="11" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000002" complete_cpuset="0x00000002" nodeset="0x0" complete_nodeset="0x00000001" gp_index="10" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="1" cpuset="0x00000002" complete_cpuset="0x00000002" nodeset="0x0" complete_nodeset="0x00000001" gp_index="8">
|
||||
<object type="PU" os_index="1" cpuset="0x00000002" complete_cpuset="0x00000002" nodeset="0x0" complete_nodeset="0x00000001" gp_index="9"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000004" complete_cpuset="0x00000004" nodeset="0x0" complete_nodeset="0x00000001" gp_index="15" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000004" complete_cpuset="0x00000004" nodeset="0x0" complete_nodeset="0x00000001" gp_index="14" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="2" cpuset="0x00000004" complete_cpuset="0x00000004" nodeset="0x0" complete_nodeset="0x00000001" gp_index="12">
|
||||
<object type="PU" os_index="2" cpuset="0x00000004" complete_cpuset="0x00000004" nodeset="0x0" complete_nodeset="0x00000001" gp_index="13"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000008" complete_cpuset="0x00000008" nodeset="0x0" complete_nodeset="0x00000001" gp_index="19" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000008" complete_cpuset="0x00000008" nodeset="0x0" complete_nodeset="0x00000001" gp_index="18" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="3" cpuset="0x00000008" complete_cpuset="0x00000008" nodeset="0x0" complete_nodeset="0x00000001" gp_index="16">
|
||||
<object type="PU" os_index="3" cpuset="0x00000008" complete_cpuset="0x00000008" nodeset="0x0" complete_nodeset="0x00000001" gp_index="17"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L3Cache" cpuset="0x000000f0" complete_cpuset="0x000000f0" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="24" cache_size="5240832" depth="3" cache_linesize="64" cache_associativity="48" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="NUMANode" os_index="1" cpuset="0x000000f0" complete_cpuset="0x000000f0" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="143" local_memory="4156817408">
|
||||
<page_type size="4096" count="854592"/>
|
||||
<page_type size="2097152" count="313"/>
|
||||
<page_type size="1073741824" count="0"/>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000010" complete_cpuset="0x00000010" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="23" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000010" complete_cpuset="0x00000010" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="22" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="0" cpuset="0x00000010" complete_cpuset="0x00000010" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="20">
|
||||
<object type="PU" os_index="4" cpuset="0x00000010" complete_cpuset="0x00000010" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="21"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000020" complete_cpuset="0x00000020" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="28" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000020" complete_cpuset="0x00000020" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="27" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="1" cpuset="0x00000020" complete_cpuset="0x00000020" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="25">
|
||||
<object type="PU" os_index="5" cpuset="0x00000020" complete_cpuset="0x00000020" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="26"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000040" complete_cpuset="0x00000040" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="32" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000040" complete_cpuset="0x00000040" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="31" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="2" cpuset="0x00000040" complete_cpuset="0x00000040" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="29">
|
||||
<object type="PU" os_index="6" cpuset="0x00000040" complete_cpuset="0x00000040" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="30"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000080" complete_cpuset="0x00000080" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="36" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000080" complete_cpuset="0x00000080" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="35" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="3" cpuset="0x00000080" complete_cpuset="0x00000080" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="33">
|
||||
<object type="PU" os_index="7" cpuset="0x00000080" complete_cpuset="0x00000080" nodeset="0x00000002" complete_nodeset="0x00000002" gp_index="34"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="Package" os_index="1" cpuset="0x0000ff00" complete_cpuset="0x0000ff00" nodeset="0x00000004" complete_nodeset="0x0000000c" gp_index="37">
|
||||
<info name="CPUVendor" value="AuthenticAMD"/>
|
||||
<info name="CPUFamilyNumber" value="16"/>
|
||||
<info name="CPUModelNumber" value="9"/>
|
||||
<info name="CPUModel" value="AMD Opteron(tm) Processor 6128"/>
|
||||
<info name="CPUStepping" value="1"/>
|
||||
<object type="L3Cache" cpuset="0x00000f00" complete_cpuset="0x00000f00" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="42" cache_size="5240832" depth="3" cache_linesize="64" cache_associativity="48" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="NUMANode" os_index="2" cpuset="0x00000f00" complete_cpuset="0x00000f00" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="144" local_memory="4204060672">
|
||||
<page_type size="4096" count="866126"/>
|
||||
<page_type size="2097152" count="313"/>
|
||||
<page_type size="1073741824" count="0"/>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000100" complete_cpuset="0x00000100" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="41" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000100" complete_cpuset="0x00000100" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="40" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="0" cpuset="0x00000100" complete_cpuset="0x00000100" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="38">
|
||||
<object type="PU" os_index="8" cpuset="0x00000100" complete_cpuset="0x00000100" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="39"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000200" complete_cpuset="0x00000200" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="46" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000200" complete_cpuset="0x00000200" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="45" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="1" cpuset="0x00000200" complete_cpuset="0x00000200" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="43">
|
||||
<object type="PU" os_index="9" cpuset="0x00000200" complete_cpuset="0x00000200" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="44"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000400" complete_cpuset="0x00000400" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="50" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000400" complete_cpuset="0x00000400" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="49" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="2" cpuset="0x00000400" complete_cpuset="0x00000400" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="47">
|
||||
<object type="PU" os_index="10" cpuset="0x00000400" complete_cpuset="0x00000400" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="48"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00000800" complete_cpuset="0x00000800" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="54" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00000800" complete_cpuset="0x00000800" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="53" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="3" cpuset="0x00000800" complete_cpuset="0x00000800" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="51">
|
||||
<object type="PU" os_index="11" cpuset="0x00000800" complete_cpuset="0x00000800" nodeset="0x00000004" complete_nodeset="0x00000004" gp_index="52"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L3Cache" cpuset="0x0000f000" complete_cpuset="0x0000f000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="59" cache_size="5240832" depth="3" cache_linesize="64" cache_associativity="48" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L2Cache" cpuset="0x00001000" complete_cpuset="0x00001000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="58" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00001000" complete_cpuset="0x00001000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="57" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="0" cpuset="0x00001000" complete_cpuset="0x00001000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="55">
|
||||
<object type="PU" os_index="12" cpuset="0x00001000" complete_cpuset="0x00001000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="56"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00002000" complete_cpuset="0x00002000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="63" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00002000" complete_cpuset="0x00002000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="62" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="1" cpuset="0x00002000" complete_cpuset="0x00002000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="60">
|
||||
<object type="PU" os_index="13" cpuset="0x00002000" complete_cpuset="0x00002000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="61"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00004000" complete_cpuset="0x00004000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="67" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00004000" complete_cpuset="0x00004000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="66" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="2" cpuset="0x00004000" complete_cpuset="0x00004000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="64">
|
||||
<object type="PU" os_index="14" cpuset="0x00004000" complete_cpuset="0x00004000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="65"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00008000" complete_cpuset="0x00008000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="71" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00008000" complete_cpuset="0x00008000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="70" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="3" cpuset="0x00008000" complete_cpuset="0x00008000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="68">
|
||||
<object type="PU" os_index="15" cpuset="0x00008000" complete_cpuset="0x00008000" nodeset="0x0" complete_nodeset="0x00000008" gp_index="69"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="Package" os_index="2" cpuset="0x00ff0000" complete_cpuset="0x00ff0000" nodeset="0x00000020" complete_nodeset="0x00000030" gp_index="72">
|
||||
<info name="CPUVendor" value="AuthenticAMD"/>
|
||||
<info name="CPUFamilyNumber" value="16"/>
|
||||
<info name="CPUModelNumber" value="9"/>
|
||||
<info name="CPUModel" value="AMD Opteron(tm) Processor 6128"/>
|
||||
<info name="CPUStepping" value="1"/>
|
||||
<object type="L3Cache" cpuset="0x000f0000" complete_cpuset="0x000f0000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="77" cache_size="5240832" depth="3" cache_linesize="64" cache_associativity="48" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L2Cache" cpuset="0x00010000" complete_cpuset="0x00010000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="76" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00010000" complete_cpuset="0x00010000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="75" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="0" cpuset="0x00010000" complete_cpuset="0x00010000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="73">
|
||||
<object type="PU" os_index="16" cpuset="0x00010000" complete_cpuset="0x00010000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="74"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00020000" complete_cpuset="0x00020000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="81" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00020000" complete_cpuset="0x00020000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="80" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="1" cpuset="0x00020000" complete_cpuset="0x00020000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="78">
|
||||
<object type="PU" os_index="17" cpuset="0x00020000" complete_cpuset="0x00020000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="79"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00040000" complete_cpuset="0x00040000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="85" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00040000" complete_cpuset="0x00040000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="84" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="2" cpuset="0x00040000" complete_cpuset="0x00040000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="82">
|
||||
<object type="PU" os_index="18" cpuset="0x00040000" complete_cpuset="0x00040000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="83"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00080000" complete_cpuset="0x00080000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="89" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00080000" complete_cpuset="0x00080000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="88" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="3" cpuset="0x00080000" complete_cpuset="0x00080000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="86">
|
||||
<object type="PU" os_index="19" cpuset="0x00080000" complete_cpuset="0x00080000" nodeset="0x0" complete_nodeset="0x00000010" gp_index="87"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L3Cache" cpuset="0x00f00000" complete_cpuset="0x00f00000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="94" cache_size="5240832" depth="3" cache_linesize="64" cache_associativity="48" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="NUMANode" os_index="5" cpuset="0x00f00000" complete_cpuset="0x00f00000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="147" local_memory="4226170880">
|
||||
<page_type size="4096" count="872036"/>
|
||||
<page_type size="2097152" count="312"/>
|
||||
<page_type size="1073741824" count="0"/>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00100000" complete_cpuset="0x00100000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="93" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00100000" complete_cpuset="0x00100000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="92" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="0" cpuset="0x00100000" complete_cpuset="0x00100000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="90">
|
||||
<object type="PU" os_index="20" cpuset="0x00100000" complete_cpuset="0x00100000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="91"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00200000" complete_cpuset="0x00200000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="98" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00200000" complete_cpuset="0x00200000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="97" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="1" cpuset="0x00200000" complete_cpuset="0x00200000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="95">
|
||||
<object type="PU" os_index="21" cpuset="0x00200000" complete_cpuset="0x00200000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="96"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00400000" complete_cpuset="0x00400000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="102" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00400000" complete_cpuset="0x00400000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="101" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="2" cpuset="0x00400000" complete_cpuset="0x00400000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="99">
|
||||
<object type="PU" os_index="22" cpuset="0x00400000" complete_cpuset="0x00400000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="100"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x00800000" complete_cpuset="0x00800000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="106" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x00800000" complete_cpuset="0x00800000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="105" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="3" cpuset="0x00800000" complete_cpuset="0x00800000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="103">
|
||||
<object type="PU" os_index="23" cpuset="0x00800000" complete_cpuset="0x00800000" nodeset="0x00000020" complete_nodeset="0x00000020" gp_index="104"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="Package" os_index="3" cpuset="0xff000000" complete_cpuset="0xff000000" nodeset="0x00000040" complete_nodeset="0x000000c0" gp_index="107">
|
||||
<info name="CPUVendor" value="AuthenticAMD"/>
|
||||
<info name="CPUFamilyNumber" value="16"/>
|
||||
<info name="CPUModelNumber" value="9"/>
|
||||
<info name="CPUModel" value="AMD Opteron(tm) Processor 6128"/>
|
||||
<info name="CPUStepping" value="1"/>
|
||||
<object type="L3Cache" cpuset="0x0f000000" complete_cpuset="0x0f000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="112" cache_size="5240832" depth="3" cache_linesize="64" cache_associativity="48" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="NUMANode" os_index="6" cpuset="0x0f000000" complete_cpuset="0x0f000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="148" local_memory="4221870080">
|
||||
<page_type size="4096" count="870986"/>
|
||||
<page_type size="2097152" count="312"/>
|
||||
<page_type size="1073741824" count="0"/>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x01000000" complete_cpuset="0x01000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="111" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x01000000" complete_cpuset="0x01000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="110" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="0" cpuset="0x01000000" complete_cpuset="0x01000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="108">
|
||||
<object type="PU" os_index="24" cpuset="0x01000000" complete_cpuset="0x01000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="109"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x02000000" complete_cpuset="0x02000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="116" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x02000000" complete_cpuset="0x02000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="115" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="1" cpuset="0x02000000" complete_cpuset="0x02000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="113">
|
||||
<object type="PU" os_index="25" cpuset="0x02000000" complete_cpuset="0x02000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="114"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x04000000" complete_cpuset="0x04000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="120" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x04000000" complete_cpuset="0x04000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="119" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="2" cpuset="0x04000000" complete_cpuset="0x04000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="117">
|
||||
<object type="PU" os_index="26" cpuset="0x04000000" complete_cpuset="0x04000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="118"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x08000000" complete_cpuset="0x08000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="124" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x08000000" complete_cpuset="0x08000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="123" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="3" cpuset="0x08000000" complete_cpuset="0x08000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="121">
|
||||
<object type="PU" os_index="27" cpuset="0x08000000" complete_cpuset="0x08000000" nodeset="0x00000040" complete_nodeset="0x00000040" gp_index="122"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L3Cache" cpuset="0xf0000000" complete_cpuset="0xf0000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="129" cache_size="5240832" depth="3" cache_linesize="64" cache_associativity="48" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L2Cache" cpuset="0x10000000" complete_cpuset="0x10000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="128" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x10000000" complete_cpuset="0x10000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="127" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="0" cpuset="0x10000000" complete_cpuset="0x10000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="125">
|
||||
<object type="PU" os_index="28" cpuset="0x10000000" complete_cpuset="0x10000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="126"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x20000000" complete_cpuset="0x20000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="133" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x20000000" complete_cpuset="0x20000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="132" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="1" cpuset="0x20000000" complete_cpuset="0x20000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="130">
|
||||
<object type="PU" os_index="29" cpuset="0x20000000" complete_cpuset="0x20000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="131"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x40000000" complete_cpuset="0x40000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="137" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x40000000" complete_cpuset="0x40000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="136" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="2" cpuset="0x40000000" complete_cpuset="0x40000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="134">
|
||||
<object type="PU" os_index="30" cpuset="0x40000000" complete_cpuset="0x40000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="135"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object type="L2Cache" cpuset="0x80000000" complete_cpuset="0x80000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="141" cache_size="524288" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="L1Cache" cpuset="0x80000000" complete_cpuset="0x80000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="140" cache_size="65536" depth="1" cache_linesize="64" cache_associativity="2" cache_type="1">
|
||||
<info name="Inclusive" value="0"/>
|
||||
<object type="Core" os_index="3" cpuset="0x80000000" complete_cpuset="0x80000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="138">
|
||||
<object type="PU" os_index="31" cpuset="0x80000000" complete_cpuset="0x80000000" nodeset="0x0" complete_nodeset="0x00000080" gp_index="139"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<distances2 type="NUMANode" nbobjs="4" kind="5" indexing="os">
|
||||
<indexes length="8">1 2 5 6 </indexes>
|
||||
<u64values length="30">10 22 16 22 22 10 22 16 16 22 </u64values>
|
||||
<u64values length="18">10 22 22 16 22 10 </u64values>
|
||||
</distances2>
|
||||
</topology>
|
||||
|
||||
6
src/3rdparty/argon2/CMakeLists.txt
vendored
6
src/3rdparty/argon2/CMakeLists.txt
vendored
@@ -22,7 +22,7 @@ set(ARGON2_X86_64_SOURCES arch/x86_64/lib/argon2-arch.c arch/x86_64/lib/cpu-flag
|
||||
if (CMAKE_C_COMPILER_ID MATCHES MSVC)
|
||||
function(add_feature_impl FEATURE MSVC_FLAG DEF)
|
||||
add_library(argon2-${FEATURE} STATIC arch/x86_64/lib/argon2-${FEATURE}.c)
|
||||
target_include_directories(argon2-${FEATURE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
target_include_directories(argon2-${FEATURE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../)
|
||||
target_include_directories(argon2-${FEATURE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib)
|
||||
set_target_properties(argon2-${FEATURE} PROPERTIES POSITION_INDEPENDENT_CODE True)
|
||||
|
||||
@@ -38,7 +38,7 @@ if (CMAKE_C_COMPILER_ID MATCHES MSVC)
|
||||
elseif (NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
function(add_feature_impl FEATURE GCC_FLAG DEF)
|
||||
add_library(argon2-${FEATURE} STATIC arch/x86_64/lib/argon2-${FEATURE}.c)
|
||||
target_include_directories(argon2-${FEATURE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
target_include_directories(argon2-${FEATURE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../)
|
||||
target_include_directories(argon2-${FEATURE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib)
|
||||
set_target_properties(argon2-${FEATURE} PROPERTIES POSITION_INDEPENDENT_CODE True)
|
||||
|
||||
@@ -84,5 +84,5 @@ endif()
|
||||
add_library(argon2 STATIC ${ARGON2_SOURCES})
|
||||
target_link_libraries(argon2 ${ARGON2_LIBS})
|
||||
|
||||
target_include_directories(argon2 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
target_include_directories(argon2 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../)
|
||||
target_include_directories(argon2 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib)
|
||||
|
||||
2
src/3rdparty/argon2/lib/argon2.c
vendored
2
src/3rdparty/argon2/lib/argon2.c
vendored
@@ -15,7 +15,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "argon2.h"
|
||||
#include "3rdparty/argon2.h"
|
||||
#include "encoding.h"
|
||||
#include "core.h"
|
||||
|
||||
|
||||
2
src/3rdparty/argon2/lib/core.h
vendored
2
src/3rdparty/argon2/lib/core.h
vendored
@@ -14,7 +14,7 @@
|
||||
#ifndef ARGON2_CORE_H
|
||||
#define ARGON2_CORE_H
|
||||
|
||||
#include "argon2.h"
|
||||
#include "3rdparty/argon2.h"
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define ALIGN(n) __declspec(align(16))
|
||||
|
||||
2
src/3rdparty/argon2/lib/encoding.h
vendored
2
src/3rdparty/argon2/lib/encoding.h
vendored
@@ -1,6 +1,6 @@
|
||||
#ifndef ENCODING_H
|
||||
#define ENCODING_H
|
||||
#include "argon2.h"
|
||||
#include "3rdparty/argon2.h"
|
||||
|
||||
#define ARGON2_MAX_DECODED_LANES UINT32_C(255)
|
||||
#define ARGON2_MIN_DECODED_SALT_LEN UINT32_C(8)
|
||||
|
||||
2
src/3rdparty/argon2/lib/impl-select.c
vendored
2
src/3rdparty/argon2/lib/impl-select.c
vendored
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "impl-select.h"
|
||||
|
||||
#include "argon2.h"
|
||||
#include "3rdparty/argon2.h"
|
||||
|
||||
#define BENCH_SAMPLES 1024
|
||||
#define BENCH_MEM_BLOCKS 512
|
||||
|
||||
39
src/App.cpp
39
src/App.cpp
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
#include <uv.h>
|
||||
|
||||
|
||||
@@ -42,18 +42,9 @@
|
||||
#include "version.h"
|
||||
|
||||
|
||||
xmrig::App::App(Process *process) :
|
||||
m_console(nullptr),
|
||||
m_signals(nullptr)
|
||||
xmrig::App::App(Process *process)
|
||||
{
|
||||
m_controller = new Controller(process);
|
||||
if (m_controller->init() != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_controller->config()->isBackground()) {
|
||||
m_console = new Console(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,12 +59,26 @@ xmrig::App::~App()
|
||||
int xmrig::App::exec()
|
||||
{
|
||||
if (!m_controller->isReady()) {
|
||||
LOG_EMERG("no valid configuration found.");
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
m_signals = new Signals(this);
|
||||
|
||||
background();
|
||||
int rc = 0;
|
||||
if (background(rc)) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = m_controller->init();
|
||||
if (rc != 0) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (!m_controller->isBackground()) {
|
||||
m_console = new Console(this);
|
||||
}
|
||||
|
||||
VirtualMemory::init(m_controller->config()->cpu().isHugePages());
|
||||
|
||||
@@ -87,10 +92,10 @@ int xmrig::App::exec()
|
||||
|
||||
m_controller->start();
|
||||
|
||||
const int r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
|
||||
rc = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
|
||||
uv_loop_close(uv_default_loop());
|
||||
|
||||
return r;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +155,11 @@ void xmrig::App::onSignal(int signum)
|
||||
void xmrig::App::close()
|
||||
{
|
||||
m_signals->stop();
|
||||
m_console->stop();
|
||||
|
||||
if (m_console) {
|
||||
m_console->stop();
|
||||
}
|
||||
|
||||
m_controller->stop();
|
||||
|
||||
Log::destroy();
|
||||
|
||||
11
src/App.h
11
src/App.h
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "base/kernel/interfaces/IConsoleListener.h"
|
||||
#include "base/kernel/interfaces/ISignalListener.h"
|
||||
#include "base/tools/Object.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
@@ -44,6 +45,8 @@ class Signals;
|
||||
class App : public IConsoleListener, public ISignalListener
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE_DEFAULT(App)
|
||||
|
||||
App(Process *process);
|
||||
~App() override;
|
||||
|
||||
@@ -54,12 +57,12 @@ protected:
|
||||
void onSignal(int signum) override;
|
||||
|
||||
private:
|
||||
void background();
|
||||
bool background(int &rc);
|
||||
void close();
|
||||
|
||||
Console *m_console;
|
||||
Controller *m_controller;
|
||||
Signals *m_signals;
|
||||
Console *m_console = nullptr;
|
||||
Controller *m_controller = nullptr;
|
||||
Signals *m_signals = nullptr;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -23,33 +23,36 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <cstdlib>
|
||||
#include <csignal>
|
||||
#include <cerrno>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
#include "App.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "core/config/Config.h"
|
||||
#include "core/Controller.h"
|
||||
|
||||
|
||||
void xmrig::App::background()
|
||||
bool xmrig::App::background(int &rc)
|
||||
{
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
if (!m_controller->config()->isBackground()) {
|
||||
return;
|
||||
if (!m_controller->isBackground()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int i = fork();
|
||||
if (i < 0) {
|
||||
exit(1);
|
||||
rc = 1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (i > 0) {
|
||||
exit(0);
|
||||
rc = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
i = setsid();
|
||||
@@ -62,4 +65,6 @@ void xmrig::App::background()
|
||||
if (i < 0) {
|
||||
LOG_ERR("chdir() failed (errno = %d)", errno);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -29,13 +29,12 @@
|
||||
|
||||
#include "App.h"
|
||||
#include "core/Controller.h"
|
||||
#include "core/config/Config.h"
|
||||
|
||||
|
||||
void xmrig::App::background()
|
||||
bool xmrig::App::background(int &)
|
||||
{
|
||||
if (!m_controller->config()->isBackground()) {
|
||||
return;
|
||||
if (!m_controller->isBackground()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
HWND hcon = GetConsoleWindow();
|
||||
@@ -46,4 +45,6 @@ void xmrig::App::background()
|
||||
CloseHandle(h);
|
||||
FreeConsole();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ class Threads
|
||||
public:
|
||||
inline bool has(const char *profile) const { return m_profiles.count(profile) > 0; }
|
||||
inline bool isDisabled(const Algorithm &algo) const { return m_disabled.count(algo) > 0; }
|
||||
inline bool isEmpty() const { return m_profiles.empty(); }
|
||||
inline bool isExist(const Algorithm &algo) const { return isDisabled(algo) || m_aliases.count(algo) > 0 || has(algo.shortName()); }
|
||||
inline const T &get(const Algorithm &algo, bool strict = false) const { return get(profileName(algo, strict)); }
|
||||
inline void disable(const Algorithm &algo) { m_disabled.insert(algo); }
|
||||
|
||||
@@ -100,6 +100,7 @@ void xmrig::Workers<T>::start(const std::vector<T> &data)
|
||||
}
|
||||
|
||||
d_ptr->hashrate = new Hashrate(m_workers.size());
|
||||
Nonce::touch(T::backend());
|
||||
|
||||
for (Thread<T> *worker : m_workers) {
|
||||
worker->start(Workers<T>::onReady);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#define XMRIG_PCITOPOLOGY_H
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cstdio>
|
||||
|
||||
|
||||
#include "base/tools/String.h"
|
||||
@@ -40,19 +40,30 @@ class PciTopology
|
||||
{
|
||||
public:
|
||||
PciTopology() = default;
|
||||
PciTopology(uint32_t bus, uint32_t device, uint32_t function) : bus(bus), device(device), function(function) {}
|
||||
PciTopology(uint32_t bus, uint32_t device, uint32_t function) : m_valid(true), m_bus(bus), m_device(device), m_function(function) {}
|
||||
|
||||
uint32_t bus = 0;
|
||||
uint32_t device = 0;
|
||||
uint32_t function = 0;
|
||||
inline bool isValid() const { return m_valid; }
|
||||
inline uint8_t bus() const { return m_bus; }
|
||||
inline uint8_t device() const { return m_device; }
|
||||
inline uint8_t function() const { return m_function; }
|
||||
|
||||
String toString() const
|
||||
{
|
||||
if (!isValid()) {
|
||||
return "n/a";
|
||||
}
|
||||
|
||||
char *buf = new char[8]();
|
||||
snprintf(buf, 8, "%02x:%02x.%01x", bus, device, function);
|
||||
snprintf(buf, 8, "%02hhx:%02hhx.%01hhx", bus(), device(), function());
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
private:
|
||||
bool m_valid = false;
|
||||
uint8_t m_bus = 0;
|
||||
uint8_t m_device = 0;
|
||||
uint8_t m_function = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
#include "backend/cpu/Cpu.h"
|
||||
@@ -44,7 +44,15 @@ static xmrig::ICpuInfo *cpuInfo = nullptr;
|
||||
|
||||
xmrig::ICpuInfo *xmrig::Cpu::info()
|
||||
{
|
||||
assert(cpuInfo != nullptr);
|
||||
if (cpuInfo == nullptr) {
|
||||
# if defined(XMRIG_FEATURE_HWLOC)
|
||||
cpuInfo = new HwlocCpuInfo();
|
||||
# elif defined(XMRIG_FEATURE_LIBCPUID)
|
||||
cpuInfo = new AdvancedCpuInfo();
|
||||
# else
|
||||
cpuInfo = new BasicCpuInfo();
|
||||
# endif
|
||||
}
|
||||
|
||||
return cpuInfo;
|
||||
}
|
||||
@@ -62,7 +70,7 @@ rapidjson::Value xmrig::Cpu::toJSON(rapidjson::Document &doc)
|
||||
cpu.AddMember("brand", StringRef(i->brand()), allocator);
|
||||
cpu.AddMember("aes", i->hasAES(), allocator);
|
||||
cpu.AddMember("avx2", i->hasAVX2(), allocator);
|
||||
cpu.AddMember("x64", i->isX64(), allocator);
|
||||
cpu.AddMember("x64", ICpuInfo::isX64(), allocator);
|
||||
cpu.AddMember("l2", static_cast<uint64_t>(i->L2()), allocator);
|
||||
cpu.AddMember("l3", static_cast<uint64_t>(i->L3()), allocator);
|
||||
cpu.AddMember("cores", static_cast<uint64_t>(i->cores()), allocator);
|
||||
@@ -81,20 +89,6 @@ rapidjson::Value xmrig::Cpu::toJSON(rapidjson::Document &doc)
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Cpu::init()
|
||||
{
|
||||
assert(cpuInfo == nullptr);
|
||||
|
||||
# if defined(XMRIG_FEATURE_HWLOC)
|
||||
cpuInfo = new HwlocCpuInfo();
|
||||
# elif defined(XMRIG_FEATURE_LIBCPUID)
|
||||
cpuInfo = new AdvancedCpuInfo();
|
||||
# else
|
||||
cpuInfo = new BasicCpuInfo();
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Cpu::release()
|
||||
{
|
||||
assert(cpuInfo != nullptr);
|
||||
|
||||
@@ -37,7 +37,6 @@ class Cpu
|
||||
public:
|
||||
static ICpuInfo *info();
|
||||
static rapidjson::Value toJSON(rapidjson::Document &doc);
|
||||
static void init();
|
||||
static void release();
|
||||
|
||||
inline static Assembly::Id assembly(Assembly::Id hint) { return hint == Assembly::AUTO ? Cpu::info()->assembly() : hint; }
|
||||
|
||||
@@ -35,6 +35,7 @@ static const char *kCn = "cn";
|
||||
static const char *kEnabled = "enabled";
|
||||
static const char *kHugePages = "huge-pages";
|
||||
static const char *kHwAes = "hw-aes";
|
||||
static const char *kMaxThreadsHint = "max-threads-hint";
|
||||
static const char *kPriority = "priority";
|
||||
|
||||
#ifdef XMRIG_FEATURE_ASM
|
||||
@@ -72,11 +73,6 @@ extern template class Threads<CpuThreads>;
|
||||
}
|
||||
|
||||
|
||||
xmrig::CpuConfig::CpuConfig()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::CpuConfig::isHwAES() const
|
||||
{
|
||||
return (m_aes == AES_AUTO ? (Cpu::info()->hasAES() ? AES_HW : AES_SOFT) : m_aes) == AES_HW;
|
||||
@@ -95,6 +91,10 @@ rapidjson::Value xmrig::CpuConfig::toJSON(rapidjson::Document &doc) const
|
||||
obj.AddMember(StringRef(kHwAes), m_aes == AES_AUTO ? Value(kNullType) : Value(m_aes == AES_HW), allocator);
|
||||
obj.AddMember(StringRef(kPriority), priority() != -1 ? Value(priority()) : Value(kNullType), allocator);
|
||||
|
||||
if (m_threads.isEmpty()) {
|
||||
obj.AddMember(StringRef(kMaxThreadsHint), m_limit, allocator);
|
||||
}
|
||||
|
||||
# ifdef XMRIG_FEATURE_ASM
|
||||
obj.AddMember(StringRef(kAsm), m_assembly.toJSON(), allocator);
|
||||
# endif
|
||||
@@ -131,8 +131,9 @@ std::vector<xmrig::CpuLaunchData> xmrig::CpuConfig::get(const Miner *miner, cons
|
||||
void xmrig::CpuConfig::read(const rapidjson::Value &value, uint32_t version)
|
||||
{
|
||||
if (value.IsObject()) {
|
||||
m_enabled = Json::getBool(value, kEnabled, m_enabled);
|
||||
m_hugePages = Json::getBool(value, kHugePages, m_hugePages);
|
||||
m_enabled = Json::getBool(value, kEnabled, m_enabled);
|
||||
m_hugePages = Json::getBool(value, kHugePages, m_hugePages);
|
||||
m_limit = Json::getUint(value, kMaxThreadsHint, m_limit);
|
||||
|
||||
setAesMode(Json::getValue(value, kHwAes));
|
||||
setPriority(Json::getInt(value, kPriority, -1));
|
||||
@@ -168,28 +169,28 @@ void xmrig::CpuConfig::generate()
|
||||
ICpuInfo *cpu = Cpu::info();
|
||||
|
||||
m_threads.disable(Algorithm::CN_0);
|
||||
m_threads.move(kCn, cpu->threads(Algorithm::CN_0));
|
||||
m_threads.move(kCn, cpu->threads(Algorithm::CN_0, m_limit));
|
||||
|
||||
# ifdef XMRIG_ALGO_CN_GPU
|
||||
m_threads.move(kCnGPU, cpu->threads(Algorithm::CN_GPU));
|
||||
m_threads.move(kCnGPU, cpu->threads(Algorithm::CN_GPU, m_limit));
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_CN_LITE
|
||||
m_threads.disable(Algorithm::CN_LITE_0);
|
||||
m_threads.move(kCnLite, cpu->threads(Algorithm::CN_LITE_1));
|
||||
m_threads.move(kCnLite, cpu->threads(Algorithm::CN_LITE_1, m_limit));
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_CN_HEAVY
|
||||
m_threads.move(kCnHeavy, cpu->threads(Algorithm::CN_HEAVY_0));
|
||||
m_threads.move(kCnHeavy, cpu->threads(Algorithm::CN_HEAVY_0, m_limit));
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_CN_PICO
|
||||
m_threads.move(kCnPico, cpu->threads(Algorithm::CN_PICO_0));
|
||||
m_threads.move(kCnPico, cpu->threads(Algorithm::CN_PICO_0, m_limit));
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
m_threads.move(kRx, cpu->threads(Algorithm::RX_0));
|
||||
m_threads.move(kRxWOW, cpu->threads(Algorithm::RX_WOW));
|
||||
m_threads.move(kRx, cpu->threads(Algorithm::RX_0, m_limit));
|
||||
m_threads.move(kRxWOW, cpu->threads(Algorithm::RX_WOW, m_limit));
|
||||
# endif
|
||||
|
||||
generateArgon2();
|
||||
@@ -199,7 +200,7 @@ void xmrig::CpuConfig::generate()
|
||||
void xmrig::CpuConfig::generateArgon2()
|
||||
{
|
||||
# ifdef XMRIG_ALGO_ARGON2
|
||||
m_threads.move(kArgon2, Cpu::info()->threads(Algorithm::AR2_CHUKWA));
|
||||
m_threads.move(kArgon2, Cpu::info()->threads(Algorithm::AR2_CHUKWA, m_limit));
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
AES_SOFT
|
||||
};
|
||||
|
||||
CpuConfig();
|
||||
CpuConfig() = default;
|
||||
|
||||
bool isHwAES() const;
|
||||
rapidjson::Value toJSON(rapidjson::Document &doc) const;
|
||||
@@ -74,6 +74,7 @@ private:
|
||||
int m_priority = -1;
|
||||
String m_argon2Impl;
|
||||
Threads<CpuThreads> m_threads;
|
||||
uint32_t m_limit = 100;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -45,18 +45,18 @@ public:
|
||||
inline constexpr static bool isX64() { return false; }
|
||||
# endif
|
||||
|
||||
virtual Assembly::Id assembly() const = 0;
|
||||
virtual bool hasAES() const = 0;
|
||||
virtual bool hasAVX2() const = 0;
|
||||
virtual const char *backend() const = 0;
|
||||
virtual const char *brand() const = 0;
|
||||
virtual CpuThreads threads(const Algorithm &algorithm) const = 0;
|
||||
virtual size_t cores() const = 0;
|
||||
virtual size_t L2() const = 0;
|
||||
virtual size_t L3() const = 0;
|
||||
virtual size_t nodes() const = 0;
|
||||
virtual size_t packages() const = 0;
|
||||
virtual size_t threads() const = 0;
|
||||
virtual Assembly::Id assembly() const = 0;
|
||||
virtual bool hasAES() const = 0;
|
||||
virtual bool hasAVX2() const = 0;
|
||||
virtual const char *backend() const = 0;
|
||||
virtual const char *brand() const = 0;
|
||||
virtual CpuThreads threads(const Algorithm &algorithm, uint32_t limit) const = 0;
|
||||
virtual size_t cores() const = 0;
|
||||
virtual size_t L2() const = 0;
|
||||
virtual size_t L3() const = 0;
|
||||
virtual size_t nodes() const = 0;
|
||||
virtual size_t packages() const = 0;
|
||||
virtual size_t threads() const = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -23,10 +23,10 @@
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
#include "3rdparty/libcpuid/libcpuid.h"
|
||||
@@ -109,7 +109,7 @@ xmrig::AdvancedCpuInfo::AdvancedCpuInfo() :
|
||||
}
|
||||
|
||||
|
||||
xmrig::CpuThreads xmrig::AdvancedCpuInfo::threads(const Algorithm &algorithm) const
|
||||
xmrig::CpuThreads xmrig::AdvancedCpuInfo::threads(const Algorithm &algorithm, uint32_t limit) const
|
||||
{
|
||||
if (threads() == 1) {
|
||||
return 1;
|
||||
@@ -153,5 +153,12 @@ xmrig::CpuThreads xmrig::AdvancedCpuInfo::threads(const Algorithm &algorithm) co
|
||||
}
|
||||
# endif
|
||||
|
||||
return CpuThreads(std::max<size_t>(std::min<size_t>(count, threads()), 1), intensity);
|
||||
if (limit > 0 && limit < 100) {
|
||||
count = std::min(count, static_cast<size_t>(round(threads() * (limit / 100.0))));
|
||||
}
|
||||
else {
|
||||
count = std::min(count, threads());
|
||||
}
|
||||
|
||||
return CpuThreads(std::max<size_t>(count, 1), intensity);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
AdvancedCpuInfo();
|
||||
|
||||
protected:
|
||||
CpuThreads threads(const Algorithm &algorithm) const override;
|
||||
CpuThreads threads(const Algorithm &algorithm, uint32_t limit) const override;
|
||||
|
||||
inline Assembly::Id assembly() const override { return m_assembly; }
|
||||
inline bool hasAES() const override { return m_aes; }
|
||||
|
||||
@@ -179,7 +179,7 @@ const char *xmrig::BasicCpuInfo::backend() const
|
||||
}
|
||||
|
||||
|
||||
xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &algorithm) const
|
||||
xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &algorithm, uint32_t limit) const
|
||||
{
|
||||
const size_t count = std::thread::hardware_concurrency();
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
|
||||
protected:
|
||||
const char *backend() const override;
|
||||
CpuThreads threads(const Algorithm &algorithm) const override;
|
||||
CpuThreads threads(const Algorithm &algorithm, uint32_t limit) const override;
|
||||
|
||||
inline Assembly::Id assembly() const override { return m_assembly; }
|
||||
inline bool hasAES() const override { return m_aes; }
|
||||
|
||||
@@ -63,7 +63,7 @@ const char *xmrig::BasicCpuInfo::backend() const
|
||||
}
|
||||
|
||||
|
||||
xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &) const
|
||||
xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &, uint32_t) const
|
||||
{
|
||||
return CpuThreads(threads());
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <hwloc.h>
|
||||
|
||||
|
||||
@@ -127,9 +128,7 @@ static inline bool isCacheExclusive(hwloc_obj_t obj)
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
xmrig::HwlocCpuInfo::HwlocCpuInfo() : BasicCpuInfo(),
|
||||
m_backend(),
|
||||
m_cache()
|
||||
xmrig::HwlocCpuInfo::HwlocCpuInfo()
|
||||
{
|
||||
m_threads = 0;
|
||||
|
||||
@@ -149,7 +148,7 @@ xmrig::HwlocCpuInfo::HwlocCpuInfo() : BasicCpuInfo(),
|
||||
# endif
|
||||
|
||||
const std::vector<hwloc_obj_t> packages = findByType(hwloc_get_root_obj(m_topology), HWLOC_OBJ_PACKAGE);
|
||||
if (packages.size()) {
|
||||
if (!packages.empty()) {
|
||||
const char *value = hwloc_obj_get_info_by_name(packages[0], "CPUModel");
|
||||
if (value) {
|
||||
strncpy(m_brand, value, 64);
|
||||
@@ -178,7 +177,7 @@ xmrig::HwlocCpuInfo::HwlocCpuInfo() : BasicCpuInfo(),
|
||||
|
||||
m_threads = countByType(m_topology, HWLOC_OBJ_PU);
|
||||
m_cores = countByType(m_topology, HWLOC_OBJ_CORE);
|
||||
m_nodes = std::max<size_t>(countByType(m_topology, HWLOC_OBJ_NUMANODE), 1);
|
||||
m_nodes = std::max(hwloc_bitmap_weight(hwloc_topology_get_complete_nodeset(m_topology)), 1);
|
||||
m_packages = countByType(m_topology, HWLOC_OBJ_PACKAGE);
|
||||
|
||||
if (m_nodes > 1) {
|
||||
@@ -202,10 +201,10 @@ xmrig::HwlocCpuInfo::~HwlocCpuInfo()
|
||||
}
|
||||
|
||||
|
||||
xmrig::CpuThreads xmrig::HwlocCpuInfo::threads(const Algorithm &algorithm) const
|
||||
xmrig::CpuThreads xmrig::HwlocCpuInfo::threads(const Algorithm &algorithm, uint32_t limit) const
|
||||
{
|
||||
if (L2() == 0 && L3() == 0) {
|
||||
return BasicCpuInfo::threads(algorithm);
|
||||
return BasicCpuInfo::threads(algorithm, limit);
|
||||
}
|
||||
|
||||
const unsigned depth = L3() > 0 ? 3 : 2;
|
||||
@@ -218,21 +217,37 @@ xmrig::CpuThreads xmrig::HwlocCpuInfo::threads(const Algorithm &algorithm) const
|
||||
|
||||
findCache(hwloc_get_root_obj(m_topology), depth, depth, [&caches](hwloc_obj_t found) { caches.emplace_back(found); });
|
||||
|
||||
for (hwloc_obj_t cache : caches) {
|
||||
processTopLevelCache(cache, algorithm, threads);
|
||||
if (limit > 0 && limit < 100 && !caches.empty()) {
|
||||
const double maxTotalThreads = round(m_threads * (limit / 100.0));
|
||||
const auto maxPerCache = std::max(static_cast<int>(round(maxTotalThreads / caches.size())), 1);
|
||||
int remaining = std::max(static_cast<int>(maxTotalThreads), 1);
|
||||
|
||||
for (hwloc_obj_t cache : caches) {
|
||||
processTopLevelCache(cache, algorithm, threads, std::min(maxPerCache, remaining));
|
||||
|
||||
remaining -= maxPerCache;
|
||||
if (remaining <= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (hwloc_obj_t cache : caches) {
|
||||
processTopLevelCache(cache, algorithm, threads, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (threads.isEmpty()) {
|
||||
LOG_WARN("hwloc auto configuration for algorithm \"%s\" failed.", algorithm.shortName());
|
||||
|
||||
return BasicCpuInfo::threads(algorithm);
|
||||
return BasicCpuInfo::threads(algorithm, limit);
|
||||
}
|
||||
|
||||
return threads;
|
||||
}
|
||||
|
||||
|
||||
void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorithm &algorithm, CpuThreads &threads) const
|
||||
void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorithm &algorithm, CpuThreads &threads, size_t limit) const
|
||||
{
|
||||
constexpr size_t oneMiB = 1024u * 1024u;
|
||||
|
||||
@@ -296,6 +311,10 @@ void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorith
|
||||
}
|
||||
# endif
|
||||
|
||||
if (limit > 0) {
|
||||
cacheHashes = std::min(cacheHashes, limit);
|
||||
}
|
||||
|
||||
if (cacheHashes >= PUs) {
|
||||
for (hwloc_obj_t core : cores) {
|
||||
const std::vector<hwloc_obj_t> units = findByType(core, HWLOC_OBJ_PU);
|
||||
|
||||
@@ -27,10 +27,11 @@
|
||||
|
||||
|
||||
#include "backend/cpu/platform/BasicCpuInfo.h"
|
||||
#include "base/tools/Object.h"
|
||||
|
||||
|
||||
typedef struct hwloc_obj *hwloc_obj_t;
|
||||
typedef struct hwloc_topology *hwloc_topology_t;
|
||||
using hwloc_obj_t = struct hwloc_obj *;
|
||||
using hwloc_topology_t = struct hwloc_topology *;
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
@@ -39,6 +40,9 @@ namespace xmrig {
|
||||
class HwlocCpuInfo : public BasicCpuInfo
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE(HwlocCpuInfo)
|
||||
|
||||
|
||||
enum Feature : uint32_t {
|
||||
SET_THISTHREAD_MEMBIND = 1
|
||||
};
|
||||
@@ -51,7 +55,7 @@ public:
|
||||
static inline const std::vector<uint32_t> &nodeIndexes() { return m_nodeIndexes; }
|
||||
|
||||
protected:
|
||||
CpuThreads threads(const Algorithm &algorithm) const override;
|
||||
CpuThreads threads(const Algorithm &algorithm, uint32_t limit) const override;
|
||||
|
||||
inline const char *backend() const override { return m_backend; }
|
||||
inline size_t cores() const override { return m_cores; }
|
||||
@@ -61,17 +65,17 @@ protected:
|
||||
inline size_t packages() const override { return m_packages; }
|
||||
|
||||
private:
|
||||
void processTopLevelCache(hwloc_obj_t obj, const Algorithm &algorithm, CpuThreads &threads) const;
|
||||
void processTopLevelCache(hwloc_obj_t obj, const Algorithm &algorithm, CpuThreads &threads, size_t limit) const;
|
||||
|
||||
static std::vector<uint32_t> m_nodeIndexes;
|
||||
static uint32_t m_features;
|
||||
|
||||
char m_backend[20];
|
||||
hwloc_topology_t m_topology;
|
||||
size_t m_cache[5];
|
||||
size_t m_cores = 0;
|
||||
size_t m_nodes = 0;
|
||||
size_t m_packages = 0;
|
||||
char m_backend[20] = { 0 };
|
||||
hwloc_topology_t m_topology = nullptr;
|
||||
size_t m_cache[5] = { 0 };
|
||||
size_t m_cores = 0;
|
||||
size_t m_nodes = 0;
|
||||
size_t m_packages = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "backend/opencl/OclConfig.h"
|
||||
#include "backend/opencl/OclLaunchData.h"
|
||||
#include "backend/opencl/OclWorker.h"
|
||||
#include "backend/opencl/runners/tools/OclSharedState.h"
|
||||
#include "backend/opencl/wrappers/OclContext.h"
|
||||
#include "backend/opencl/wrappers/OclLib.h"
|
||||
#include "base/io/log/Log.h"
|
||||
@@ -135,6 +136,10 @@ public:
|
||||
return printDisabled(RED_S " (failed to load OpenCL runtime)");
|
||||
}
|
||||
|
||||
if (platform.isValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
platform = cl.platform();
|
||||
if (!platform.isValid()) {
|
||||
return printDisabled(RED_S " (selected OpenCL platform NOT found)");
|
||||
@@ -150,7 +155,7 @@ public:
|
||||
for (const OclDevice &device : devices) {
|
||||
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN_BOLD("#%zu") YELLOW(" %s") " %s " WHITE_BOLD("%uMHz") " cu:" WHITE_BOLD("%u") " mem:" CYAN("%zu/%zu") " MB", "OPENCL GPU",
|
||||
device.index(),
|
||||
device.hasTopology() ? device.topology().toString().data() : "n/a",
|
||||
device.topology().toString().data(),
|
||||
device.printableName().data(),
|
||||
device.clock(),
|
||||
device.computeUnits(),
|
||||
@@ -160,7 +165,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
inline void start()
|
||||
inline void start(const Job &job)
|
||||
{
|
||||
LOG_INFO("%s use profile " BLUE_BG(WHITE_BOLD_S " %s ") WHITE_BOLD_S " (" CYAN_BOLD("%zu") WHITE_BOLD(" threads)") " scratchpad " CYAN_BOLD("%zu KB"),
|
||||
tag,
|
||||
@@ -177,7 +182,7 @@ public:
|
||||
CYAN_BOLD("%3u") " |" CYAN_BOLD("%3s") " |" CYAN_BOLD("%3u") " |" CYAN("%5zu") " | %s",
|
||||
i,
|
||||
data.thread.index(),
|
||||
data.device.hasTopology() ? data.device.topology().toString().data() : "n/a",
|
||||
data.device.topology().toString().data(),
|
||||
data.thread.intensity(),
|
||||
data.thread.worksize(),
|
||||
data.thread.stridedIndex(),
|
||||
@@ -190,6 +195,8 @@ public:
|
||||
i++;
|
||||
}
|
||||
|
||||
OclSharedState::start(threads, job);
|
||||
|
||||
status.start(threads.size());
|
||||
workers.start(threads);
|
||||
}
|
||||
@@ -285,7 +292,7 @@ void xmrig::OclBackend::printHashrate(bool details)
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::MediumInterval), num + 8, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::LargeInterval), num + 8 * 2, sizeof num / 3),
|
||||
data.device.index(),
|
||||
data.device.hasTopology() ? data.device.topology().toString().data() : "n/a",
|
||||
data.device.topology().toString().data(),
|
||||
data.device.printableName().data()
|
||||
);
|
||||
|
||||
@@ -302,12 +309,15 @@ void xmrig::OclBackend::printHashrate(bool details)
|
||||
|
||||
void xmrig::OclBackend::setJob(const Job &job)
|
||||
{
|
||||
const OclConfig &cl = d_ptr->controller->config()->cl();
|
||||
if (cl.isEnabled()) {
|
||||
d_ptr->init(cl);
|
||||
}
|
||||
|
||||
if (!isEnabled()) {
|
||||
return stop();
|
||||
}
|
||||
|
||||
const OclConfig &cl = d_ptr->controller->config()->cl();
|
||||
|
||||
std::vector<OclLaunchData> threads = cl.get(d_ptr->controller->miner(), job.algorithm(), d_ptr->platform, d_ptr->devices, tag);
|
||||
if (!d_ptr->threads.empty() && d_ptr->threads.size() == threads.size() && std::equal(d_ptr->threads.begin(), d_ptr->threads.end(), threads.begin())) {
|
||||
return;
|
||||
@@ -322,7 +332,7 @@ void xmrig::OclBackend::setJob(const Job &job)
|
||||
return stop();
|
||||
}
|
||||
|
||||
if (!d_ptr->context.init(d_ptr->devices, threads, job)) {
|
||||
if (!d_ptr->context.init(d_ptr->devices, threads)) {
|
||||
LOG_WARN("%s " RED_BOLD("disabled") YELLOW(" (OpenCL context unavailable)"), tag);
|
||||
|
||||
return stop();
|
||||
@@ -331,7 +341,7 @@ void xmrig::OclBackend::setJob(const Job &job)
|
||||
stop();
|
||||
|
||||
d_ptr->threads = std::move(threads);
|
||||
d_ptr->start();
|
||||
d_ptr->start(job);
|
||||
}
|
||||
|
||||
|
||||
@@ -364,6 +374,8 @@ void xmrig::OclBackend::stop()
|
||||
d_ptr->workers.stop();
|
||||
d_ptr->threads.clear();
|
||||
|
||||
OclSharedState::release();
|
||||
|
||||
LOG_INFO("%s" YELLOW(" stopped") BLACK_BOLD(" (%" PRIu64 " ms)"), tag, Chrono::steadyMSecs() - ts);
|
||||
}
|
||||
|
||||
@@ -401,6 +413,8 @@ rapidjson::Value xmrig::OclBackend::toJSON(rapidjson::Document &doc) const
|
||||
thread.AddMember("affinity", data.affinity, allocator);
|
||||
thread.AddMember("hashrate", hashrate()->toJSON(i, doc), allocator);
|
||||
|
||||
data.device.toJSON(thread, doc);
|
||||
|
||||
i++;
|
||||
threads.PushBack(thread, allocator);
|
||||
}
|
||||
|
||||
@@ -30,12 +30,16 @@
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
static const char *kAMD = "AMD";
|
||||
static const char *kCache = "cache";
|
||||
static const char *kCn = "cn";
|
||||
static const char *kCn2 = "cn/2";
|
||||
static const char *kDevicesHint = "devices-hint";
|
||||
static const char *kEnabled = "enabled";
|
||||
static const char *kINTEL = "INTEL";
|
||||
static const char *kLoader = "loader";
|
||||
@@ -90,6 +94,22 @@ static size_t generate(const char *key, Threads<OclThreads> &threads, const Algo
|
||||
}
|
||||
|
||||
|
||||
static inline std::vector<OclDevice> filterDevices(const std::vector<OclDevice> &devices, const std::vector<uint32_t> &hints)
|
||||
{
|
||||
std::vector<OclDevice> out;
|
||||
out.reserve(std::min(devices.size(), hints.size()));
|
||||
|
||||
for (const auto &device : devices) {
|
||||
auto it = std::find(hints.begin(), hints.end(), device.index());
|
||||
if (it != hints.end()) {
|
||||
out.emplace_back(device);
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -173,32 +193,13 @@ std::vector<xmrig::OclLaunchData> xmrig::OclConfig::get(const Miner *miner, cons
|
||||
continue;
|
||||
}
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
auto dataset = algorithm.family() == Algorithm::RANDOM_X ? std::make_shared<OclRxDataset>() : nullptr;
|
||||
# endif
|
||||
|
||||
if (thread.threads().size() > 1) {
|
||||
auto interleave = std::make_shared<OclInterleave>(thread.threads().size());
|
||||
|
||||
for (int64_t affinity : thread.threads()) {
|
||||
OclLaunchData data(miner, algorithm, *this, platform, thread, devices[thread.index()], affinity);
|
||||
data.interleave = interleave;
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
data.dataset = dataset;
|
||||
# endif
|
||||
|
||||
out.emplace_back(std::move(data));
|
||||
out.emplace_back(miner, algorithm, *this, platform, thread, devices[thread.index()], affinity);
|
||||
}
|
||||
}
|
||||
else {
|
||||
OclLaunchData data(miner, algorithm, *this, platform, thread, devices[thread.index()], thread.threads().front());
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
data.dataset = dataset;
|
||||
# endif
|
||||
|
||||
out.emplace_back(std::move(data));
|
||||
out.emplace_back(miner, algorithm, *this, platform, thread, devices[thread.index()], thread.threads().front());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,17 +215,20 @@ void xmrig::OclConfig::read(const rapidjson::Value &value)
|
||||
m_loader = Json::getString(value, kLoader);
|
||||
|
||||
setPlatform(Json::getValue(value, kPlatform));
|
||||
setDevicesHint(Json::getString(value, kDevicesHint));
|
||||
|
||||
if (isEnabled()) {
|
||||
m_threads.read(value);
|
||||
m_threads.read(value);
|
||||
|
||||
generate();
|
||||
}
|
||||
generate();
|
||||
}
|
||||
else if (value.IsBool() && value.IsFalse()) {
|
||||
m_enabled = false;
|
||||
else if (value.IsBool()) {
|
||||
m_enabled = value.GetBool();
|
||||
|
||||
generate();
|
||||
}
|
||||
else {
|
||||
m_shouldSave = true;
|
||||
|
||||
generate();
|
||||
}
|
||||
}
|
||||
@@ -232,11 +236,15 @@ void xmrig::OclConfig::read(const rapidjson::Value &value)
|
||||
|
||||
void xmrig::OclConfig::generate()
|
||||
{
|
||||
if (!isEnabled() || m_threads.has("*")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!OclLib::init(loader())) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto devices = platform().devices();
|
||||
const auto devices = m_devicesHint.empty() ? platform().devices() : filterDevices(platform().devices(), m_devicesHint);
|
||||
if (devices.empty()) {
|
||||
return;
|
||||
}
|
||||
@@ -281,6 +289,21 @@ void xmrig::OclConfig::generate()
|
||||
}
|
||||
|
||||
|
||||
void xmrig::OclConfig::setDevicesHint(const char *devicesHint)
|
||||
{
|
||||
if (devicesHint == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto indexes = String(devicesHint).split(',');
|
||||
m_devicesHint.reserve(indexes.size());
|
||||
|
||||
for (const auto &index : indexes) {
|
||||
m_devicesHint.push_back(strtoul(index, nullptr, 10));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void xmrig::OclConfig::setPlatform(const rapidjson::Value &platform)
|
||||
{
|
||||
if (platform.IsString()) {
|
||||
|
||||
@@ -53,11 +53,13 @@ public:
|
||||
|
||||
private:
|
||||
void generate();
|
||||
void setDevicesHint(const char *devicesHint);
|
||||
void setPlatform(const rapidjson::Value &platform);
|
||||
|
||||
bool m_cache = true;
|
||||
bool m_enabled = true;
|
||||
bool m_enabled = false;
|
||||
bool m_shouldSave = false;
|
||||
std::vector<uint32_t> m_devicesHint;
|
||||
String m_loader;
|
||||
String m_platformVendor;
|
||||
Threads<OclThreads> m_threads;
|
||||
|
||||
@@ -27,19 +27,14 @@
|
||||
#define XMRIG_OCLLAUNCHDATA_H
|
||||
|
||||
|
||||
#include "backend/opencl/OclInterleave.h"
|
||||
#include "backend/opencl/OclThread.h"
|
||||
#include "backend/opencl/runners/tools/OclSharedData.h"
|
||||
#include "backend/opencl/wrappers/OclDevice.h"
|
||||
#include "backend/opencl/wrappers/OclPlatform.h"
|
||||
#include "crypto/common/Algorithm.h"
|
||||
#include "crypto/common/Nonce.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_ALGO_RANDOMX
|
||||
# include "backend/opencl/runners/tools/OclRxDataset.h"
|
||||
#endif
|
||||
|
||||
|
||||
using cl_context = struct _cl_context *;
|
||||
|
||||
|
||||
@@ -72,11 +67,6 @@ public:
|
||||
const OclDevice device;
|
||||
const OclPlatform platform;
|
||||
const OclThread thread;
|
||||
OclInterleavePtr interleave;
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
OclRxDatasetPtr dataset;
|
||||
# endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -52,6 +52,10 @@ static const char* kDatasetHost = "dataset_host";
|
||||
|
||||
xmrig::OclThread::OclThread(const rapidjson::Value &value)
|
||||
{
|
||||
if (!value.IsObject()) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_index = Json::getUint(value, kIndex);
|
||||
m_worksize = std::max(std::min(Json::getUint(value, kWorksize), 128u), 1u);
|
||||
m_unrollFactor = std::max(std::min(Json::getUint(value, kUnroll, m_unrollFactor), 128u), 1u);
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
|
||||
#include "backend/common/Tags.h"
|
||||
#include "backend/opencl/runners/OclCnRunner.h"
|
||||
#include "backend/opencl/runners/tools/OclSharedData.h"
|
||||
#include "backend/opencl/runners/tools/OclSharedState.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/tools/Chrono.h"
|
||||
#include "core/Miner.h"
|
||||
@@ -75,7 +77,7 @@ xmrig::OclWorker::OclWorker(size_t id, const OclLaunchData &data) :
|
||||
m_algorithm(data.algorithm),
|
||||
m_miner(data.miner),
|
||||
m_intensity(data.thread.intensity()),
|
||||
m_interleave(data.interleave)
|
||||
m_sharedData(OclSharedState::get(data.device.index()))
|
||||
{
|
||||
switch (m_algorithm.family()) {
|
||||
case Algorithm::RANDOM_X:
|
||||
@@ -149,9 +151,7 @@ void xmrig::OclWorker::start()
|
||||
|
||||
while (Nonce::sequence(Nonce::OPENCL) > 0) {
|
||||
if (!isReady()) {
|
||||
if (m_interleave) {
|
||||
m_interleave->setResumeCounter(0);
|
||||
}
|
||||
m_sharedData.setResumeCounter(0);
|
||||
|
||||
do {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
@@ -162,9 +162,7 @@ void xmrig::OclWorker::start()
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_interleave) {
|
||||
m_interleave->resumeDelay(m_id);
|
||||
}
|
||||
m_sharedData.resumeDelay(m_id);
|
||||
|
||||
if (!consumeJob()) {
|
||||
return;
|
||||
@@ -172,9 +170,7 @@ void xmrig::OclWorker::start()
|
||||
}
|
||||
|
||||
while (!Nonce::isOutdated(Nonce::OPENCL, m_job.sequence())) {
|
||||
if (m_interleave) {
|
||||
m_interleave->adjustDelay(m_id);
|
||||
}
|
||||
m_sharedData.adjustDelay(m_id);
|
||||
|
||||
const uint64_t t = Chrono::steadyMSecs();
|
||||
|
||||
@@ -233,9 +229,7 @@ void xmrig::OclWorker::storeStats(uint64_t t)
|
||||
|
||||
m_count += m_intensity;
|
||||
|
||||
if (m_interleave) {
|
||||
m_interleave->setRunTime(Chrono::steadyMSecs() - t);
|
||||
}
|
||||
m_sharedData.setRunTime(Chrono::steadyMSecs() - t);
|
||||
|
||||
Worker::storeStats();
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ private:
|
||||
const Miner *m_miner;
|
||||
const uint32_t m_intensity;
|
||||
IOclRunner *m_runner = nullptr;
|
||||
OclInterleavePtr m_interleave;
|
||||
OclSharedData &m_sharedData;
|
||||
WorkerJob<1> m_job;
|
||||
};
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ if (WITH_OPENCL)
|
||||
src/backend/opencl/OclCache.h
|
||||
src/backend/opencl/OclConfig.h
|
||||
src/backend/opencl/OclGenerator.h
|
||||
src/backend/opencl/OclInterleave.h
|
||||
src/backend/opencl/OclLaunchData.h
|
||||
src/backend/opencl/OclThread.h
|
||||
src/backend/opencl/OclThreads.h
|
||||
@@ -22,6 +21,8 @@ if (WITH_OPENCL)
|
||||
src/backend/opencl/runners/OclBaseRunner.h
|
||||
src/backend/opencl/runners/OclCnRunner.h
|
||||
src/backend/opencl/runners/tools/OclCnR.h
|
||||
src/backend/opencl/runners/tools/OclSharedData.h
|
||||
src/backend/opencl/runners/tools/OclSharedState.h
|
||||
src/backend/opencl/wrappers/OclContext.h
|
||||
src/backend/opencl/wrappers/OclDevice.h
|
||||
src/backend/opencl/wrappers/OclError.h
|
||||
@@ -42,7 +43,6 @@ if (WITH_OPENCL)
|
||||
src/backend/opencl/OclBackend.cpp
|
||||
src/backend/opencl/OclCache.cpp
|
||||
src/backend/opencl/OclConfig.cpp
|
||||
src/backend/opencl/OclInterleave.cpp
|
||||
src/backend/opencl/OclLaunchData.cpp
|
||||
src/backend/opencl/OclThread.cpp
|
||||
src/backend/opencl/OclThreads.cpp
|
||||
@@ -50,6 +50,8 @@ if (WITH_OPENCL)
|
||||
src/backend/opencl/runners/OclBaseRunner.cpp
|
||||
src/backend/opencl/runners/OclCnRunner.cpp
|
||||
src/backend/opencl/runners/tools/OclCnR.cpp
|
||||
src/backend/opencl/runners/tools/OclSharedData.cpp
|
||||
src/backend/opencl/runners/tools/OclSharedState.cpp
|
||||
src/backend/opencl/wrappers/OclContext.cpp
|
||||
src/backend/opencl/wrappers/OclDevice.cpp
|
||||
src/backend/opencl/wrappers/OclError.cpp
|
||||
@@ -78,7 +80,6 @@ if (WITH_OPENCL)
|
||||
src/backend/opencl/runners/OclRxBaseRunner.h
|
||||
src/backend/opencl/runners/OclRxJitRunner.h
|
||||
src/backend/opencl/runners/OclRxVmRunner.h
|
||||
src/backend/opencl/runners/tools/OclRxDataset.h
|
||||
)
|
||||
|
||||
list(APPEND SOURCES_BACKEND_OPENCL
|
||||
@@ -95,7 +96,6 @@ if (WITH_OPENCL)
|
||||
src/backend/opencl/runners/OclRxBaseRunner.cpp
|
||||
src/backend/opencl/runners/OclRxJitRunner.cpp
|
||||
src/backend/opencl/runners/OclRxVmRunner.cpp
|
||||
src/backend/opencl/runners/tools/OclRxDataset.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -23,10 +23,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "backend/opencl/runners/OclBaseRunner.h"
|
||||
#include "backend/opencl/cl/OclSource.h"
|
||||
#include "backend/opencl/OclCache.h"
|
||||
#include "backend/opencl/OclLaunchData.h"
|
||||
#include "backend/opencl/runners/OclBaseRunner.h"
|
||||
#include "backend/opencl/runners/tools/OclSharedState.h"
|
||||
#include "backend/opencl/wrappers/OclError.h"
|
||||
#include "backend/opencl/wrappers/OclLib.h"
|
||||
#include "base/io/log/Log.h"
|
||||
@@ -34,6 +35,9 @@
|
||||
#include "crypto/common/VirtualMemory.h"
|
||||
|
||||
|
||||
constexpr size_t oneGiB = 1024 * 1024 * 1024;
|
||||
|
||||
|
||||
xmrig::OclBaseRunner::OclBaseRunner(size_t id, const OclLaunchData &data) :
|
||||
m_algorithm(data.algorithm),
|
||||
m_ctx(data.ctx),
|
||||
@@ -93,16 +97,17 @@ void xmrig::OclBaseRunner::build()
|
||||
|
||||
void xmrig::OclBaseRunner::init()
|
||||
{
|
||||
m_queue = OclLib::createCommandQueue(m_ctx, data().device.id());
|
||||
m_queue = OclLib::createCommandQueue(m_ctx, data().device.id());
|
||||
|
||||
constexpr size_t oneGiB = 1024 * 1024 * 1024;
|
||||
size_t size = bufferSize();
|
||||
size_t size = align(bufferSize());
|
||||
|
||||
if (size < oneGiB && data().device.vendorId() == OCL_VENDOR_AMD && data().device.freeMemSize() >= oneGiB) {
|
||||
size = oneGiB;
|
||||
m_buffer = OclSharedState::get(data().device.index()).createBuffer(m_ctx, size, m_offset);
|
||||
}
|
||||
else {
|
||||
m_buffer = OclLib::createBuffer(m_ctx, CL_MEM_READ_WRITE, size);
|
||||
}
|
||||
|
||||
m_buffer = OclLib::createBuffer(m_ctx, CL_MEM_READ_WRITE, size);
|
||||
m_input = createSubBuffer(CL_MEM_READ_ONLY | CL_MEM_HOST_WRITE_ONLY, Job::kMaxBlobSize);
|
||||
m_output = createSubBuffer(CL_MEM_READ_WRITE, sizeof(cl_uint) * 0x100);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "backend/opencl/kernels/rx/FindSharesKernel.h"
|
||||
#include "backend/opencl/kernels/rx/HashAesKernel.h"
|
||||
#include "backend/opencl/OclLaunchData.h"
|
||||
#include "backend/opencl/runners/tools/OclSharedState.h"
|
||||
#include "backend/opencl/wrappers/OclLib.h"
|
||||
#include "base/net/stratum/Job.h"
|
||||
#include "crypto/rx/Rx.h"
|
||||
@@ -75,6 +76,7 @@ xmrig::OclRxBaseRunner::~OclRxBaseRunner()
|
||||
OclLib::release(m_hashes);
|
||||
OclLib::release(m_rounding);
|
||||
OclLib::release(m_scratchpads);
|
||||
OclLib::release(m_dataset);
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +122,7 @@ void xmrig::OclRxBaseRunner::set(const Job &job, uint8_t *blob)
|
||||
m_seed = job.seed();
|
||||
|
||||
auto dataset = Rx::dataset(job, 0);
|
||||
enqueueWriteBuffer(data().dataset->get(), CL_TRUE, 0, dataset->size(), dataset->raw());
|
||||
enqueueWriteBuffer(m_dataset, CL_TRUE, 0, dataset->size(), dataset->raw());
|
||||
}
|
||||
|
||||
if (job.size() < Job::kMaxBlobSize) {
|
||||
@@ -177,4 +179,5 @@ void xmrig::OclRxBaseRunner::init()
|
||||
m_hashes = createSubBuffer(CL_MEM_READ_WRITE | CL_MEM_HOST_NO_ACCESS, 64 * m_intensity);
|
||||
m_entropy = createSubBuffer(CL_MEM_READ_WRITE | CL_MEM_HOST_NO_ACCESS, (128 + 2560) * m_intensity);
|
||||
m_rounding = createSubBuffer(CL_MEM_READ_WRITE | CL_MEM_HOST_NO_ACCESS, sizeof(uint32_t) * m_intensity);
|
||||
m_dataset = OclSharedState::get(data().device.index()).dataset();
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ protected:
|
||||
Blake2bHashRegistersKernel *m_blake2b_hash_registers_64 = nullptr;
|
||||
Blake2bInitialHashKernel *m_blake2b_initial_hash = nullptr;
|
||||
Buffer m_seed;
|
||||
cl_mem m_dataset = nullptr;
|
||||
cl_mem m_entropy = nullptr;
|
||||
cl_mem m_hashes = nullptr;
|
||||
cl_mem m_rounding = nullptr;
|
||||
|
||||
@@ -74,7 +74,7 @@ void xmrig::OclRxJitRunner::build()
|
||||
}
|
||||
|
||||
m_randomx_run = new RxRunKernel(m_asmProgram);
|
||||
m_randomx_run->setArgs(data().dataset->get(), m_scratchpads, m_registers, m_rounding, m_programs, m_intensity, m_algorithm);
|
||||
m_randomx_run->setArgs(m_dataset, m_scratchpads, m_registers, m_rounding, m_programs, m_intensity, m_algorithm);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ void xmrig::OclRxVmRunner::build()
|
||||
m_init_vm->setArgs(m_entropy, m_vm_states, m_rounding);
|
||||
|
||||
m_execute_vm = new ExecuteVmKernel(m_program);
|
||||
m_execute_vm->setArgs(m_vm_states, m_rounding, m_scratchpads, data().dataset->get(), m_intensity);
|
||||
m_execute_vm->setArgs(m_vm_states, m_rounding, m_scratchpads, m_dataset, m_intensity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ private:
|
||||
for (size_t i = 0; i < OclCnR::kHeightChunkSize; ++i) {
|
||||
V4_Instruction code[256];
|
||||
const int code_size = v4_random_math_init<Algorithm::CN_R>(code, offset + i);
|
||||
const std::string kernel = std::regex_replace(cryptonight_r_cl, std::regex("XMRIG_INCLUDE_RANDOM_MATH"), getCode(code, code_size));
|
||||
const std::string kernel = std::regex_replace(std::string(cryptonight_r_cl), std::regex("XMRIG_INCLUDE_RANDOM_MATH"), getCode(code, code_size));
|
||||
|
||||
source += std::regex_replace(kernel, std::regex("KERNEL_NAME"), "cn1_" + std::to_string(offset + i));
|
||||
}
|
||||
|
||||
@@ -23,17 +23,44 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "backend/opencl/OclInterleave.h"
|
||||
#include "backend/opencl/runners/tools/OclSharedData.h"
|
||||
#include "backend/opencl/wrappers/OclLib.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/tools/Chrono.h"
|
||||
#include "crypto/rx/Rx.h"
|
||||
#include "crypto/rx/RxDataset.h"
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
#include <cinttypes>
|
||||
#include <stdexcept>
|
||||
#include <thread>
|
||||
|
||||
|
||||
uint64_t xmrig::OclInterleave::adjustDelay(size_t id)
|
||||
constexpr size_t oneGiB = 1024 * 1024 * 1024;
|
||||
|
||||
|
||||
cl_mem xmrig::OclSharedData::createBuffer(cl_context context, size_t size, size_t &offset)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
|
||||
offset += size * m_offset++;
|
||||
size = std::max(size * m_threads, oneGiB);
|
||||
|
||||
if (!m_buffer) {
|
||||
m_buffer = OclLib::createBuffer(context, CL_MEM_READ_WRITE, size);
|
||||
}
|
||||
|
||||
return OclLib::retain(m_buffer);
|
||||
}
|
||||
|
||||
|
||||
uint64_t xmrig::OclSharedData::adjustDelay(size_t id)
|
||||
{
|
||||
if (m_threads < 2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const uint64_t t0 = Chrono::steadyMSecs();
|
||||
uint64_t delay = 0;
|
||||
|
||||
@@ -69,8 +96,12 @@ uint64_t xmrig::OclInterleave::adjustDelay(size_t id)
|
||||
}
|
||||
|
||||
|
||||
uint64_t xmrig::OclInterleave::resumeDelay(size_t id)
|
||||
uint64_t xmrig::OclSharedData::resumeDelay(size_t id)
|
||||
{
|
||||
if (m_threads < 2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t delay = 0;
|
||||
|
||||
{
|
||||
@@ -99,14 +130,28 @@ uint64_t xmrig::OclInterleave::resumeDelay(size_t id)
|
||||
}
|
||||
|
||||
|
||||
void xmrig::OclInterleave::setResumeCounter(uint32_t value)
|
||||
void xmrig::OclSharedData::release()
|
||||
{
|
||||
OclLib::release(m_buffer);
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
OclLib::release(m_dataset);
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
void xmrig::OclSharedData::setResumeCounter(uint32_t value)
|
||||
{
|
||||
if (m_threads < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
m_resumeCounter = value;
|
||||
}
|
||||
|
||||
|
||||
void xmrig::OclInterleave::setRunTime(uint64_t time)
|
||||
void xmrig::OclSharedData::setRunTime(uint64_t time)
|
||||
{
|
||||
// averagingBias = 1.0 - only the last delta time is taken into account
|
||||
// averagingBias = 0.5 - the last delta time has the same weight as all the previous ones combined
|
||||
@@ -116,3 +161,34 @@ void xmrig::OclInterleave::setRunTime(uint64_t time)
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
m_averageRunTime = m_averageRunTime * (1.0 - averagingBias) + time * averagingBias;
|
||||
}
|
||||
|
||||
|
||||
#ifdef XMRIG_ALGO_RANDOMX
|
||||
cl_mem xmrig::OclSharedData::dataset() const
|
||||
{
|
||||
if (!m_dataset) {
|
||||
throw std::runtime_error("RandomX dataset is not available");
|
||||
}
|
||||
|
||||
return OclLib::retain(m_dataset);
|
||||
}
|
||||
|
||||
|
||||
void xmrig::OclSharedData::createDataset(cl_context ctx, const Job &job, bool host)
|
||||
{
|
||||
if (m_dataset) {
|
||||
return;
|
||||
}
|
||||
|
||||
cl_int ret;
|
||||
|
||||
if (host) {
|
||||
auto dataset = Rx::dataset(job, 0);
|
||||
|
||||
m_dataset = OclLib::createBuffer(ctx, CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, RxDataset::maxSize(), dataset->raw(), &ret);
|
||||
}
|
||||
else {
|
||||
m_dataset = OclLib::createBuffer(ctx, CL_MEM_READ_ONLY, RxDataset::maxSize(), nullptr, &ret);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -22,42 +22,62 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef XMRIG_OCLINTERLEAVE_H
|
||||
#define XMRIG_OCLINTERLEAVE_H
|
||||
#ifndef XMRIG_OCLSHAREDDATA_H
|
||||
#define XMRIG_OCLSHAREDDATA_H
|
||||
|
||||
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
|
||||
|
||||
using cl_context = struct _cl_context *;
|
||||
using cl_mem = struct _cl_mem *;
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
class OclInterleave
|
||||
class Job;
|
||||
|
||||
|
||||
class OclSharedData
|
||||
{
|
||||
public:
|
||||
OclInterleave() = delete;
|
||||
inline OclInterleave(size_t threads) : m_threads(threads) {}
|
||||
OclSharedData() = default;
|
||||
|
||||
cl_mem createBuffer(cl_context context, size_t size, size_t &offset);
|
||||
uint64_t adjustDelay(size_t id);
|
||||
uint64_t resumeDelay(size_t id);
|
||||
void release();
|
||||
void setResumeCounter(uint32_t value);
|
||||
void setRunTime(uint64_t time);
|
||||
|
||||
inline size_t threads() const { return m_threads; }
|
||||
|
||||
inline OclSharedData &operator++() { ++m_threads; return *this; }
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
cl_mem dataset() const;
|
||||
void createDataset(cl_context ctx, const Job &job, bool host);
|
||||
# endif
|
||||
|
||||
private:
|
||||
const size_t m_threads;
|
||||
cl_mem m_buffer = nullptr;
|
||||
double m_averageRunTime = 0.0;
|
||||
double m_threshold = 0.95;
|
||||
size_t m_offset = 0;
|
||||
size_t m_threads = 0;
|
||||
std::mutex m_mutex;
|
||||
uint32_t m_resumeCounter = 0;
|
||||
uint64_t m_timestamp = 0;
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
cl_mem m_dataset = nullptr;
|
||||
# endif
|
||||
};
|
||||
|
||||
|
||||
using OclInterleavePtr = std::shared_ptr<OclInterleave>;
|
||||
|
||||
|
||||
} /* namespace xmrig */
|
||||
|
||||
|
||||
#endif /* XMRIG_OCLINTERLEAVE_H */
|
||||
#endif /* XMRIG_OCLSHAREDDATA_H */
|
||||
@@ -23,32 +23,52 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "backend/opencl/runners/tools/OclRxDataset.h"
|
||||
#include "backend/opencl/wrappers/OclLib.h"
|
||||
#include "crypto/rx/Rx.h"
|
||||
#include "crypto/rx/RxDataset.h"
|
||||
#include "backend/opencl/runners/tools/OclSharedState.h"
|
||||
#include "backend/opencl/runners/tools/OclSharedData.h"
|
||||
|
||||
|
||||
void xmrig::OclRxDataset::createBuffer(cl_context ctx, const Job &job, bool host)
|
||||
#include <cassert>
|
||||
#include <map>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
static std::map<uint32_t, OclSharedData> map;
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
xmrig::OclSharedData &xmrig::OclSharedState::get(uint32_t index)
|
||||
{
|
||||
if (m_dataset) {
|
||||
return;
|
||||
}
|
||||
|
||||
cl_int ret;
|
||||
|
||||
if (host) {
|
||||
auto dataset = Rx::dataset(job, 0);
|
||||
|
||||
m_dataset = OclLib::createBuffer(ctx, CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, RxDataset::maxSize(), dataset->raw(), &ret);
|
||||
}
|
||||
else {
|
||||
m_dataset = OclLib::createBuffer(ctx, CL_MEM_READ_ONLY, RxDataset::maxSize(), nullptr, &ret);
|
||||
}
|
||||
return map[index];
|
||||
}
|
||||
|
||||
|
||||
xmrig::OclRxDataset::~OclRxDataset()
|
||||
void xmrig::OclSharedState::release()
|
||||
{
|
||||
OclLib::release(m_dataset);
|
||||
for (auto &kv : map) {
|
||||
kv.second.release();
|
||||
}
|
||||
|
||||
map.clear();
|
||||
}
|
||||
|
||||
|
||||
void xmrig::OclSharedState::start(const std::vector<OclLaunchData> &threads, const Job &job)
|
||||
{
|
||||
assert(map.empty());
|
||||
|
||||
for (const auto &data : threads) {
|
||||
auto &sharedData = map[data.device.index()];
|
||||
|
||||
++sharedData;
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
if (data.algorithm.family() == Algorithm::RANDOM_X) {
|
||||
sharedData.createDataset(data.ctx, job, data.thread.isDatasetHost());
|
||||
}
|
||||
# endif
|
||||
}
|
||||
}
|
||||
@@ -22,47 +22,26 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef XMRIG_OCLRXDATASET_H
|
||||
#define XMRIG_OCLRXDATASET_H
|
||||
#ifndef XMRIG_OCLSHAREDSTATE_H
|
||||
#define XMRIG_OCLSHAREDSTATE_H
|
||||
|
||||
|
||||
#include "base/tools/Object.h"
|
||||
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
using cl_context = struct _cl_context *;
|
||||
using cl_mem = struct _cl_mem *;
|
||||
#include "backend/opencl/OclLaunchData.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
class Job;
|
||||
|
||||
|
||||
class OclRxDataset
|
||||
class OclSharedState
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE(OclRxDataset)
|
||||
|
||||
OclRxDataset() = default;
|
||||
~OclRxDataset();
|
||||
|
||||
inline cl_mem get() const { return m_dataset; }
|
||||
|
||||
void createBuffer(cl_context ctx,const Job &job, bool host);
|
||||
|
||||
private:
|
||||
cl_mem m_dataset = nullptr;
|
||||
static OclSharedData &get(uint32_t index);
|
||||
static void release();
|
||||
static void start(const std::vector<OclLaunchData> &threads, const Job &job);
|
||||
};
|
||||
|
||||
|
||||
using OclRxDatasetPtr = std::shared_ptr<OclRxDataset>;
|
||||
|
||||
|
||||
} /* namespace xmrig */
|
||||
|
||||
|
||||
#endif /* XMRIG_OCLINTERLEAVE_H */
|
||||
#endif /* XMRIG_OCLSHAREDSTATE_H */
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
|
||||
#include "backend/opencl/wrappers/OclContext.h"
|
||||
#include "backend/opencl/runners/tools/OclSharedState.h"
|
||||
#include "backend/opencl/wrappers/OclLib.h"
|
||||
|
||||
|
||||
@@ -42,7 +43,7 @@ xmrig::OclContext::~OclContext()
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::OclContext::init(const std::vector<OclDevice> &devices, std::vector<OclLaunchData> &threads, const Job &job)
|
||||
bool xmrig::OclContext::init(const std::vector<OclDevice> &devices, std::vector<OclLaunchData> &threads)
|
||||
{
|
||||
if (!m_ctx) {
|
||||
std::vector<cl_device_id> ids(devices.size());
|
||||
@@ -59,12 +60,6 @@ bool xmrig::OclContext::init(const std::vector<OclDevice> &devices, std::vector<
|
||||
|
||||
for (OclLaunchData &data : threads) {
|
||||
data.ctx = m_ctx;
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
if (data.algorithm.family() == Algorithm::RANDOM_X) {
|
||||
data.dataset->createBuffer(m_ctx, job, data.thread.isDatasetHost());
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
OclContext(const OclDevice &device);
|
||||
~OclContext();
|
||||
|
||||
bool init(const std::vector<OclDevice> &devices, std::vector<OclLaunchData> &threads, const Job &job);
|
||||
bool init(const std::vector<OclDevice> &devices, std::vector<OclLaunchData> &threads);
|
||||
|
||||
inline bool isValid() const { return m_ctx != nullptr; }
|
||||
inline cl_context ctx() const { return m_ctx; }
|
||||
|
||||
@@ -59,7 +59,7 @@ extern bool ocl_vega_cn_generator(const OclDevice &device, const Algorithm &algo
|
||||
extern bool ocl_generic_cn_generator(const OclDevice &device, const Algorithm &algorithm, OclThreads &threads);
|
||||
|
||||
|
||||
ocl_gen_config_fun generators[] = {
|
||||
static ocl_gen_config_fun generators[] = {
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
ocl_generic_rx_generator,
|
||||
# endif
|
||||
@@ -142,16 +142,14 @@ xmrig::OclDevice::OclDevice(uint32_t index, cl_device_id id, cl_platform_id plat
|
||||
topology_amd topology;
|
||||
|
||||
if (OclLib::getDeviceInfo(id, 0x4037 /* CL_DEVICE_TOPOLOGY_AMD */, sizeof(topology), &topology, nullptr) == CL_SUCCESS && topology.raw.type == 1) {
|
||||
m_topology = true;
|
||||
m_pciTopology = PciTopology(static_cast<uint32_t>(topology.pcie.bus), static_cast<uint32_t>(topology.pcie.device), static_cast<uint32_t>(topology.pcie.function));
|
||||
m_topology = PciTopology(static_cast<uint32_t>(topology.pcie.bus), static_cast<uint32_t>(topology.pcie.device), static_cast<uint32_t>(topology.pcie.function));
|
||||
}
|
||||
}
|
||||
else if (m_vendorId == OCL_VENDOR_NVIDIA) {
|
||||
cl_uint bus = 0;
|
||||
if (OclLib::getDeviceInfo(id, 0x4008 /* CL_DEVICE_PCI_BUS_ID_NV */, sizeof (bus), &bus, nullptr) == CL_SUCCESS) {
|
||||
m_topology = true;
|
||||
cl_uint slot = OclLib::getUint(id, 0x4009 /* CL_DEVICE_PCI_SLOT_ID_NV */);
|
||||
m_pciTopology = PciTopology(bus, (slot >> 3) & 0xff, slot & 7);
|
||||
m_topology = PciTopology(bus, (slot >> 3) & 0xff, slot & 7);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -205,3 +203,18 @@ void xmrig::OclDevice::generate(const Algorithm &algorithm, OclThreads &threads)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_API
|
||||
void xmrig::OclDevice::toJSON(rapidjson::Value &out, rapidjson::Document &doc) const
|
||||
{
|
||||
using namespace rapidjson;
|
||||
auto &allocator = doc.GetAllocator();
|
||||
|
||||
out.AddMember("board", board().toJSON(doc), allocator);
|
||||
out.AddMember("name", name().toJSON(doc), allocator);
|
||||
out.AddMember("bus_id", topology().toString().toJSON(doc), allocator);
|
||||
out.AddMember("cu", computeUnits(), allocator);
|
||||
out.AddMember("global_mem", static_cast<uint64_t>(globalMemSize()), allocator);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -69,10 +69,9 @@ public:
|
||||
uint32_t clock() const;
|
||||
void generate(const Algorithm &algorithm, OclThreads &threads) const;
|
||||
|
||||
inline bool hasTopology() const { return m_topology; }
|
||||
inline bool isValid() const { return m_id != nullptr && m_platform != nullptr; }
|
||||
inline cl_device_id id() const { return m_id; }
|
||||
inline const PciTopology &topology() const { return m_pciTopology; }
|
||||
inline const PciTopology &topology() const { return m_topology; }
|
||||
inline const String &board() const { return m_board.isNull() ? m_name : m_board; }
|
||||
inline const String &name() const { return m_name; }
|
||||
inline const String &vendor() const { return m_vendor; }
|
||||
@@ -81,8 +80,11 @@ public:
|
||||
inline uint32_t computeUnits() const { return m_computeUnits; }
|
||||
inline uint32_t index() const { return m_index; }
|
||||
|
||||
# ifdef XMRIG_FEATURE_API
|
||||
void toJSON(rapidjson::Value &out, rapidjson::Document &doc) const;
|
||||
# endif
|
||||
|
||||
private:
|
||||
bool m_topology = false;
|
||||
cl_device_id m_id = nullptr;
|
||||
cl_platform_id m_platform = nullptr;
|
||||
const String m_board;
|
||||
@@ -91,7 +93,7 @@ private:
|
||||
const uint32_t m_computeUnits = 1;
|
||||
const uint32_t m_index = 0;
|
||||
OclVendor m_vendorId = OCL_VENDOR_UNKNOWN;
|
||||
PciTopology m_pciTopology;
|
||||
PciTopology m_topology;
|
||||
Type m_type = Unknown;
|
||||
};
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ static const char *kReleaseDevice = "clReleaseDevice";
|
||||
static const char *kReleaseKernel = "clReleaseKernel";
|
||||
static const char *kReleaseMemObject = "clReleaseMemObject";
|
||||
static const char *kReleaseProgram = "clReleaseProgram";
|
||||
static const char *kRetainMemObject = "clRetainMemObject";
|
||||
static const char *kRetainProgram = "clRetainProgram";
|
||||
static const char *kSetKernelArg = "clSetKernelArg";
|
||||
static const char *kSetMemObjectDestructorCallback = "clSetMemObjectDestructorCallback";
|
||||
@@ -106,6 +107,7 @@ typedef cl_int (CL_API_CALL *releaseDevice_t)(cl_device_id device);
|
||||
typedef cl_int (CL_API_CALL *releaseKernel_t)(cl_kernel);
|
||||
typedef cl_int (CL_API_CALL *releaseMemObject_t)(cl_mem);
|
||||
typedef cl_int (CL_API_CALL *releaseProgram_t)(cl_program);
|
||||
typedef cl_int (CL_API_CALL *retainMemObject_t)(cl_mem);
|
||||
typedef cl_int (CL_API_CALL *retainProgram_t)(cl_program);
|
||||
typedef cl_int (CL_API_CALL *setKernelArg_t)(cl_kernel, cl_uint, size_t, const void *);
|
||||
typedef cl_int (CL_API_CALL *setMemObjectDestructorCallback_t)(cl_mem, void (CL_CALLBACK *)(cl_mem, void *), void *);
|
||||
@@ -148,6 +150,7 @@ static releaseDevice_t pReleaseDevice = nu
|
||||
static releaseKernel_t pReleaseKernel = nullptr;
|
||||
static releaseMemObject_t pReleaseMemObject = nullptr;
|
||||
static releaseProgram_t pReleaseProgram = nullptr;
|
||||
static retainMemObject_t pRetainMemObject = nullptr;
|
||||
static retainProgram_t pRetainProgram = nullptr;
|
||||
static setKernelArg_t pSetKernelArg = nullptr;
|
||||
static setMemObjectDestructorCallback_t pSetMemObjectDestructorCallback = nullptr;
|
||||
@@ -239,6 +242,7 @@ bool xmrig::OclLib::load()
|
||||
DLSYM(SetMemObjectDestructorCallback);
|
||||
DLSYM(CreateSubBuffer);
|
||||
DLSYM(RetainProgram);
|
||||
DLSYM(RetainMemObject);
|
||||
|
||||
# if defined(CL_VERSION_2_0)
|
||||
uv_dlsym(&oclLib, kCreateCommandQueueWithProperties, reinterpret_cast<void**>(&pCreateCommandQueueWithProperties));
|
||||
@@ -670,6 +674,18 @@ cl_mem xmrig::OclLib::createSubBuffer(cl_mem buffer, cl_mem_flags flags, size_t
|
||||
}
|
||||
|
||||
|
||||
cl_mem xmrig::OclLib::retain(cl_mem memobj) noexcept
|
||||
{
|
||||
assert(pRetainMemObject != nullptr);
|
||||
|
||||
if (memobj != nullptr) {
|
||||
pRetainMemObject(memobj);
|
||||
}
|
||||
|
||||
return memobj;
|
||||
}
|
||||
|
||||
|
||||
cl_program xmrig::OclLib::createProgramWithBinary(cl_context context, cl_uint num_devices, const cl_device_id *device_list, const size_t *lengths, const unsigned char **binaries, cl_int *binary_status, cl_int *errcode_ret) noexcept
|
||||
{
|
||||
assert(pCreateProgramWithBinary != nullptr);
|
||||
|
||||
@@ -79,6 +79,7 @@ public:
|
||||
static cl_mem createBuffer(cl_context context, cl_mem_flags flags, size_t size, void *host_ptr, cl_int *errcode_ret) noexcept;
|
||||
static cl_mem createSubBuffer(cl_mem buffer, cl_mem_flags flags, size_t offset, size_t size, cl_int *errcode_ret) noexcept;
|
||||
static cl_mem createSubBuffer(cl_mem buffer, cl_mem_flags flags, size_t offset, size_t size);
|
||||
static cl_mem retain(cl_mem memobj) noexcept;
|
||||
static cl_program createProgramWithBinary(cl_context context, cl_uint num_devices, const cl_device_id *device_list, const size_t *lengths, const unsigned char **binaries, cl_int *binary_status, cl_int *errcode_ret) noexcept;
|
||||
static cl_program createProgramWithSource(cl_context context, cl_uint count, const char **strings, const size_t *lengths, cl_int *errcode_ret) noexcept;
|
||||
static cl_program retain(cl_program program) noexcept;
|
||||
|
||||
@@ -73,7 +73,7 @@ rapidjson::Value xmrig::OclPlatform::toJSON(rapidjson::Document &doc) const
|
||||
}
|
||||
|
||||
Value out(kObjectType);
|
||||
out.AddMember("index", index(), allocator);
|
||||
out.AddMember("index", static_cast<uint64_t>(index()), allocator);
|
||||
out.AddMember("profile", profile().toJSON(doc), allocator);
|
||||
out.AddMember("version", version().toJSON(doc), allocator);
|
||||
out.AddMember("name", name().toJSON(doc), allocator);
|
||||
|
||||
@@ -117,9 +117,10 @@ void xmrig::Api::exec(IApiRequest &request)
|
||||
auto &allocator = request.doc().GetAllocator();
|
||||
|
||||
request.accept();
|
||||
request.reply().AddMember("id", StringRef(m_id), allocator);
|
||||
request.reply().AddMember("worker_id", StringRef(m_workerId), allocator);
|
||||
request.reply().AddMember("uptime", (Chrono::currentMSecsSinceEpoch() - m_timestamp) / 1000, allocator);
|
||||
request.reply().AddMember("id", StringRef(m_id), allocator);
|
||||
request.reply().AddMember("worker_id", StringRef(m_workerId), allocator);
|
||||
request.reply().AddMember("uptime", (Chrono::currentMSecsSinceEpoch() - m_timestamp) / 1000, allocator);
|
||||
request.reply().AddMember("restricted", request.isRestricted(), allocator);
|
||||
|
||||
Value features(kArrayType);
|
||||
# ifdef XMRIG_FEATURE_API
|
||||
|
||||
@@ -27,10 +27,11 @@
|
||||
|
||||
|
||||
#include <vector>
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
#include "base/kernel/interfaces/IBaseListener.h"
|
||||
#include "base/tools/Object.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
@@ -47,6 +48,8 @@ class String;
|
||||
class Api : public IBaseListener
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE_DEFAULT(Api)
|
||||
|
||||
Api(Base *base);
|
||||
~Api() override;
|
||||
|
||||
|
||||
@@ -31,8 +31,11 @@
|
||||
xmrig::Console::Console(IConsoleListener *listener)
|
||||
: m_listener(listener)
|
||||
{
|
||||
m_tty = new uv_tty_t;
|
||||
if (!isSupported()) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_tty = new uv_tty_t;
|
||||
m_tty->data = this;
|
||||
uv_tty_init(uv_default_loop(), m_tty, 0, 1);
|
||||
|
||||
@@ -53,6 +56,10 @@ xmrig::Console::~Console()
|
||||
|
||||
void xmrig::Console::stop()
|
||||
{
|
||||
if (!m_tty) {
|
||||
return;
|
||||
}
|
||||
|
||||
uv_tty_reset_mode();
|
||||
|
||||
Handle::close(m_tty);
|
||||
@@ -60,6 +67,13 @@ void xmrig::Console::stop()
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::Console::isSupported() const
|
||||
{
|
||||
const uv_handle_type type = uv_guess_handle(0);
|
||||
return type == UV_TTY || type == UV_NAMED_PIPE;
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Console::onAllocBuffer(uv_handle_t *handle, size_t, uv_buf_t *buf)
|
||||
{
|
||||
auto console = static_cast<Console*>(handle->data);
|
||||
|
||||
@@ -26,9 +26,11 @@
|
||||
#define XMRIG_CONSOLE_H
|
||||
|
||||
|
||||
#include <uv.h>
|
||||
#include "base/tools/Object.h"
|
||||
|
||||
|
||||
#include <uv.h>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
@@ -39,18 +41,22 @@ class IConsoleListener;
|
||||
class Console
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE_DEFAULT(Console)
|
||||
|
||||
Console(IConsoleListener *listener);
|
||||
~Console();
|
||||
|
||||
void stop();
|
||||
|
||||
private:
|
||||
bool isSupported() const;
|
||||
|
||||
static void onAllocBuffer(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf);
|
||||
static void onRead(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf);
|
||||
|
||||
char m_buf[1];
|
||||
char m_buf[1] = { 0 };
|
||||
IConsoleListener *m_listener;
|
||||
uv_tty_t *m_tty;
|
||||
uv_tty_t *m_tty = nullptr;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
static const rapidjson::Value kNullValue;
|
||||
@@ -36,6 +39,8 @@ static const rapidjson::Value kNullValue;
|
||||
|
||||
bool xmrig::Json::getBool(const rapidjson::Value &obj, const char *key, bool defaultValue)
|
||||
{
|
||||
assert(obj.IsObject());
|
||||
|
||||
auto i = obj.FindMember(key);
|
||||
if (i != obj.MemberEnd() && i->value.IsBool()) {
|
||||
return i->value.GetBool();
|
||||
@@ -47,6 +52,8 @@ bool xmrig::Json::getBool(const rapidjson::Value &obj, const char *key, bool def
|
||||
|
||||
const char *xmrig::Json::getString(const rapidjson::Value &obj, const char *key, const char *defaultValue)
|
||||
{
|
||||
assert(obj.IsObject());
|
||||
|
||||
auto i = obj.FindMember(key);
|
||||
if (i != obj.MemberEnd() && i->value.IsString()) {
|
||||
return i->value.GetString();
|
||||
@@ -58,6 +65,8 @@ const char *xmrig::Json::getString(const rapidjson::Value &obj, const char *key,
|
||||
|
||||
const rapidjson::Value &xmrig::Json::getArray(const rapidjson::Value &obj, const char *key)
|
||||
{
|
||||
assert(obj.IsObject());
|
||||
|
||||
auto i = obj.FindMember(key);
|
||||
if (i != obj.MemberEnd() && i->value.IsArray()) {
|
||||
return i->value;
|
||||
@@ -69,6 +78,8 @@ const rapidjson::Value &xmrig::Json::getArray(const rapidjson::Value &obj, const
|
||||
|
||||
const rapidjson::Value &xmrig::Json::getObject(const rapidjson::Value &obj, const char *key)
|
||||
{
|
||||
assert(obj.IsObject());
|
||||
|
||||
auto i = obj.FindMember(key);
|
||||
if (i != obj.MemberEnd() && i->value.IsObject()) {
|
||||
return i->value;
|
||||
@@ -80,6 +91,8 @@ const rapidjson::Value &xmrig::Json::getObject(const rapidjson::Value &obj, cons
|
||||
|
||||
const rapidjson::Value &xmrig::Json::getValue(const rapidjson::Value &obj, const char *key)
|
||||
{
|
||||
assert(obj.IsObject());
|
||||
|
||||
auto i = obj.FindMember(key);
|
||||
if (i != obj.MemberEnd()) {
|
||||
return i->value;
|
||||
@@ -91,6 +104,8 @@ const rapidjson::Value &xmrig::Json::getValue(const rapidjson::Value &obj, const
|
||||
|
||||
int xmrig::Json::getInt(const rapidjson::Value &obj, const char *key, int defaultValue)
|
||||
{
|
||||
assert(obj.IsObject());
|
||||
|
||||
auto i = obj.FindMember(key);
|
||||
if (i != obj.MemberEnd() && i->value.IsInt()) {
|
||||
return i->value.GetInt();
|
||||
@@ -102,6 +117,8 @@ int xmrig::Json::getInt(const rapidjson::Value &obj, const char *key, int defaul
|
||||
|
||||
int64_t xmrig::Json::getInt64(const rapidjson::Value &obj, const char *key, int64_t defaultValue)
|
||||
{
|
||||
assert(obj.IsObject());
|
||||
|
||||
auto i = obj.FindMember(key);
|
||||
if (i != obj.MemberEnd() && i->value.IsInt64()) {
|
||||
return i->value.GetInt64();
|
||||
@@ -113,6 +130,8 @@ int64_t xmrig::Json::getInt64(const rapidjson::Value &obj, const char *key, int6
|
||||
|
||||
uint64_t xmrig::Json::getUint64(const rapidjson::Value &obj, const char *key, uint64_t defaultValue)
|
||||
{
|
||||
assert(obj.IsObject());
|
||||
|
||||
auto i = obj.FindMember(key);
|
||||
if (i != obj.MemberEnd() && i->value.IsUint64()) {
|
||||
return i->value.GetUint64();
|
||||
@@ -124,6 +143,8 @@ uint64_t xmrig::Json::getUint64(const rapidjson::Value &obj, const char *key, ui
|
||||
|
||||
unsigned xmrig::Json::getUint(const rapidjson::Value &obj, const char *key, unsigned defaultValue)
|
||||
{
|
||||
assert(obj.IsObject());
|
||||
|
||||
auto i = obj.FindMember(key);
|
||||
if (i != obj.MemberEnd() && i->value.IsUint()) {
|
||||
return i->value.GetUint();
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cstdio>
|
||||
|
||||
|
||||
#include "base/tools/Handle.h"
|
||||
@@ -32,9 +32,13 @@
|
||||
#include "base/io/log/Log.h"
|
||||
|
||||
|
||||
xmrig::ConsoleLog::ConsoleLog() :
|
||||
m_stream(nullptr)
|
||||
xmrig::ConsoleLog::ConsoleLog()
|
||||
{
|
||||
if (!isSupported()) {
|
||||
Log::colors = false;
|
||||
return;
|
||||
}
|
||||
|
||||
m_tty = new uv_tty_t;
|
||||
|
||||
if (uv_tty_init(uv_default_loop(), m_tty, 1, 0) < 0) {
|
||||
@@ -66,7 +70,7 @@ xmrig::ConsoleLog::~ConsoleLog()
|
||||
|
||||
void xmrig::ConsoleLog::print(int, const char *line, size_t, size_t size, bool colors)
|
||||
{
|
||||
if (Log::colors != colors) {
|
||||
if (!m_tty || Log::colors != colors) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -86,12 +90,18 @@ void xmrig::ConsoleLog::print(int, const char *line, size_t, size_t size, bool c
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::ConsoleLog::isSupported() const
|
||||
{
|
||||
const uv_handle_type type = uv_guess_handle(1);
|
||||
return type == UV_TTY || type == UV_NAMED_PIPE;
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::ConsoleLog::isWritable() const
|
||||
{
|
||||
if (!m_stream || uv_is_writable(m_stream) != 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const uv_handle_type type = uv_guess_handle(1);
|
||||
return type == UV_TTY || type == UV_NAMED_PIPE;
|
||||
return isSupported();
|
||||
}
|
||||
|
||||
@@ -27,11 +27,12 @@
|
||||
#define XMRIG_CONSOLELOG_H
|
||||
|
||||
|
||||
typedef struct uv_stream_s uv_stream_t;
|
||||
typedef struct uv_tty_s uv_tty_t;
|
||||
using uv_stream_t = struct uv_stream_s;
|
||||
using uv_tty_t = struct uv_tty_s;
|
||||
|
||||
|
||||
#include "base/kernel/interfaces/ILogBackend.h"
|
||||
#include "base/tools/Object.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
@@ -40,6 +41,8 @@ namespace xmrig {
|
||||
class ConsoleLog : public ILogBackend
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE(ConsoleLog)
|
||||
|
||||
ConsoleLog();
|
||||
~ConsoleLog() override;
|
||||
|
||||
@@ -47,10 +50,11 @@ protected:
|
||||
void print(int level, const char *line, size_t offset, size_t size, bool colors) override;
|
||||
|
||||
private:
|
||||
bool isSupported() const;
|
||||
bool isWritable() const;
|
||||
|
||||
uv_stream_t *m_stream;
|
||||
uv_tty_t *m_tty;
|
||||
uv_stream_t *m_stream = nullptr;
|
||||
uv_tty_t *m_tty = nullptr;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -64,15 +64,16 @@ static const char *kConfigPathV2 = "/2/config";
|
||||
#endif
|
||||
|
||||
|
||||
class xmrig::BasePrivate
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
class BasePrivate
|
||||
{
|
||||
public:
|
||||
inline BasePrivate(Process *process) :
|
||||
api(nullptr),
|
||||
config(nullptr),
|
||||
process(process),
|
||||
watcher(nullptr)
|
||||
{}
|
||||
XMRIG_DISABLE_COPY_MOVE_DEFAULT(BasePrivate)
|
||||
|
||||
|
||||
inline BasePrivate(Process *process) : config(load(process)) {}
|
||||
|
||||
|
||||
inline ~BasePrivate()
|
||||
@@ -94,13 +95,33 @@ public:
|
||||
}
|
||||
|
||||
|
||||
inline Config *load()
|
||||
inline void replace(Config *newConfig)
|
||||
{
|
||||
Config *previousConfig = config;
|
||||
config = newConfig;
|
||||
|
||||
for (IBaseListener *listener : listeners) {
|
||||
listener->onConfigChanged(config, previousConfig);
|
||||
}
|
||||
|
||||
delete previousConfig;
|
||||
}
|
||||
|
||||
|
||||
Api *api = nullptr;
|
||||
Config *config = nullptr;
|
||||
std::vector<IBaseListener *> listeners;
|
||||
Watcher *watcher = nullptr;
|
||||
|
||||
|
||||
private:
|
||||
inline Config *load(Process *process)
|
||||
{
|
||||
JsonChain chain;
|
||||
ConfigTransform transform;
|
||||
std::unique_ptr<Config> config;
|
||||
|
||||
transform.load(chain, process, transform);
|
||||
ConfigTransform::load(chain, process, transform);
|
||||
|
||||
if (read(chain, config)) {
|
||||
return config.release();
|
||||
@@ -122,29 +143,12 @@ public:
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
inline void replace(Config *newConfig)
|
||||
{
|
||||
Config *previousConfig = config;
|
||||
config = newConfig;
|
||||
|
||||
for (IBaseListener *listener : listeners) {
|
||||
listener->onConfigChanged(config, previousConfig);
|
||||
}
|
||||
|
||||
delete previousConfig;
|
||||
}
|
||||
|
||||
|
||||
Api *api;
|
||||
Config *config;
|
||||
Process *process;
|
||||
std::vector<IBaseListener *> listeners;
|
||||
Watcher *watcher;
|
||||
};
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
xmrig::Base::Base(Process *process)
|
||||
: d_ptr(new BasePrivate(process))
|
||||
{
|
||||
@@ -165,14 +169,6 @@ bool xmrig::Base::isReady() const
|
||||
|
||||
int xmrig::Base::init()
|
||||
{
|
||||
d_ptr->config = d_ptr->load();
|
||||
|
||||
if (!d_ptr->config) {
|
||||
LOG_EMERG("No valid configuration found. Exiting.");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
# ifdef XMRIG_FEATURE_API
|
||||
d_ptr->api = new Api(this);
|
||||
d_ptr->api->addListener(this);
|
||||
@@ -184,7 +180,7 @@ int xmrig::Base::init()
|
||||
Platform::setProcessPriority(config()->cpu().priority());
|
||||
# endif
|
||||
|
||||
if (config()->isBackground()) {
|
||||
if (isBackground()) {
|
||||
Log::background = true;
|
||||
}
|
||||
else {
|
||||
@@ -240,6 +236,12 @@ xmrig::Api *xmrig::Base::api() const
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::Base::isBackground() const
|
||||
{
|
||||
return d_ptr->config && d_ptr->config->isBackground();
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::Base::reload(const rapidjson::Value &json)
|
||||
{
|
||||
JsonReader reader(json);
|
||||
@@ -247,7 +249,7 @@ bool xmrig::Base::reload(const rapidjson::Value &json)
|
||||
return false;
|
||||
}
|
||||
|
||||
Config *config = new Config();
|
||||
auto config = new Config();
|
||||
if (!config->read(reader, d_ptr->config->fileName())) {
|
||||
delete config;
|
||||
|
||||
@@ -289,7 +291,7 @@ void xmrig::Base::onFileChanged(const String &fileName)
|
||||
JsonChain chain;
|
||||
chain.addFile(fileName);
|
||||
|
||||
Config *config = new Config();
|
||||
auto config = new Config();
|
||||
|
||||
if (!config->read(chain, chain.fileName())) {
|
||||
LOG_ERR("reloading failed");
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "base/api/interfaces/IApiListener.h"
|
||||
#include "base/kernel/interfaces/IConfigListener.h"
|
||||
#include "base/kernel/interfaces/IWatcherListener.h"
|
||||
#include "base/tools/Object.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
||||
@@ -45,6 +46,8 @@ class Process;
|
||||
class Base : public IWatcherListener, public IApiListener
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE_DEFAULT(Base)
|
||||
|
||||
Base(Process *process);
|
||||
~Base() override;
|
||||
|
||||
@@ -54,6 +57,7 @@ public:
|
||||
virtual void stop();
|
||||
|
||||
Api *api() const;
|
||||
bool isBackground() const;
|
||||
bool reload(const rapidjson::Value &json);
|
||||
Config *config() const;
|
||||
void addListener(IBaseListener *listener);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cstdio>
|
||||
#include <uv.h>
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ int xmrig::Entry::exec(const Process &process, Id id)
|
||||
{
|
||||
switch (id) {
|
||||
case Usage:
|
||||
printf(usage);
|
||||
printf("%s\n", usage().c_str());
|
||||
return 0;
|
||||
|
||||
case Version:
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <ctime>
|
||||
#include <uv.h>
|
||||
#include <time.h>
|
||||
|
||||
|
||||
#include "base/kernel/Process.h"
|
||||
@@ -55,11 +55,6 @@ xmrig::Process::Process(int argc, char **argv) :
|
||||
}
|
||||
|
||||
|
||||
xmrig::Process::~Process()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
xmrig::String xmrig::Process::location(Location location, const char *fileName) const
|
||||
{
|
||||
constexpr const size_t max = 520;
|
||||
|
||||
@@ -47,7 +47,6 @@ public:
|
||||
# endif
|
||||
|
||||
Process(int argc, char **argv);
|
||||
~Process();
|
||||
|
||||
String location(Location location, const char *fileName = nullptr) const;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cstdio>
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
@@ -47,15 +47,11 @@ namespace xmrig
|
||||
|
||||
static const char *kAlgo = "algo";
|
||||
static const char *kApi = "api";
|
||||
static const char *kCoin = "coin";
|
||||
static const char *kHttp = "http";
|
||||
static const char *kPools = "pools";
|
||||
|
||||
}
|
||||
|
||||
|
||||
xmrig::BaseTransform::BaseTransform()
|
||||
{
|
||||
}
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
void xmrig::BaseTransform::load(JsonChain &chain, Process *process, IConfigTransform &transform)
|
||||
@@ -68,7 +64,7 @@ void xmrig::BaseTransform::load(JsonChain &chain, Process *process, IConfigTrans
|
||||
|
||||
Document doc(kObjectType);
|
||||
|
||||
while (1) {
|
||||
while (true) {
|
||||
key = getopt_long(argc, argv, short_options, options, nullptr);
|
||||
if (key < 0) {
|
||||
break;
|
||||
@@ -107,6 +103,19 @@ void xmrig::BaseTransform::finalize(rapidjson::Document &doc)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_coin.isValid() && doc.HasMember(kPools)) {
|
||||
auto &pools = doc[kPools];
|
||||
for (Value &pool : pools.GetArray()) {
|
||||
if (!pool.HasMember(kCoin)) {
|
||||
pool.AddMember(StringRef(kCoin), m_coin.toJSON(), allocator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_http) {
|
||||
set(doc, kHttp, "enabled", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,6 +131,15 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
|
||||
}
|
||||
break;
|
||||
|
||||
case IConfig::CoinKey: /* --coin */
|
||||
if (!doc.HasMember(kPools)) {
|
||||
m_coin = arg;
|
||||
}
|
||||
else {
|
||||
return add(doc, kPools, kCoin, arg);
|
||||
}
|
||||
break;
|
||||
|
||||
case IConfig::UserpassKey: /* --userpass */
|
||||
{
|
||||
const char *p = strrchr(arg, ':');
|
||||
@@ -169,9 +187,11 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
|
||||
return set(doc, "log-file", arg);
|
||||
|
||||
case IConfig::HttpAccessTokenKey: /* --http-access-token */
|
||||
m_http = true;
|
||||
return set(doc, kHttp, "access-token", arg);
|
||||
|
||||
case IConfig::HttpHostKey: /* --http-host */
|
||||
m_http = true;
|
||||
return set(doc, kHttp, "host", arg);
|
||||
|
||||
case IConfig::ApiWorkerIdKey: /* --api-worker-id */
|
||||
@@ -226,8 +246,10 @@ void xmrig::BaseTransform::transformBoolean(rapidjson::Document &doc, int key, b
|
||||
case IConfig::TlsKey: /* --tls */
|
||||
return add(doc, kPools, "tls", enable);
|
||||
|
||||
# ifdef XMRIG_FEATURE_HTTP
|
||||
case IConfig::DaemonKey: /* --daemon */
|
||||
return add(doc, kPools, "daemon", enable);
|
||||
# endif
|
||||
|
||||
# ifndef XMRIG_PROXY_PROJECT
|
||||
case IConfig::NicehashKey: /* --nicehash */
|
||||
@@ -238,10 +260,12 @@ void xmrig::BaseTransform::transformBoolean(rapidjson::Document &doc, int key, b
|
||||
return set(doc, "colors", enable);
|
||||
|
||||
case IConfig::HttpRestrictedKey: /* --http-no-restricted */
|
||||
m_http = true;
|
||||
return set(doc, kHttp, "restricted", enable);
|
||||
|
||||
case IConfig::HttpEnabledKey: /* --http-enabled */
|
||||
return set(doc, kHttp, "enabled", enable);
|
||||
m_http = true;
|
||||
break;
|
||||
|
||||
case IConfig::DryRunKey: /* --dry-run */
|
||||
return set(doc, "dry-run", enable);
|
||||
@@ -268,13 +292,16 @@ void xmrig::BaseTransform::transformUint64(rapidjson::Document &doc, int key, ui
|
||||
return set(doc, "donate-over-proxy", arg);
|
||||
|
||||
case IConfig::HttpPort: /* --http-port */
|
||||
m_http = true;
|
||||
return set(doc, kHttp, "port", arg);
|
||||
|
||||
case IConfig::PrintTimeKey: /* --print-time */
|
||||
return set(doc, "print-time", arg);
|
||||
|
||||
# ifdef XMRIG_FEATURE_HTTP
|
||||
case IConfig::DaemonPollKey: /* --daemon-poll-interval */
|
||||
return add(doc, kPools, "daemon-poll-interval", arg);
|
||||
# endif
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
|
||||
#include "base/kernel/interfaces/IConfigTransform.h"
|
||||
#include "crypto/common/Coin.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
@@ -44,8 +45,6 @@ class Process;
|
||||
class BaseTransform : public IConfigTransform
|
||||
{
|
||||
public:
|
||||
BaseTransform();
|
||||
|
||||
static void load(JsonChain &chain, Process *process, IConfigTransform &transform);
|
||||
|
||||
protected:
|
||||
@@ -99,11 +98,14 @@ protected:
|
||||
|
||||
protected:
|
||||
Algorithm m_algorithm;
|
||||
Coin m_coin;
|
||||
|
||||
|
||||
private:
|
||||
void transformBoolean(rapidjson::Document &doc, int key, bool enable);
|
||||
void transformUint64(rapidjson::Document &doc, int key, uint64_t arg);
|
||||
|
||||
bool m_http = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ public:
|
||||
enum Keys {
|
||||
// common
|
||||
AlgorithmKey = 'a',
|
||||
CoinKey = 1025,
|
||||
ApiWorkerIdKey = 4002,
|
||||
ApiIdKey = 4005,
|
||||
HttpPort = 4100,
|
||||
@@ -78,6 +79,7 @@ public:
|
||||
PrintTimeKey = 1007,
|
||||
|
||||
// xmrig cpu
|
||||
CPUKey = 1024,
|
||||
AVKey = 'v',
|
||||
CPUAffinityKey = 1020,
|
||||
DryRunKey = 5000,
|
||||
@@ -86,6 +88,7 @@ public:
|
||||
AssemblyKey = 1015,
|
||||
RandomXInitKey = 1022,
|
||||
RandomXNumaKey = 1023,
|
||||
CPUMaxThreadsKey = 1026,
|
||||
|
||||
// xmrig amd
|
||||
OclPlatformKey = 1400,
|
||||
@@ -99,6 +102,7 @@ public:
|
||||
OclMemChunkKey = 1408,
|
||||
OclUnrollKey = 1409,
|
||||
OclCompModeKey = 1410,
|
||||
OclKey = 1411,
|
||||
|
||||
// xmrig-proxy
|
||||
AccessLogFileKey = 'A',
|
||||
|
||||
@@ -334,6 +334,9 @@ bool xmrig::Client::parseJob(const rapidjson::Value ¶ms, int *code)
|
||||
if (algo) {
|
||||
job.setAlgorithm(algo);
|
||||
}
|
||||
else if (m_pool.coin().isValid()) {
|
||||
job.setAlgorithm(m_pool.coin().algorithm(job.blob()[0]));
|
||||
}
|
||||
|
||||
job.setHeight(Json::getUint64(params, "height"));
|
||||
|
||||
@@ -426,7 +429,12 @@ bool xmrig::Client::verifyAlgorithm(const Algorithm &algorithm, const char *algo
|
||||
{
|
||||
if (!algorithm.isValid()) {
|
||||
if (!isQuiet()) {
|
||||
LOG_ERR("[%s] Unknown/unsupported algorithm \"%s\" detected, reconnect", url(), algo);
|
||||
if (algo == nullptr) {
|
||||
LOG_ERR("[%s] unknown algorithm, make sure you set \"algo\" or \"coin\" option", url(), algo);
|
||||
}
|
||||
else {
|
||||
LOG_ERR("[%s] unsupported algorithm \"%s\" detected, reconnect", url(), algo);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -436,7 +444,7 @@ bool xmrig::Client::verifyAlgorithm(const Algorithm &algorithm, const char *algo
|
||||
m_listener->onVerifyAlgorithm(this, algorithm, &ok);
|
||||
|
||||
if (!ok && !isQuiet()) {
|
||||
LOG_ERR("[%s] Incompatible/disabled algorithm \"%s\" detected, reconnect", url(), algorithm.shortName());
|
||||
LOG_ERR("[%s] incompatible/disabled algorithm \"%s\" detected, reconnect", url(), algorithm.shortName());
|
||||
}
|
||||
|
||||
return ok;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
#include "3rdparty/http-parser/http_parser.h"
|
||||
@@ -225,6 +225,10 @@ bool xmrig::DaemonClient::parseJob(const rapidjson::Value ¶ms, int *code)
|
||||
job.setDiff(Json::getUint64(params, "difficulty"));
|
||||
job.setId(blocktemplate.data() + blocktemplate.size() - 32);
|
||||
|
||||
if (m_pool.coin().isValid()) {
|
||||
job.setAlgorithm(m_pool.coin().algorithm(job.blob()[0]));
|
||||
}
|
||||
|
||||
m_job = std::move(job);
|
||||
m_blocktemplate = std::move(blocktemplate);
|
||||
m_prevHash = Json::getString(params, "prev_hash");
|
||||
|
||||
@@ -75,6 +75,7 @@ public:
|
||||
inline uint8_t fixedByte() const { return *(m_blob + 42); }
|
||||
inline uint8_t index() const { return m_index; }
|
||||
inline void reset() { m_size = 0; m_diff = 0; }
|
||||
inline void setAlgorithm(const Algorithm::Id id) { m_algorithm = id; }
|
||||
inline void setAlgorithm(const char *algo) { m_algorithm = algo; }
|
||||
inline void setClientId(const String &id) { m_clientId = id; }
|
||||
inline void setHeight(uint64_t height) { m_height = height; }
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
namespace xmrig {
|
||||
|
||||
static const char *kAlgo = "algo";
|
||||
static const char *kCoin = "coin";
|
||||
static const char *kDaemon = "daemon";
|
||||
static const char *kDaemonPollInterval = "daemon-poll-interval";
|
||||
static const char *kEnabled = "enabled";
|
||||
@@ -120,6 +121,7 @@ xmrig::Pool::Pool(const rapidjson::Value &object) :
|
||||
m_fingerprint = Json::getString(object, kFingerprint);
|
||||
m_pollInterval = Json::getUint64(object, kDaemonPollInterval, kDefaultPollInterval);
|
||||
m_algorithm = Json::getString(object, kAlgo);
|
||||
m_coin = Json::getString(object, kCoin);
|
||||
|
||||
m_flags.set(FLAG_ENABLED, Json::getBool(object, kEnabled, true));
|
||||
m_flags.set(FLAG_NICEHASH, Json::getBool(object, kNicehash));
|
||||
@@ -172,7 +174,7 @@ bool xmrig::Pool::isEnabled() const
|
||||
}
|
||||
# endif
|
||||
|
||||
if (isDaemon() && !algorithm().isValid()) {
|
||||
if (isDaemon() && (!algorithm().isValid() && !coin().isValid())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -186,6 +188,7 @@ bool xmrig::Pool::isEqual(const Pool &other) const
|
||||
&& m_keepAlive == other.m_keepAlive
|
||||
&& m_port == other.m_port
|
||||
&& m_algorithm == other.m_algorithm
|
||||
&& m_coin == other.m_coin
|
||||
&& m_fingerprint == other.m_fingerprint
|
||||
&& m_host == other.m_host
|
||||
&& m_password == other.m_password
|
||||
@@ -268,6 +271,7 @@ rapidjson::Value xmrig::Pool::toJSON(rapidjson::Document &doc) const
|
||||
Value obj(kObjectType);
|
||||
|
||||
obj.AddMember(StringRef(kAlgo), m_algorithm.toJSON(), allocator);
|
||||
obj.AddMember(StringRef(kCoin), m_coin.toJSON(), allocator);
|
||||
obj.AddMember(StringRef(kUrl), m_url.toJSON(), allocator);
|
||||
obj.AddMember(StringRef(kUser), m_user.toJSON(), allocator);
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
#include "base/tools/String.h"
|
||||
#include "crypto/common/Algorithm.h"
|
||||
#include "crypto/common/Coin.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ public:
|
||||
inline bool isTLS() const { return m_flags.test(FLAG_TLS); }
|
||||
inline bool isValid() const { return !m_host.isNull() && m_port > 0; }
|
||||
inline const Algorithm &algorithm() const { return m_algorithm; }
|
||||
inline const Coin &coin() const { return m_coin; }
|
||||
inline const String &fingerprint() const { return m_fingerprint; }
|
||||
inline const String &host() const { return m_host; }
|
||||
inline const String &password() const { return !m_password.isNull() ? m_password : kDefaultPassword; }
|
||||
@@ -107,6 +108,7 @@ private:
|
||||
bool parseIPv6(const char *addr);
|
||||
|
||||
Algorithm m_algorithm;
|
||||
Coin m_coin;
|
||||
int m_keepAlive;
|
||||
std::bitset<FLAG_MAX> m_flags;
|
||||
String m_fingerprint;
|
||||
|
||||
@@ -135,11 +135,12 @@ void xmrig::Pools::print() const
|
||||
{
|
||||
size_t i = 1;
|
||||
for (const Pool &pool : m_data) {
|
||||
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("POOL #%-7zu") CSI "1;%dm%s" CLEAR " algo " WHITE_BOLD("%s"),
|
||||
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("POOL #%-7zu") CSI "1;%dm%s" CLEAR " %s " WHITE_BOLD("%s"),
|
||||
i,
|
||||
(pool.isEnabled() ? (pool.isTLS() ? 32 : 36) : 31),
|
||||
pool.url().data(),
|
||||
pool.algorithm().isValid() ? pool.algorithm().shortName() : "auto"
|
||||
pool.coin().isValid() ? "coin" : "algo",
|
||||
pool.coin().isValid() ? pool.coin().name() : (pool.algorithm().isValid() ? pool.algorithm().shortName() : "auto")
|
||||
);
|
||||
|
||||
i++;
|
||||
|
||||
@@ -23,13 +23,14 @@
|
||||
"huge-pages": true,
|
||||
"hw-aes": null,
|
||||
"priority": null,
|
||||
"max-threads-hint": 100,
|
||||
"asm": true,
|
||||
"argon2-impl": null,
|
||||
"cn/0": false,
|
||||
"cn-lite/0": false
|
||||
},
|
||||
"opencl": {
|
||||
"enabled": true,
|
||||
"enabled": false,
|
||||
"cache": true,
|
||||
"loader": null,
|
||||
"platform": "AMD",
|
||||
@@ -42,6 +43,7 @@
|
||||
"pools": [
|
||||
{
|
||||
"algo": null,
|
||||
"coin": null,
|
||||
"url": "donate.v2.xmrig.com:3333",
|
||||
"user": "YOUR_WALLET_ADDRESS",
|
||||
"pass": "x",
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
#include "backend/cpu/Cpu.h"
|
||||
@@ -44,20 +44,9 @@ xmrig::Controller::~Controller()
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::Controller::isReady() const
|
||||
{
|
||||
return Base::isReady() && m_network;
|
||||
}
|
||||
|
||||
|
||||
int xmrig::Controller::init()
|
||||
{
|
||||
Cpu::init();
|
||||
|
||||
const int rc = Base::init();
|
||||
if (rc != 0) {
|
||||
return rc;
|
||||
}
|
||||
Base::init();
|
||||
|
||||
m_network = new Network(this);
|
||||
return 0;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
|
||||
#include "base/kernel/Base.h"
|
||||
#include "base/tools/Object.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
@@ -40,10 +41,11 @@ class Network;
|
||||
class Controller : public Base
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE_DEFAULT(Controller)
|
||||
|
||||
Controller(Process *process);
|
||||
~Controller() override;
|
||||
|
||||
bool isReady() const override;
|
||||
int init() override;
|
||||
void start() override;
|
||||
void stop() override;
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
bool isEnabled(const Algorithm &algorithm) const
|
||||
{
|
||||
for (IBackend *backend : backends) {
|
||||
if (backend->isEnabled(algorithm)) {
|
||||
if (backend->isEnabled() && backend->isEnabled(algorithm)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,11 +35,16 @@ namespace xmrig
|
||||
static const char *kAffinity = "affinity";
|
||||
static const char *kAsterisk = "*";
|
||||
static const char *kCpu = "cpu";
|
||||
static const char *kEnabled = "enabled";
|
||||
static const char *kIntensity = "intensity";
|
||||
static const char *kThreads = "threads";
|
||||
|
||||
#ifdef XMRIG_ALGO_RANDOMX
|
||||
static const char *kRandomX = "randomx";
|
||||
static const char *kRandomX = "randomx";
|
||||
#endif
|
||||
|
||||
#ifdef XMRIG_FEATURE_OPENCL
|
||||
static const char *kOcl = "opencl";
|
||||
#endif
|
||||
|
||||
|
||||
@@ -80,12 +85,7 @@ static inline bool isHwAes(uint64_t av)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
xmrig::ConfigTransform::ConfigTransform() : BaseTransform()
|
||||
{
|
||||
}
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
void xmrig::ConfigTransform::finalize(rapidjson::Document &doc)
|
||||
@@ -109,6 +109,12 @@ void xmrig::ConfigTransform::finalize(rapidjson::Document &doc)
|
||||
|
||||
doc[kCpu].AddMember(StringRef(kAsterisk), profile, doc.GetAllocator());
|
||||
}
|
||||
|
||||
# ifdef XMRIG_FEATURE_OPENCL
|
||||
if (m_opencl) {
|
||||
set(doc, kOcl, kEnabled, true);
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
@@ -123,6 +129,7 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
|
||||
return transformUint64(doc, key, static_cast<uint64_t>(strtol(arg, nullptr, 10)));
|
||||
|
||||
case IConfig::HugePagesKey: /* --no-huge-pages */
|
||||
case IConfig::CPUKey: /* --no-cpu */
|
||||
return transformBoolean(doc, key, false);
|
||||
|
||||
case IConfig::CPUAffinityKey: /* --cpu-affinity */
|
||||
@@ -131,7 +138,10 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
|
||||
return transformUint64(doc, key, p ? strtoull(p, nullptr, 16) : strtoull(arg, nullptr, 10));
|
||||
}
|
||||
|
||||
# ifndef XMRIG_NO_ASM
|
||||
case IConfig::CPUMaxThreadsKey: /* --cpu-max-threads-hint */
|
||||
return set(doc, kCpu, "max-threads-hint", static_cast<uint64_t>(strtol(arg, nullptr, 10)));
|
||||
|
||||
# ifdef XMRIG_FEATURE_ASM
|
||||
case IConfig::AssemblyKey: /* --asm */
|
||||
return set(doc, kCpu, "asm", arg);
|
||||
# endif
|
||||
@@ -144,6 +154,29 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
|
||||
return set(doc, kRandomX, "numa", false);
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_OPENCL
|
||||
case IConfig::OclKey: /* --opencl */
|
||||
m_opencl = true;
|
||||
break;
|
||||
|
||||
case IConfig::OclCacheKey: /* --opencl-no-cache */
|
||||
return set(doc, kOcl, "cache", false);
|
||||
|
||||
case IConfig::OclLoaderKey: /* --opencl-loader */
|
||||
return set(doc, kOcl, "loader", arg);
|
||||
|
||||
case IConfig::OclDevicesKey: /* --opencl-devices */
|
||||
m_opencl = true;
|
||||
return set(doc, kOcl, "devices-hint", arg);
|
||||
|
||||
case IConfig::OclPlatformKey: /* --opencl-platform */
|
||||
if (strlen(arg) < 3) {
|
||||
return set(doc, kOcl, "platform", static_cast<uint64_t>(strtol(arg, nullptr, 10)));
|
||||
}
|
||||
|
||||
return set(doc, kOcl, "platform", arg);
|
||||
# endif
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -156,6 +189,9 @@ void xmrig::ConfigTransform::transformBoolean(rapidjson::Document &doc, int key,
|
||||
case IConfig::HugePagesKey: /* --no-huge-pages */
|
||||
return set(doc, kCpu, "huge-pages", enable);
|
||||
|
||||
case IConfig::CPUKey: /* --no-cpu */
|
||||
return set(doc, kCpu, kEnabled, enable);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -34,9 +34,6 @@ namespace xmrig {
|
||||
|
||||
class ConfigTransform : public BaseTransform
|
||||
{
|
||||
public:
|
||||
ConfigTransform();
|
||||
|
||||
protected:
|
||||
void finalize(rapidjson::Document &doc) override;
|
||||
void transform(rapidjson::Document &doc, int key, const char *arg) override;
|
||||
@@ -45,6 +42,7 @@ private:
|
||||
void transformBoolean(rapidjson::Document &doc, int key, bool enable);
|
||||
void transformUint64(rapidjson::Document &doc, int key, uint64_t arg);
|
||||
|
||||
bool m_opencl = false;
|
||||
int64_t m_affinity = -1;
|
||||
uint64_t m_intensity = 1;
|
||||
uint64_t m_threads = 0;
|
||||
|
||||
@@ -57,13 +57,14 @@ R"===(
|
||||
"huge-pages": true,
|
||||
"hw-aes": null,
|
||||
"priority": null,
|
||||
"max-threads-hint": 100,
|
||||
"asm": true,
|
||||
"argon2-impl": null,
|
||||
"cn/0": false,
|
||||
"cn-lite/0": false
|
||||
},
|
||||
"opencl": {
|
||||
"enabled": true,
|
||||
"enabled": false,
|
||||
"cache": true,
|
||||
"loader": null,
|
||||
"platform": "AMD",
|
||||
@@ -76,6 +77,7 @@ R"===(
|
||||
"pools": [
|
||||
{
|
||||
"algo": null,
|
||||
"coin": null,
|
||||
"url": "donate.v2.xmrig.com:3333",
|
||||
"user": "YOUR_WALLET_ADDRESS",
|
||||
"pass": "x",
|
||||
|
||||
@@ -45,6 +45,8 @@ static const char short_options[] = "a:c:kBp:Px:r:R:s:t:T:o:u:O:v:l:S";
|
||||
|
||||
static const option options[] = {
|
||||
{ "algo", 1, nullptr, IConfig::AlgorithmKey },
|
||||
{ "coin", 1, nullptr, IConfig::CoinKey },
|
||||
# ifdef XMRIG_FEATURE_HTTP
|
||||
{ "api-worker-id", 1, nullptr, IConfig::ApiWorkerIdKey },
|
||||
{ "api-id", 1, nullptr, IConfig::ApiIdKey },
|
||||
{ "http-enabled", 0, nullptr, IConfig::HttpEnabledKey },
|
||||
@@ -52,6 +54,9 @@ static const option options[] = {
|
||||
{ "http-access-token", 1, nullptr, IConfig::HttpAccessTokenKey },
|
||||
{ "http-port", 1, nullptr, IConfig::HttpPort },
|
||||
{ "http-no-restricted", 0, nullptr, IConfig::HttpRestrictedKey },
|
||||
{ "daemon", 0, nullptr, IConfig::DaemonKey },
|
||||
{ "daemon-poll-interval", 1, nullptr, IConfig::DaemonPollKey },
|
||||
# endif
|
||||
{ "av", 1, nullptr, IConfig::AVKey },
|
||||
{ "background", 0, nullptr, IConfig::BackgroundKey },
|
||||
{ "config", 1, nullptr, IConfig::ConfigKey },
|
||||
@@ -76,13 +81,27 @@ static const option options[] = {
|
||||
{ "user-agent", 1, nullptr, IConfig::UserAgentKey },
|
||||
{ "userpass", 1, nullptr, IConfig::UserpassKey },
|
||||
{ "rig-id", 1, nullptr, IConfig::RigIdKey },
|
||||
{ "no-cpu", 0, nullptr, IConfig::CPUKey },
|
||||
{ "max-cpu-usage", 1, nullptr, IConfig::CPUMaxThreadsKey },
|
||||
{ "cpu-max-threads-hint", 1, nullptr, IConfig::CPUMaxThreadsKey },
|
||||
# ifdef XMRIG_FEATURE_TLS
|
||||
{ "tls", 0, nullptr, IConfig::TlsKey },
|
||||
{ "tls-fingerprint", 1, nullptr, IConfig::FingerprintKey },
|
||||
# endif
|
||||
# ifdef XMRIG_FEATURE_ASM
|
||||
{ "asm", 1, nullptr, IConfig::AssemblyKey },
|
||||
{ "daemon", 0, nullptr, IConfig::DaemonKey },
|
||||
{ "daemon-poll-interval", 1, nullptr, IConfig::DaemonPollKey },
|
||||
# endif
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
{ "randomx-init", 1, nullptr, IConfig::RandomXInitKey },
|
||||
{ "randomx-no-numa", 0, nullptr, IConfig::RandomXNumaKey },
|
||||
# endif
|
||||
# ifdef XMRIG_FEATURE_OPENCL
|
||||
{ "opencl", 0, nullptr, IConfig::OclKey },
|
||||
{ "opencl-devices", 1, nullptr, IConfig::OclDevicesKey },
|
||||
{ "opencl-platform", 1, nullptr, IConfig::OclPlatformKey },
|
||||
{ "opencl-loader", 1, nullptr, IConfig::OclLoaderKey },
|
||||
{ "opencl-no-cache", 0, nullptr, IConfig::OclCacheKey },
|
||||
# endif
|
||||
{ nullptr, 0, nullptr, 0 }
|
||||
};
|
||||
|
||||
|
||||
@@ -29,99 +29,106 @@
|
||||
#include "version.h"
|
||||
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
static char const usage[] = "\
|
||||
Usage: " APP_ID " [OPTIONS]\n\
|
||||
Options:\n\
|
||||
-a, --algo=ALGO specify the algorithm to use\n\
|
||||
cn/r, cn/2, cn/1, cn/0, cn/double, cn/half, cn/fast,\n\
|
||||
cn/rwz, cn/zls, cn/xao, cn/rto"
|
||||
#ifdef XMRIG_ALGO_CN_GPU
|
||||
", cn/gpu,\n"
|
||||
#else
|
||||
",\n"
|
||||
#endif
|
||||
#ifdef XMRIG_ALGO_CN_LITE
|
||||
"\
|
||||
cn-lite/1,\n"
|
||||
#endif
|
||||
#ifdef XMRIG_ALGO_CN_HEAVY
|
||||
"\
|
||||
cn-heavy/xhv, cn-heavy/tube, cn-heavy/0,\n"
|
||||
#endif
|
||||
#ifdef XMRIG_ALGO_CN_PICO
|
||||
"\
|
||||
cn-pico,\n"
|
||||
#endif
|
||||
#ifdef XMRIG_ALGO_RANDOMX
|
||||
"\
|
||||
rx/wow, rx/loki\n"
|
||||
#endif
|
||||
"\
|
||||
-o, --url=URL URL of mining server\n\
|
||||
-O, --userpass=U:P username:password pair for mining server\n\
|
||||
-u, --user=USERNAME username for mining server\n\
|
||||
-p, --pass=PASSWORD password for mining server\n\
|
||||
--rig-id=ID rig identifier for pool-side statistics (needs pool support)\n\
|
||||
-t, --threads=N number of miner threads\n\
|
||||
-v, --av=N algorithm variation, 0 auto select\n\
|
||||
-k, --keepalive send keepalived packet for prevent timeout (needs pool support)\n\
|
||||
--nicehash enable nicehash.com support\n"
|
||||
#ifdef XMRIG_FEATURE_TLS
|
||||
"\
|
||||
--tls enable SSL/TLS support (needs pool support)\n\
|
||||
--tls-fingerprint=F pool TLS certificate fingerprint, if set enable strict certificate pinning\n"
|
||||
#endif
|
||||
#ifdef XMRIG_FEATURE_HTTP
|
||||
"\
|
||||
--daemon use daemon RPC instead of pool for solo mining\n\
|
||||
--daemon-poll-interval=N daemon poll interval in milliseconds (default: 1000)\n"
|
||||
#endif
|
||||
"\
|
||||
-r, --retries=N number of times to retry before switch to backup server (default: 5)\n\
|
||||
-R, --retry-pause=N time to pause between retries (default: 5)\n\
|
||||
--cpu-affinity set process affinity to CPU core(s), mask 0x3 for cores 0 and 1\n\
|
||||
--cpu-priority set process priority (0 idle, 2 normal to 5 highest)\n\
|
||||
--no-huge-pages disable huge pages support\n\
|
||||
--no-color disable colored output\n\
|
||||
--donate-level=N donate level, default 5%% (5 minutes in 100 minutes)\n\
|
||||
--user-agent set custom user-agent string for pool\n\
|
||||
-B, --background run the miner in the background\n\
|
||||
-c, --config=FILE load a JSON-format configuration file\n\
|
||||
-l, --log-file=FILE log all output to a file\n"
|
||||
# ifdef HAVE_SYSLOG_H
|
||||
"\
|
||||
-S, --syslog use system log for output messages\n"
|
||||
# endif
|
||||
"\
|
||||
--asm=ASM ASM optimizations, possible values: auto, none, intel, ryzen, bulldozer.\n\
|
||||
--print-time=N print hashrate report every N seconds\n"
|
||||
#ifdef XMRIG_FEATURE_HTTP
|
||||
"\
|
||||
--api-worker-id=ID custom worker-id for API\n\
|
||||
--api-id=ID custom instance ID for API\n\
|
||||
--http-enabled enable HTTP API\n\
|
||||
--http-host=HOST bind host for HTTP API (default: 127.0.0.1)\n\
|
||||
--http-port=N bind port for HTTP API\n\
|
||||
--http-access-token=T access token for HTTP API\n\
|
||||
--http-no-restricted enable full remote access to HTTP API (only if access token set)\n"
|
||||
#endif
|
||||
#ifdef XMRIG_ALGO_RANDOMX
|
||||
"\
|
||||
--randomx-init=N threads count to initialize RandomX dataset\n\
|
||||
--randomx-no-numa disable NUMA support for RandomX\n"
|
||||
#endif
|
||||
#ifdef XMRIG_FEATURE_HWLOC
|
||||
"\
|
||||
--export-topology export hwloc topology to a XML file and exit\n"
|
||||
#endif
|
||||
"\
|
||||
--dry-run test configuration and exit\n\
|
||||
-h, --help display this help and exit\n\
|
||||
-V, --version output version information and exit\n\
|
||||
";
|
||||
static inline const std::string &usage()
|
||||
{
|
||||
static std::string u;
|
||||
|
||||
if (!u.empty()) {
|
||||
return u;
|
||||
}
|
||||
|
||||
u += "Usage: " APP_ID " [OPTIONS]\n\nNetwork:\n";
|
||||
u += " -o, --url=URL URL of mining server\n";
|
||||
u += " -a, --algo=ALGO mining algorithm https://xmrig.com/docs/algorithms\n";
|
||||
u += " -u, --user=USERNAME username for mining server\n";
|
||||
u += " -p, --pass=PASSWORD password for mining server\n";
|
||||
u += " -O, --userpass=U:P username:password pair for mining server\n";
|
||||
u += " -k, --keepalive send keepalived packet for prevent timeout (needs pool support)\n";
|
||||
u += " --nicehash enable nicehash.com support\n";
|
||||
u += " --rig-id=ID rig identifier for pool-side statistics (needs pool support)\n";
|
||||
|
||||
# ifdef XMRIG_FEATURE_TLS
|
||||
u += " --tls enable SSL/TLS support (needs pool support)\n";
|
||||
u += " --tls-fingerprint=HEX pool TLS certificate fingerprint for strict certificate pinning\n";
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_HTTP
|
||||
u += " --daemon use daemon RPC instead of pool for solo mining\n";
|
||||
u += " --daemon-poll-interval=N daemon poll interval in milliseconds (default: 1000)\n";
|
||||
# endif
|
||||
|
||||
u += " -r, --retries=N number of times to retry before switch to backup server (default: 5)\n";
|
||||
u += " -R, --retry-pause=N time to pause between retries (default: 5)\n";
|
||||
u += " --user-agent set custom user-agent string for pool\n";
|
||||
u += " --donate-level=N donate level, default 5%% (5 minutes in 100 minutes)\n";
|
||||
u += " --donate-over-proxy=N control donate over xmrig-proxy feature\n";
|
||||
|
||||
u += "\nCPU backend:\n";
|
||||
|
||||
u += " --no-cpu disable CPU mining backend\n";
|
||||
u += " -t, --threads=N number of CPU threads\n";
|
||||
u += " -v, --av=N algorithm variation, 0 auto select\n";
|
||||
u += " --cpu-affinity set process affinity to CPU core(s), mask 0x3 for cores 0 and 1\n";
|
||||
u += " --cpu-priority set process priority (0 idle, 2 normal to 5 highest)\n";
|
||||
u += " --cpu-max-threads-hint=N maximum CPU threads count (in percentage) hint for autoconfig\n";
|
||||
u += " --no-huge-pages disable huge pages support\n";
|
||||
u += " --asm=ASM ASM optimizations, possible values: auto, none, intel, ryzen, bulldozer\n";
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
u += " --randomx-init=N threads count to initialize RandomX dataset\n";
|
||||
u += " --randomx-no-numa disable NUMA support for RandomX\n";
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_HTTP
|
||||
u += "\nAPI:\n";
|
||||
u += " --api-worker-id=ID custom worker-id for API\n";
|
||||
u += " --api-id=ID custom instance ID for API\n";
|
||||
u += " --http-host=HOST bind host for HTTP API (default: 127.0.0.1)\n";
|
||||
u += " --http-port=N bind port for HTTP API\n";
|
||||
u += " --http-access-token=T access token for HTTP API\n";
|
||||
u += " --http-no-restricted enable full remote access to HTTP API (only if access token set)\n";
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_OPENCL
|
||||
u += "\nOpenCL backend:\n";
|
||||
u += " --opencl enable OpenCL mining backend\n";
|
||||
u += " --opencl-devices=N list of OpenCL devices to use\n";
|
||||
u += " --opencl-platform=N OpenCL platform index or name\n";
|
||||
u += " --opencl-loader=N path to OpenCL-ICD-Loader (OpenCL.dll or libOpenCL.so)\n";
|
||||
u += " --opencl-no-cache disable OpenCL cache\n";
|
||||
u += " --print-platforms print available OpenCL platforms and exit\n";
|
||||
# endif
|
||||
|
||||
u += "\nLogging:\n";
|
||||
|
||||
# ifdef HAVE_SYSLOG_H
|
||||
u += " -S, --syslog use system log for output messages\n";
|
||||
# endif
|
||||
|
||||
u += " -l, --log-file=FILE log all output to a file\n";
|
||||
u += " --print-time=N print hashrate report every N seconds\n";
|
||||
u += " --no-color disable colored output\n";
|
||||
|
||||
u += "\nMisc:\n";
|
||||
|
||||
u += " -c, --config=FILE load a JSON-format configuration file\n";
|
||||
u += " -B, --background run the miner in the background\n";
|
||||
u += " -V, --version output version information and exit\n";
|
||||
u += " -h, --help display this help and exit\n";
|
||||
u += " --dry-run test configuration and exit\n";
|
||||
|
||||
# ifdef XMRIG_FEATURE_HWLOC
|
||||
u += " --export-topology export hwloc topology to a XML file and exit\n";
|
||||
# endif
|
||||
|
||||
return u;
|
||||
}
|
||||
|
||||
|
||||
} /* namespace xmrig */
|
||||
|
||||
@@ -103,9 +103,8 @@ static AlgoName const algorithm_names[] = {
|
||||
{ "cryptonight_turtle", "cn_turtle", Algorithm::CN_PICO_0 },
|
||||
# endif
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
{ "randomx/0", "rx/0", Algorithm::RX_0 },
|
||||
{ "randomx/test", "rx/test", Algorithm::RX_0 },
|
||||
{ "randomx/0", "rx/0", Algorithm::RX_0 },
|
||||
{ "randomx/0", "rx/0", Algorithm::RX_0 },
|
||||
{ "RandomX", "rx", Algorithm::RX_0 },
|
||||
{ "randomx/wow", "rx/wow", Algorithm::RX_WOW },
|
||||
{ "RandomWOW", nullptr, Algorithm::RX_WOW },
|
||||
|
||||
103
src/crypto/common/Coin.cpp
Normal file
103
src/crypto/common/Coin.cpp
Normal file
@@ -0,0 +1,103 @@
|
||||
/* XMRig
|
||||
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
|
||||
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
|
||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "crypto/common/Coin.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
#include <cstring>
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define strcasecmp _stricmp
|
||||
#endif
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
struct CoinName
|
||||
{
|
||||
const char *name;
|
||||
const Coin::Id id;
|
||||
};
|
||||
|
||||
|
||||
static CoinName const coin_names[] = {
|
||||
{ "monero", Coin::MONERO },
|
||||
{ "xmr", Coin::MONERO },
|
||||
};
|
||||
|
||||
|
||||
} /* namespace xmrig */
|
||||
|
||||
|
||||
|
||||
xmrig::Algorithm::Id xmrig::Coin::algorithm(uint8_t blobVersion) const
|
||||
{
|
||||
if (id() == MONERO) {
|
||||
return (blobVersion >= 12) ? Algorithm::RX_0 : Algorithm::CN_R;
|
||||
}
|
||||
|
||||
return Algorithm::INVALID;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const char *xmrig::Coin::name() const
|
||||
{
|
||||
for (const auto &i : coin_names) {
|
||||
if (i.id == m_id) {
|
||||
return i.name;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
rapidjson::Value xmrig::Coin::toJSON() const
|
||||
{
|
||||
using namespace rapidjson;
|
||||
|
||||
return isValid() ? Value(StringRef(name())) : Value(kNullType);
|
||||
}
|
||||
|
||||
|
||||
xmrig::Coin::Id xmrig::Coin::parse(const char *name)
|
||||
{
|
||||
if (name == nullptr || strlen(name) < 3) {
|
||||
return INVALID;
|
||||
}
|
||||
|
||||
for (const auto &i : coin_names) {
|
||||
if (strcasecmp(name, i.name) == 0) {
|
||||
return i.id;
|
||||
}
|
||||
}
|
||||
|
||||
return INVALID;
|
||||
}
|
||||
75
src/crypto/common/Coin.h
Normal file
75
src/crypto/common/Coin.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/* XMRig
|
||||
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
|
||||
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
|
||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef XMRIG_COIN_H
|
||||
#define XMRIG_COIN_H
|
||||
|
||||
|
||||
#include "crypto/common/Algorithm.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
class Coin
|
||||
{
|
||||
public:
|
||||
enum Id : int {
|
||||
INVALID = -1,
|
||||
MONERO,
|
||||
};
|
||||
|
||||
|
||||
Coin() = default;
|
||||
inline Coin(const char *name) : m_id(parse(name)) {}
|
||||
inline Coin(Id id) : m_id(id) {}
|
||||
|
||||
|
||||
inline bool isEqual(const Coin &other) const { return m_id == other.m_id; }
|
||||
inline bool isValid() const { return m_id != INVALID; }
|
||||
inline Id id() const { return m_id; }
|
||||
|
||||
Algorithm::Id algorithm(uint8_t blobVersion) const;
|
||||
const char *name() const;
|
||||
rapidjson::Value toJSON() const;
|
||||
|
||||
inline bool operator!=(Coin::Id id) const { return m_id != id; }
|
||||
inline bool operator!=(const Coin &other) const { return !isEqual(other); }
|
||||
inline bool operator==(Coin::Id id) const { return m_id == id; }
|
||||
inline bool operator==(const Coin &other) const { return isEqual(other); }
|
||||
inline operator Coin::Id() const { return m_id; }
|
||||
|
||||
static Id parse(const char *name);
|
||||
|
||||
private:
|
||||
Id m_id = INVALID;
|
||||
};
|
||||
|
||||
|
||||
} /* namespace xmrig */
|
||||
|
||||
|
||||
#endif /* XMRIG_COIN_H */
|
||||
@@ -108,7 +108,7 @@ namespace randomx {
|
||||
class JitCompilerX86;
|
||||
using JitCompiler = JitCompilerX86;
|
||||
#elif defined(__aarch64__)
|
||||
#define RANDOMX_HAVE_COMPILER 0
|
||||
#define RANDOMX_HAVE_COMPILER 1
|
||||
class JitCompilerA64;
|
||||
using JitCompiler = JitCompilerA64;
|
||||
#else
|
||||
|
||||
@@ -376,11 +376,138 @@ FORCE_INLINE rx_vec_f128 rx_cvt_packed_int_vec_f128(const void* addr) {
|
||||
|
||||
#define RANDOMX_DEFAULT_FENV
|
||||
|
||||
void rx_reset_float_state();
|
||||
#elif defined(__aarch64__)
|
||||
|
||||
void rx_set_rounding_mode(uint32_t mode);
|
||||
#include <stdlib.h>
|
||||
#include <arm_neon.h>
|
||||
#include <arm_acle.h>
|
||||
|
||||
#else //end altivec
|
||||
typedef uint8x16_t rx_vec_i128;
|
||||
typedef float64x2_t rx_vec_f128;
|
||||
|
||||
inline void* rx_aligned_alloc(size_t size, size_t align) {
|
||||
void* p;
|
||||
if (posix_memalign(&p, align, size) == 0)
|
||||
return p;
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
#define rx_aligned_free(a) free(a)
|
||||
|
||||
inline void rx_prefetch_nta(void* ptr) {
|
||||
asm volatile ("prfm pldl1strm, [%0]\n" : : "r" (ptr));
|
||||
}
|
||||
|
||||
FORCE_INLINE rx_vec_f128 rx_load_vec_f128(const double* pd) {
|
||||
return vld1q_f64((const float64_t*)pd);
|
||||
}
|
||||
|
||||
FORCE_INLINE void rx_store_vec_f128(double* mem_addr, rx_vec_f128 val) {
|
||||
vst1q_f64((float64_t*)mem_addr, val);
|
||||
}
|
||||
|
||||
FORCE_INLINE rx_vec_f128 rx_swap_vec_f128(rx_vec_f128 a) {
|
||||
float64x2_t temp;
|
||||
temp = vcopyq_laneq_f64(temp, 1, a, 1);
|
||||
a = vcopyq_laneq_f64(a, 1, a, 0);
|
||||
return vcopyq_laneq_f64(a, 0, temp, 1);
|
||||
}
|
||||
|
||||
FORCE_INLINE rx_vec_f128 rx_set_vec_f128(uint64_t x1, uint64_t x0) {
|
||||
uint64x2_t temp0 = vdupq_n_u64(x0);
|
||||
uint64x2_t temp1 = vdupq_n_u64(x1);
|
||||
return vreinterpretq_f64_u64(vcopyq_laneq_u64(temp0, 1, temp1, 0));
|
||||
}
|
||||
|
||||
FORCE_INLINE rx_vec_f128 rx_set1_vec_f128(uint64_t x) {
|
||||
return vreinterpretq_f64_u64(vdupq_n_u64(x));
|
||||
}
|
||||
|
||||
#define rx_add_vec_f128 vaddq_f64
|
||||
#define rx_sub_vec_f128 vsubq_f64
|
||||
#define rx_mul_vec_f128 vmulq_f64
|
||||
#define rx_div_vec_f128 vdivq_f64
|
||||
#define rx_sqrt_vec_f128 vsqrtq_f64
|
||||
|
||||
FORCE_INLINE rx_vec_f128 rx_xor_vec_f128(rx_vec_f128 a, rx_vec_f128 b) {
|
||||
return vreinterpretq_f64_u8(veorq_u8(vreinterpretq_u8_f64(a), vreinterpretq_u8_f64(b)));
|
||||
}
|
||||
|
||||
FORCE_INLINE rx_vec_f128 rx_and_vec_f128(rx_vec_f128 a, rx_vec_f128 b) {
|
||||
return vreinterpretq_f64_u8(vandq_u8(vreinterpretq_u8_f64(a), vreinterpretq_u8_f64(b)));
|
||||
}
|
||||
|
||||
FORCE_INLINE rx_vec_f128 rx_or_vec_f128(rx_vec_f128 a, rx_vec_f128 b) {
|
||||
return vreinterpretq_f64_u8(vorrq_u8(vreinterpretq_u8_f64(a), vreinterpretq_u8_f64(b)));
|
||||
}
|
||||
|
||||
#ifdef __ARM_FEATURE_CRYPTO
|
||||
|
||||
|
||||
FORCE_INLINE rx_vec_i128 rx_aesenc_vec_i128(rx_vec_i128 a, rx_vec_i128 key) {
|
||||
const uint8x16_t zero = { 0 };
|
||||
return vaesmcq_u8(vaeseq_u8(a, zero)) ^ key;
|
||||
}
|
||||
|
||||
FORCE_INLINE rx_vec_i128 rx_aesdec_vec_i128(rx_vec_i128 a, rx_vec_i128 key) {
|
||||
const uint8x16_t zero = { 0 };
|
||||
return vaesimcq_u8(vaesdq_u8(a, zero)) ^ key;
|
||||
}
|
||||
|
||||
#define HAVE_AES
|
||||
|
||||
#endif
|
||||
|
||||
#define rx_xor_vec_i128 veorq_u8
|
||||
|
||||
FORCE_INLINE int rx_vec_i128_x(rx_vec_i128 a) {
|
||||
return vgetq_lane_s32(vreinterpretq_s32_u8(a), 0);
|
||||
}
|
||||
|
||||
FORCE_INLINE int rx_vec_i128_y(rx_vec_i128 a) {
|
||||
return vgetq_lane_s32(vreinterpretq_s32_u8(a), 1);
|
||||
}
|
||||
|
||||
FORCE_INLINE int rx_vec_i128_z(rx_vec_i128 a) {
|
||||
return vgetq_lane_s32(vreinterpretq_s32_u8(a), 2);
|
||||
}
|
||||
|
||||
FORCE_INLINE int rx_vec_i128_w(rx_vec_i128 a) {
|
||||
return vgetq_lane_s32(vreinterpretq_s32_u8(a), 3);
|
||||
}
|
||||
|
||||
FORCE_INLINE rx_vec_i128 rx_set_int_vec_i128(int _I3, int _I2, int _I1, int _I0) {
|
||||
int32_t data[4];
|
||||
data[0] = _I0;
|
||||
data[1] = _I1;
|
||||
data[2] = _I2;
|
||||
data[3] = _I3;
|
||||
return vreinterpretq_u8_s32(vld1q_s32(data));
|
||||
};
|
||||
|
||||
#define rx_xor_vec_i128 veorq_u8
|
||||
|
||||
FORCE_INLINE rx_vec_i128 rx_load_vec_i128(const rx_vec_i128* mem_addr) {
|
||||
return vld1q_u8((const uint8_t*)mem_addr);
|
||||
}
|
||||
|
||||
FORCE_INLINE void rx_store_vec_i128(rx_vec_i128* mem_addr, rx_vec_i128 val) {
|
||||
vst1q_u8((uint8_t*)mem_addr, val);
|
||||
}
|
||||
|
||||
FORCE_INLINE rx_vec_f128 rx_cvt_packed_int_vec_f128(const void* addr) {
|
||||
double lo = unsigned32ToSigned2sCompl(load32((uint8_t*)addr + 0));
|
||||
double hi = unsigned32ToSigned2sCompl(load32((uint8_t*)addr + 4));
|
||||
rx_vec_f128 x;
|
||||
x = vsetq_lane_f64(lo, x, 0);
|
||||
x = vsetq_lane_f64(hi, x, 1);
|
||||
return x;
|
||||
}
|
||||
|
||||
#define RANDOMX_DEFAULT_FENV
|
||||
|
||||
#else //portable fallback
|
||||
|
||||
#include <cstdint>
|
||||
#include <stdexcept>
|
||||
@@ -487,7 +614,6 @@ FORCE_INLINE rx_vec_f128 rx_set1_vec_f128(uint64_t x) {
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
FORCE_INLINE rx_vec_f128 rx_xor_vec_f128(rx_vec_f128 a, rx_vec_f128 b) {
|
||||
rx_vec_f128 x;
|
||||
x.i.u64[0] = a.i.u64[0] ^ b.i.u64[0];
|
||||
@@ -578,10 +704,6 @@ FORCE_INLINE rx_vec_f128 rx_cvt_packed_int_vec_f128(const void* addr) {
|
||||
|
||||
#define RANDOMX_DEFAULT_FENV
|
||||
|
||||
void rx_reset_float_state();
|
||||
|
||||
void rx_set_rounding_mode(uint32_t mode);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_AES
|
||||
@@ -598,6 +720,14 @@ FORCE_INLINE rx_vec_i128 rx_aesdec_vec_i128(rx_vec_i128 v, rx_vec_i128 rkey) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef RANDOMX_DEFAULT_FENV
|
||||
|
||||
void rx_reset_float_state();
|
||||
|
||||
void rx_set_rounding_mode(uint32_t mode);
|
||||
|
||||
#endif
|
||||
|
||||
double loadDoublePortable(const void* addr);
|
||||
uint64_t mulh(uint64_t, uint64_t);
|
||||
int64_t smulh(int64_t, int64_t);
|
||||
|
||||
1020
src/crypto/randomx/jit_compiler_a64.cpp
Normal file
1020
src/crypto/randomx/jit_compiler_a64.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
Copyright (c) 2018-2019, tevador <tevador@gmail.com>
|
||||
Copyright (c) 2019, SChernykh <https://github.com/SChernykh>
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -32,42 +33,91 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
#include "crypto/randomx/common.hpp"
|
||||
#include "crypto/randomx/jit_compiler_a64_static.hpp"
|
||||
|
||||
namespace randomx {
|
||||
|
||||
class Program;
|
||||
class ProgramConfiguration;
|
||||
class SuperscalarProgram;
|
||||
class Instruction;
|
||||
|
||||
typedef void(JitCompilerA64::*InstructionGeneratorA64)(Instruction&, uint32_t&);
|
||||
|
||||
class JitCompilerA64 {
|
||||
public:
|
||||
JitCompilerA64() {
|
||||
throw std::runtime_error("ARM64 JIT compiler is not implemented yet.");
|
||||
}
|
||||
void generateProgram(Program&, ProgramConfiguration&) {
|
||||
JitCompilerA64();
|
||||
~JitCompilerA64();
|
||||
|
||||
void generateProgram(Program&, ProgramConfiguration&);
|
||||
void generateProgramLight(Program&, ProgramConfiguration&, uint32_t);
|
||||
|
||||
}
|
||||
void generateProgramLight(Program&, ProgramConfiguration&, uint32_t) {
|
||||
|
||||
}
|
||||
template<size_t N>
|
||||
void generateSuperscalarHash(SuperscalarProgram(&programs)[N], std::vector<uint64_t> &) {
|
||||
void generateSuperscalarHash(SuperscalarProgram(&programs)[N], std::vector<uint64_t> &);
|
||||
|
||||
}
|
||||
void generateDatasetInitCode() {
|
||||
void generateDatasetInitCode() {}
|
||||
|
||||
ProgramFunc* getProgramFunc() { return reinterpret_cast<ProgramFunc*>(code); }
|
||||
DatasetInitFunc* getDatasetInitFunc();
|
||||
uint8_t* getCode() { return code; }
|
||||
size_t getCodeSize();
|
||||
|
||||
static InstructionGeneratorA64 engine[256];
|
||||
uint32_t reg_changed_offset[8];
|
||||
uint8_t* code;
|
||||
uint32_t literalPos;
|
||||
uint32_t num32bitLiterals;
|
||||
|
||||
static void emit32(uint32_t val, uint8_t* code, uint32_t& codePos)
|
||||
{
|
||||
*(uint32_t*)(code + codePos) = val;
|
||||
codePos += sizeof(val);
|
||||
}
|
||||
ProgramFunc* getProgramFunc() {
|
||||
return nullptr;
|
||||
}
|
||||
DatasetInitFunc* getDatasetInitFunc() {
|
||||
return nullptr;
|
||||
}
|
||||
uint8_t* getCode() {
|
||||
return nullptr;
|
||||
}
|
||||
size_t getCodeSize() {
|
||||
return 0;
|
||||
|
||||
static void emit64(uint64_t val, uint8_t* code, uint32_t& codePos)
|
||||
{
|
||||
*(uint64_t*)(code + codePos) = val;
|
||||
codePos += sizeof(val);
|
||||
}
|
||||
|
||||
void emitMovImmediate(uint32_t dst, uint32_t imm, uint8_t* code, uint32_t& codePos);
|
||||
void emitAddImmediate(uint32_t dst, uint32_t src, uint32_t imm, uint8_t* code, uint32_t& codePos);
|
||||
|
||||
template<uint32_t tmp_reg>
|
||||
void emitMemLoad(uint32_t dst, uint32_t src, Instruction& instr, uint8_t* code, uint32_t& codePos);
|
||||
|
||||
template<uint32_t tmp_reg_fp>
|
||||
void emitMemLoadFP(uint32_t src, Instruction& instr, uint8_t* code, uint32_t& codePos);
|
||||
|
||||
void h_IADD_RS(Instruction&, uint32_t&);
|
||||
void h_IADD_M(Instruction&, uint32_t&);
|
||||
void h_ISUB_R(Instruction&, uint32_t&);
|
||||
void h_ISUB_M(Instruction&, uint32_t&);
|
||||
void h_IMUL_R(Instruction&, uint32_t&);
|
||||
void h_IMUL_M(Instruction&, uint32_t&);
|
||||
void h_IMULH_R(Instruction&, uint32_t&);
|
||||
void h_IMULH_M(Instruction&, uint32_t&);
|
||||
void h_ISMULH_R(Instruction&, uint32_t&);
|
||||
void h_ISMULH_M(Instruction&, uint32_t&);
|
||||
void h_IMUL_RCP(Instruction&, uint32_t&);
|
||||
void h_INEG_R(Instruction&, uint32_t&);
|
||||
void h_IXOR_R(Instruction&, uint32_t&);
|
||||
void h_IXOR_M(Instruction&, uint32_t&);
|
||||
void h_IROR_R(Instruction&, uint32_t&);
|
||||
void h_IROL_R(Instruction&, uint32_t&);
|
||||
void h_ISWAP_R(Instruction&, uint32_t&);
|
||||
void h_FSWAP_R(Instruction&, uint32_t&);
|
||||
void h_FADD_R(Instruction&, uint32_t&);
|
||||
void h_FADD_M(Instruction&, uint32_t&);
|
||||
void h_FSUB_R(Instruction&, uint32_t&);
|
||||
void h_FSUB_M(Instruction&, uint32_t&);
|
||||
void h_FSCAL_R(Instruction&, uint32_t&);
|
||||
void h_FMUL_R(Instruction&, uint32_t&);
|
||||
void h_FDIV_M(Instruction&, uint32_t&);
|
||||
void h_FSQRT_R(Instruction&, uint32_t&);
|
||||
void h_CBRANCH(Instruction&, uint32_t&);
|
||||
void h_CFROUND(Instruction&, uint32_t&);
|
||||
void h_ISTORE(Instruction&, uint32_t&);
|
||||
void h_NOP(Instruction&, uint32_t&);
|
||||
};
|
||||
}
|
||||
|
||||
577
src/crypto/randomx/jit_compiler_a64_static.S
Normal file
577
src/crypto/randomx/jit_compiler_a64_static.S
Normal file
@@ -0,0 +1,577 @@
|
||||
# Copyright (c) 2018-2019, tevador <tevador@gmail.com>
|
||||
# Copyright (c) 2019, SChernykh <https://github.com/SChernykh>
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
.arch armv8-a
|
||||
.text
|
||||
.global randomx_program_aarch64
|
||||
.global randomx_program_aarch64_main_loop
|
||||
.global randomx_program_aarch64_vm_instructions
|
||||
.global randomx_program_aarch64_imul_rcp_literals_end
|
||||
.global randomx_program_aarch64_vm_instructions_end
|
||||
.global randomx_program_aarch64_cacheline_align_mask1
|
||||
.global randomx_program_aarch64_cacheline_align_mask2
|
||||
.global randomx_program_aarch64_update_spMix1
|
||||
.global randomx_program_aarch64_vm_instructions_end_light
|
||||
.global randomx_program_aarch64_light_cacheline_align_mask
|
||||
.global randomx_program_aarch64_light_dataset_offset
|
||||
.global randomx_init_dataset_aarch64
|
||||
.global randomx_init_dataset_aarch64_end
|
||||
.global randomx_calc_dataset_item_aarch64
|
||||
.global randomx_calc_dataset_item_aarch64_prefetch
|
||||
.global randomx_calc_dataset_item_aarch64_mix
|
||||
.global randomx_calc_dataset_item_aarch64_store_result
|
||||
.global randomx_calc_dataset_item_aarch64_end
|
||||
|
||||
# Register allocation
|
||||
|
||||
# x0 -> pointer to reg buffer and then literal for IMUL_RCP
|
||||
# x1 -> pointer to mem buffer and then to dataset
|
||||
# x2 -> pointer to scratchpad
|
||||
# x3 -> loop counter
|
||||
# x4 -> "r0"
|
||||
# x5 -> "r1"
|
||||
# x6 -> "r2"
|
||||
# x7 -> "r3"
|
||||
# x8 -> fpcr (reversed bits)
|
||||
# x9 -> mx, ma
|
||||
# x10 -> spMix1
|
||||
# x11 -> literal for IMUL_RCP
|
||||
# x12 -> "r4"
|
||||
# x13 -> "r5"
|
||||
# x14 -> "r6"
|
||||
# x15 -> "r7"
|
||||
# x16 -> spAddr0
|
||||
# x17 -> spAddr1
|
||||
# x18 -> temporary
|
||||
# x19 -> temporary
|
||||
# x20 -> literal for IMUL_RCP
|
||||
# x21 -> literal for IMUL_RCP
|
||||
# x22 -> literal for IMUL_RCP
|
||||
# x23 -> literal for IMUL_RCP
|
||||
# x24 -> literal for IMUL_RCP
|
||||
# x25 -> literal for IMUL_RCP
|
||||
# x26 -> literal for IMUL_RCP
|
||||
# x27 -> literal for IMUL_RCP
|
||||
# x28 -> literal for IMUL_RCP
|
||||
# x29 -> literal for IMUL_RCP
|
||||
# x30 -> literal for IMUL_RCP
|
||||
|
||||
# v0-v15 -> store 32-bit literals
|
||||
# v16 -> "f0"
|
||||
# v17 -> "f1"
|
||||
# v18 -> "f2"
|
||||
# v19 -> "f3"
|
||||
# v20 -> "e0"
|
||||
# v21 -> "e1"
|
||||
# v22 -> "e2"
|
||||
# v23 -> "e3"
|
||||
# v24 -> "a0"
|
||||
# v25 -> "a1"
|
||||
# v26 -> "a2"
|
||||
# v27 -> "a3"
|
||||
# v28 -> temporary
|
||||
# v29 -> E 'and' mask = 0x00ffffffffffffff00ffffffffffffff
|
||||
# v30 -> E 'or' mask = 0x3*00000000******3*00000000******
|
||||
# v31 -> scale mask = 0x81f000000000000081f0000000000000
|
||||
|
||||
randomx_program_aarch64:
|
||||
# Save callee-saved registers
|
||||
sub sp, sp, 192
|
||||
stp x16, x17, [sp]
|
||||
stp x18, x19, [sp, 16]
|
||||
stp x20, x21, [sp, 32]
|
||||
stp x22, x23, [sp, 48]
|
||||
stp x24, x25, [sp, 64]
|
||||
stp x26, x27, [sp, 80]
|
||||
stp x28, x29, [sp, 96]
|
||||
stp x8, x30, [sp, 112]
|
||||
stp d8, d9, [sp, 128]
|
||||
stp d10, d11, [sp, 144]
|
||||
stp d12, d13, [sp, 160]
|
||||
stp d14, d15, [sp, 176]
|
||||
|
||||
# Zero integer registers
|
||||
mov x4, xzr
|
||||
mov x5, xzr
|
||||
mov x6, xzr
|
||||
mov x7, xzr
|
||||
mov x12, xzr
|
||||
mov x13, xzr
|
||||
mov x14, xzr
|
||||
mov x15, xzr
|
||||
|
||||
# Load ma, mx and dataset pointer
|
||||
ldp x9, x1, [x1]
|
||||
|
||||
# Load initial spMix value
|
||||
mov x10, x9
|
||||
|
||||
# Load group A registers
|
||||
ldp q24, q25, [x0, 192]
|
||||
ldp q26, q27, [x0, 224]
|
||||
|
||||
# Load E 'and' mask
|
||||
mov x16, 0x00FFFFFFFFFFFFFF
|
||||
ins v29.d[0], x16
|
||||
ins v29.d[1], x16
|
||||
|
||||
# Load E 'or' mask (stored in reg.f[0])
|
||||
ldr q30, [x0, 64]
|
||||
|
||||
# Load scale mask
|
||||
mov x16, 0x80f0000000000000
|
||||
ins v31.d[0], x16
|
||||
ins v31.d[1], x16
|
||||
|
||||
# Read fpcr
|
||||
mrs x8, fpcr
|
||||
rbit x8, x8
|
||||
|
||||
# Save x0
|
||||
str x0, [sp, -16]!
|
||||
|
||||
# Read literals
|
||||
ldr x0, literal_x0
|
||||
ldr x11, literal_x11
|
||||
ldr x20, literal_x20
|
||||
ldr x21, literal_x21
|
||||
ldr x22, literal_x22
|
||||
ldr x23, literal_x23
|
||||
ldr x24, literal_x24
|
||||
ldr x25, literal_x25
|
||||
ldr x26, literal_x26
|
||||
ldr x27, literal_x27
|
||||
ldr x28, literal_x28
|
||||
ldr x29, literal_x29
|
||||
ldr x30, literal_x30
|
||||
|
||||
ldr q0, literal_v0
|
||||
ldr q1, literal_v1
|
||||
ldr q2, literal_v2
|
||||
ldr q3, literal_v3
|
||||
ldr q4, literal_v4
|
||||
ldr q5, literal_v5
|
||||
ldr q6, literal_v6
|
||||
ldr q7, literal_v7
|
||||
ldr q8, literal_v8
|
||||
ldr q9, literal_v9
|
||||
ldr q10, literal_v10
|
||||
ldr q11, literal_v11
|
||||
ldr q12, literal_v12
|
||||
ldr q13, literal_v13
|
||||
ldr q14, literal_v14
|
||||
ldr q15, literal_v15
|
||||
|
||||
randomx_program_aarch64_main_loop:
|
||||
# spAddr0 = spMix1 & ScratchpadL3Mask64;
|
||||
# spAddr1 = (spMix1 >> 32) & ScratchpadL3Mask64;
|
||||
lsr x18, x10, 32
|
||||
|
||||
# Actual mask will be inserted by JIT compiler
|
||||
and w16, w10, 1
|
||||
and w17, w18, 1
|
||||
|
||||
# x16 = scratchpad + spAddr0
|
||||
# x17 = scratchpad + spAddr1
|
||||
add x16, x16, x2
|
||||
add x17, x17, x2
|
||||
|
||||
# xor integer registers with scratchpad data (spAddr0)
|
||||
ldp x18, x19, [x16]
|
||||
eor x4, x4, x18
|
||||
eor x5, x5, x19
|
||||
ldp x18, x19, [x16, 16]
|
||||
eor x6, x6, x18
|
||||
eor x7, x7, x19
|
||||
ldp x18, x19, [x16, 32]
|
||||
eor x12, x12, x18
|
||||
eor x13, x13, x19
|
||||
ldp x18, x19, [x16, 48]
|
||||
eor x14, x14, x18
|
||||
eor x15, x15, x19
|
||||
|
||||
# Load group F registers (spAddr1)
|
||||
ldpsw x18, x19, [x17]
|
||||
ins v16.d[0], x18
|
||||
ins v16.d[1], x19
|
||||
ldpsw x18, x19, [x17, 8]
|
||||
ins v17.d[0], x18
|
||||
ins v17.d[1], x19
|
||||
ldpsw x18, x19, [x17, 16]
|
||||
ins v18.d[0], x18
|
||||
ins v18.d[1], x19
|
||||
ldpsw x18, x19, [x17, 24]
|
||||
ins v19.d[0], x18
|
||||
ins v19.d[1], x19
|
||||
scvtf v16.2d, v16.2d
|
||||
scvtf v17.2d, v17.2d
|
||||
scvtf v18.2d, v18.2d
|
||||
scvtf v19.2d, v19.2d
|
||||
|
||||
# Load group E registers (spAddr1)
|
||||
ldpsw x18, x19, [x17, 32]
|
||||
ins v20.d[0], x18
|
||||
ins v20.d[1], x19
|
||||
ldpsw x18, x19, [x17, 40]
|
||||
ins v21.d[0], x18
|
||||
ins v21.d[1], x19
|
||||
ldpsw x18, x19, [x17, 48]
|
||||
ins v22.d[0], x18
|
||||
ins v22.d[1], x19
|
||||
ldpsw x18, x19, [x17, 56]
|
||||
ins v23.d[0], x18
|
||||
ins v23.d[1], x19
|
||||
scvtf v20.2d, v20.2d
|
||||
scvtf v21.2d, v21.2d
|
||||
scvtf v22.2d, v22.2d
|
||||
scvtf v23.2d, v23.2d
|
||||
and v20.16b, v20.16b, v29.16b
|
||||
and v21.16b, v21.16b, v29.16b
|
||||
and v22.16b, v22.16b, v29.16b
|
||||
and v23.16b, v23.16b, v29.16b
|
||||
orr v20.16b, v20.16b, v30.16b
|
||||
orr v21.16b, v21.16b, v30.16b
|
||||
orr v22.16b, v22.16b, v30.16b
|
||||
orr v23.16b, v23.16b, v30.16b
|
||||
|
||||
# Execute VM instructions
|
||||
randomx_program_aarch64_vm_instructions:
|
||||
|
||||
# 16 KB buffer for generated instructions
|
||||
.fill 4096,4,0
|
||||
|
||||
literal_x0: .fill 1,8,0
|
||||
literal_x11: .fill 1,8,0
|
||||
literal_x20: .fill 1,8,0
|
||||
literal_x21: .fill 1,8,0
|
||||
literal_x22: .fill 1,8,0
|
||||
literal_x23: .fill 1,8,0
|
||||
literal_x24: .fill 1,8,0
|
||||
literal_x25: .fill 1,8,0
|
||||
literal_x26: .fill 1,8,0
|
||||
literal_x27: .fill 1,8,0
|
||||
literal_x28: .fill 1,8,0
|
||||
literal_x29: .fill 1,8,0
|
||||
literal_x30: .fill 1,8,0
|
||||
randomx_program_aarch64_imul_rcp_literals_end:
|
||||
|
||||
literal_v0: .fill 2,8,0
|
||||
literal_v1: .fill 2,8,0
|
||||
literal_v2: .fill 2,8,0
|
||||
literal_v3: .fill 2,8,0
|
||||
literal_v4: .fill 2,8,0
|
||||
literal_v5: .fill 2,8,0
|
||||
literal_v6: .fill 2,8,0
|
||||
literal_v7: .fill 2,8,0
|
||||
literal_v8: .fill 2,8,0
|
||||
literal_v9: .fill 2,8,0
|
||||
literal_v10: .fill 2,8,0
|
||||
literal_v11: .fill 2,8,0
|
||||
literal_v12: .fill 2,8,0
|
||||
literal_v13: .fill 2,8,0
|
||||
literal_v14: .fill 2,8,0
|
||||
literal_v15: .fill 2,8,0
|
||||
|
||||
randomx_program_aarch64_vm_instructions_end:
|
||||
|
||||
# mx ^= r[readReg2] ^ r[readReg3];
|
||||
eor x9, x9, x18
|
||||
|
||||
# Calculate dataset pointer for dataset prefetch
|
||||
mov w18, w9
|
||||
randomx_program_aarch64_cacheline_align_mask1:
|
||||
# Actual mask will be inserted by JIT compiler
|
||||
and x18, x18, 1
|
||||
add x18, x18, x1
|
||||
|
||||
# Prefetch dataset data
|
||||
prfm pldl2strm, [x18]
|
||||
|
||||
# mx <-> ma
|
||||
ror x9, x9, 32
|
||||
|
||||
# Calculate dataset pointer for dataset read
|
||||
mov w10, w9
|
||||
randomx_program_aarch64_cacheline_align_mask2:
|
||||
# Actual mask will be inserted by JIT compiler
|
||||
and x10, x10, 1
|
||||
add x10, x10, x1
|
||||
|
||||
randomx_program_aarch64_xor_with_dataset_line:
|
||||
# xor integer registers with dataset data
|
||||
ldp x18, x19, [x10]
|
||||
eor x4, x4, x18
|
||||
eor x5, x5, x19
|
||||
ldp x18, x19, [x10, 16]
|
||||
eor x6, x6, x18
|
||||
eor x7, x7, x19
|
||||
ldp x18, x19, [x10, 32]
|
||||
eor x12, x12, x18
|
||||
eor x13, x13, x19
|
||||
ldp x18, x19, [x10, 48]
|
||||
eor x14, x14, x18
|
||||
eor x15, x15, x19
|
||||
|
||||
randomx_program_aarch64_update_spMix1:
|
||||
# JIT compiler will replace it with "eor x10, config.readReg0, config.readReg1"
|
||||
eor x10, x0, x0
|
||||
|
||||
# Store integer registers to scratchpad (spAddr1)
|
||||
stp x4, x5, [x17, 0]
|
||||
stp x6, x7, [x17, 16]
|
||||
stp x12, x13, [x17, 32]
|
||||
stp x14, x15, [x17, 48]
|
||||
|
||||
# xor group F and group E registers
|
||||
eor v16.16b, v16.16b, v20.16b
|
||||
eor v17.16b, v17.16b, v21.16b
|
||||
eor v18.16b, v18.16b, v22.16b
|
||||
eor v19.16b, v19.16b, v23.16b
|
||||
|
||||
# Store FP registers to scratchpad (spAddr0)
|
||||
stp q16, q17, [x16, 0]
|
||||
stp q18, q19, [x16, 32]
|
||||
|
||||
subs x3, x3, 1
|
||||
bne randomx_program_aarch64_main_loop
|
||||
|
||||
# Restore x0
|
||||
ldr x0, [sp], 16
|
||||
|
||||
# Store integer registers
|
||||
stp x4, x5, [x0, 0]
|
||||
stp x6, x7, [x0, 16]
|
||||
stp x12, x13, [x0, 32]
|
||||
stp x14, x15, [x0, 48]
|
||||
|
||||
# Store FP registers
|
||||
stp q16, q17, [x0, 64]
|
||||
stp q18, q19, [x0, 96]
|
||||
stp q20, q21, [x0, 128]
|
||||
stp q22, q23, [x0, 160]
|
||||
|
||||
# Restore callee-saved registers
|
||||
ldp x16, x17, [sp]
|
||||
ldp x18, x19, [sp, 16]
|
||||
ldp x20, x21, [sp, 32]
|
||||
ldp x22, x23, [sp, 48]
|
||||
ldp x24, x25, [sp, 64]
|
||||
ldp x26, x27, [sp, 80]
|
||||
ldp x28, x29, [sp, 96]
|
||||
ldp x8, x30, [sp, 112]
|
||||
ldp d8, d9, [sp, 128]
|
||||
ldp d10, d11, [sp, 144]
|
||||
ldp d12, d13, [sp, 160]
|
||||
ldp d14, d15, [sp, 176]
|
||||
add sp, sp, 192
|
||||
|
||||
ret
|
||||
|
||||
randomx_program_aarch64_vm_instructions_end_light:
|
||||
sub sp, sp, 96
|
||||
stp x0, x1, [sp, 64]
|
||||
stp x2, x30, [sp, 80]
|
||||
|
||||
# mx ^= r[readReg2] ^ r[readReg3];
|
||||
eor x9, x9, x18
|
||||
|
||||
# mx <-> ma
|
||||
ror x9, x9, 32
|
||||
|
||||
# x0 -> pointer to cache memory
|
||||
mov x0, x1
|
||||
|
||||
# x1 -> pointer to output
|
||||
mov x1, sp
|
||||
|
||||
randomx_program_aarch64_light_cacheline_align_mask:
|
||||
# Actual mask will be inserted by JIT compiler
|
||||
and w2, w9, 1
|
||||
|
||||
# x2 -> item number
|
||||
lsr x2, x2, 6
|
||||
|
||||
randomx_program_aarch64_light_dataset_offset:
|
||||
# Apply dataset offset (filled in by JIT compiler)
|
||||
add x2, x2, 0
|
||||
add x2, x2, 0
|
||||
|
||||
bl randomx_calc_dataset_item_aarch64
|
||||
|
||||
mov x10, sp
|
||||
ldp x0, x1, [sp, 64]
|
||||
ldp x2, x30, [sp, 80]
|
||||
add sp, sp, 96
|
||||
|
||||
b randomx_program_aarch64_xor_with_dataset_line
|
||||
|
||||
|
||||
|
||||
# Input parameters
|
||||
#
|
||||
# x0 -> pointer to cache
|
||||
# x1 -> pointer to dataset memory at startItem
|
||||
# x2 -> start item
|
||||
# x3 -> end item
|
||||
|
||||
randomx_init_dataset_aarch64:
|
||||
# Save x30 (return address)
|
||||
str x30, [sp, -16]!
|
||||
|
||||
# Load pointer to cache memory
|
||||
ldr x0, [x0]
|
||||
|
||||
randomx_init_dataset_aarch64_main_loop:
|
||||
bl randomx_calc_dataset_item_aarch64
|
||||
add x1, x1, 64
|
||||
add x2, x2, 1
|
||||
cmp x2, x3
|
||||
bne randomx_init_dataset_aarch64_main_loop
|
||||
|
||||
# Restore x30 (return address)
|
||||
ldr x30, [sp], 16
|
||||
|
||||
ret
|
||||
|
||||
randomx_init_dataset_aarch64_end:
|
||||
|
||||
# Input parameters
|
||||
#
|
||||
# x0 -> pointer to cache memory
|
||||
# x1 -> pointer to output
|
||||
# x2 -> item number
|
||||
#
|
||||
# Register allocation
|
||||
#
|
||||
# x0-x7 -> output value (calculated dataset item)
|
||||
# x8 -> pointer to cache memory
|
||||
# x9 -> pointer to output
|
||||
# x10 -> registerValue
|
||||
# x11 -> mixBlock
|
||||
# x12 -> temporary
|
||||
# x13 -> temporary
|
||||
|
||||
randomx_calc_dataset_item_aarch64:
|
||||
sub sp, sp, 112
|
||||
stp x0, x1, [sp]
|
||||
stp x2, x3, [sp, 16]
|
||||
stp x4, x5, [sp, 32]
|
||||
stp x6, x7, [sp, 48]
|
||||
stp x8, x9, [sp, 64]
|
||||
stp x10, x11, [sp, 80]
|
||||
stp x12, x13, [sp, 96]
|
||||
|
||||
ldr x12, superscalarMul0
|
||||
|
||||
mov x8, x0
|
||||
mov x9, x1
|
||||
mov x10, x2
|
||||
|
||||
# rl[0] = (itemNumber + 1) * superscalarMul0;
|
||||
madd x0, x2, x12, x12
|
||||
|
||||
# rl[1] = rl[0] ^ superscalarAdd1;
|
||||
ldr x12, superscalarAdd1
|
||||
eor x1, x0, x12
|
||||
|
||||
# rl[2] = rl[0] ^ superscalarAdd2;
|
||||
ldr x12, superscalarAdd2
|
||||
eor x2, x0, x12
|
||||
|
||||
# rl[3] = rl[0] ^ superscalarAdd3;
|
||||
ldr x12, superscalarAdd3
|
||||
eor x3, x0, x12
|
||||
|
||||
# rl[4] = rl[0] ^ superscalarAdd4;
|
||||
ldr x12, superscalarAdd4
|
||||
eor x4, x0, x12
|
||||
|
||||
# rl[5] = rl[0] ^ superscalarAdd5;
|
||||
ldr x12, superscalarAdd5
|
||||
eor x5, x0, x12
|
||||
|
||||
# rl[6] = rl[0] ^ superscalarAdd6;
|
||||
ldr x12, superscalarAdd6
|
||||
eor x6, x0, x12
|
||||
|
||||
# rl[7] = rl[0] ^ superscalarAdd7;
|
||||
ldr x12, superscalarAdd7
|
||||
eor x7, x0, x12
|
||||
|
||||
b randomx_calc_dataset_item_aarch64_prefetch
|
||||
|
||||
superscalarMul0: .quad 6364136223846793005
|
||||
superscalarAdd1: .quad 9298411001130361340
|
||||
superscalarAdd2: .quad 12065312585734608966
|
||||
superscalarAdd3: .quad 9306329213124626780
|
||||
superscalarAdd4: .quad 5281919268842080866
|
||||
superscalarAdd5: .quad 10536153434571861004
|
||||
superscalarAdd6: .quad 3398623926847679864
|
||||
superscalarAdd7: .quad 9549104520008361294
|
||||
|
||||
# Prefetch -> SuperScalar hash -> Mix will be repeated N times
|
||||
|
||||
randomx_calc_dataset_item_aarch64_prefetch:
|
||||
# Actual mask will be inserted by JIT compiler
|
||||
and x11, x10, 1
|
||||
add x11, x8, x11, lsl 6
|
||||
prfm pldl2strm, [x11]
|
||||
|
||||
# Generated SuperScalar hash program goes here
|
||||
|
||||
randomx_calc_dataset_item_aarch64_mix:
|
||||
ldp x12, x13, [x11]
|
||||
eor x0, x0, x12
|
||||
eor x1, x1, x13
|
||||
ldp x12, x13, [x11, 16]
|
||||
eor x2, x2, x12
|
||||
eor x3, x3, x13
|
||||
ldp x12, x13, [x11, 32]
|
||||
eor x4, x4, x12
|
||||
eor x5, x5, x13
|
||||
ldp x12, x13, [x11, 48]
|
||||
eor x6, x6, x12
|
||||
eor x7, x7, x13
|
||||
|
||||
randomx_calc_dataset_item_aarch64_store_result:
|
||||
stp x0, x1, [x9]
|
||||
stp x2, x3, [x9, 16]
|
||||
stp x4, x5, [x9, 32]
|
||||
stp x6, x7, [x9, 48]
|
||||
|
||||
ldp x0, x1, [sp]
|
||||
ldp x2, x3, [sp, 16]
|
||||
ldp x4, x5, [sp, 32]
|
||||
ldp x6, x7, [sp, 48]
|
||||
ldp x8, x9, [sp, 64]
|
||||
ldp x10, x11, [sp, 80]
|
||||
ldp x12, x13, [sp, 96]
|
||||
add sp, sp, 112
|
||||
|
||||
ret
|
||||
|
||||
randomx_calc_dataset_item_aarch64_end:
|
||||
51
src/crypto/randomx/jit_compiler_a64_static.hpp
Normal file
51
src/crypto/randomx/jit_compiler_a64_static.hpp
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
Copyright (c) 2018-2019, tevador <tevador@gmail.com>
|
||||
Copyright (c) 2019, SChernykh <https://github.com/SChernykh>
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the copyright holder nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
extern "C" {
|
||||
void randomx_program_aarch64(void* reg, void* mem, void* scratchpad, uint64_t iterations);
|
||||
void randomx_program_aarch64_main_loop();
|
||||
void randomx_program_aarch64_vm_instructions();
|
||||
void randomx_program_aarch64_imul_rcp_literals_end();
|
||||
void randomx_program_aarch64_vm_instructions_end();
|
||||
void randomx_program_aarch64_cacheline_align_mask1();
|
||||
void randomx_program_aarch64_cacheline_align_mask2();
|
||||
void randomx_program_aarch64_update_spMix1();
|
||||
void randomx_program_aarch64_vm_instructions_end_light();
|
||||
void randomx_program_aarch64_light_cacheline_align_mask();
|
||||
void randomx_program_aarch64_light_dataset_offset();
|
||||
void randomx_init_dataset_aarch64();
|
||||
void randomx_init_dataset_aarch64_end();
|
||||
void randomx_calc_dataset_item_aarch64();
|
||||
void randomx_calc_dataset_item_aarch64_prefetch();
|
||||
void randomx_calc_dataset_item_aarch64_mix();
|
||||
void randomx_calc_dataset_item_aarch64_store_result();
|
||||
void randomx_calc_dataset_item_aarch64_end();
|
||||
}
|
||||
@@ -26,6 +26,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "crypto/randomx/common.hpp"
|
||||
#include "crypto/randomx/randomx.h"
|
||||
#include "crypto/randomx/dataset.hpp"
|
||||
#include "crypto/randomx/vm_interpreted.hpp"
|
||||
@@ -33,7 +34,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "crypto/randomx/vm_compiled.hpp"
|
||||
#include "crypto/randomx/vm_compiled_light.hpp"
|
||||
#include "crypto/randomx/blake2/blake2.h"
|
||||
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
#include "crypto/randomx/jit_compiler_x86_static.hpp"
|
||||
#elif defined(XMRIG_ARM)
|
||||
#include "crypto/randomx/jit_compiler_a64_static.hpp"
|
||||
#endif
|
||||
|
||||
#include <cassert>
|
||||
|
||||
RandomX_ConfigurationWownero::RandomX_ConfigurationWownero()
|
||||
@@ -156,19 +163,10 @@ RandomX_ConfigurationBase::RandomX_ConfigurationBase()
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint32_t Log2(size_t value) { return (value > 1) ? (Log2(value / 2) + 1) : 0; }
|
||||
|
||||
void RandomX_ConfigurationBase::Apply()
|
||||
{
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
*(uint32_t*)(codeShhPrefetchTweaked + 3) = ArgonMemory * 16 - 1;
|
||||
const uint32_t DatasetBaseMask = DatasetBaseSize - RANDOMX_DATASET_ITEM_SIZE;
|
||||
*(uint32_t*)(codeReadDatasetTweaked + 7) = DatasetBaseMask;
|
||||
*(uint32_t*)(codeReadDatasetTweaked + 23) = DatasetBaseMask;
|
||||
*(uint32_t*)(codeReadDatasetLightSshInitTweaked + 59) = DatasetBaseMask;
|
||||
#endif
|
||||
|
||||
CacheLineAlignMask_Calculated = (DatasetBaseSize - 1) & ~(RANDOMX_DATASET_ITEM_SIZE - 1);
|
||||
DatasetExtraItems_Calculated = DatasetExtraSize / RANDOMX_DATASET_ITEM_SIZE;
|
||||
|
||||
ScratchpadL1Mask_Calculated = (ScratchpadL1_Size / sizeof(uint64_t) - 1) * 8;
|
||||
ScratchpadL1Mask16_Calculated = (ScratchpadL1_Size / sizeof(uint64_t) / 2 - 1) * 16;
|
||||
ScratchpadL2Mask_Calculated = (ScratchpadL2_Size / sizeof(uint64_t) - 1) * 8;
|
||||
@@ -176,22 +174,40 @@ void RandomX_ConfigurationBase::Apply()
|
||||
ScratchpadL3Mask_Calculated = (((ScratchpadL3_Size / sizeof(uint64_t)) - 1) * 8);
|
||||
ScratchpadL3Mask64_Calculated = ((ScratchpadL3_Size / sizeof(uint64_t)) / 8 - 1) * 64;
|
||||
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
*(uint32_t*)(codePrefetchScratchpadTweaked + 4) = ScratchpadL3Mask64_Calculated;
|
||||
*(uint32_t*)(codePrefetchScratchpadTweaked + 18) = ScratchpadL3Mask64_Calculated;
|
||||
#endif
|
||||
CacheLineAlignMask_Calculated = (DatasetBaseSize - 1) & ~(RANDOMX_DATASET_ITEM_SIZE - 1);
|
||||
DatasetExtraItems_Calculated = DatasetExtraSize / RANDOMX_DATASET_ITEM_SIZE;
|
||||
|
||||
ConditionMask_Calculated = (1 << JumpBits) - 1;
|
||||
|
||||
constexpr int CEIL_NULL = 0;
|
||||
int k = 0;
|
||||
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
*(uint32_t*)(codeShhPrefetchTweaked + 3) = ArgonMemory * 16 - 1;
|
||||
const uint32_t DatasetBaseMask = DatasetBaseSize - RANDOMX_DATASET_ITEM_SIZE;
|
||||
*(uint32_t*)(codeReadDatasetTweaked + 7) = DatasetBaseMask;
|
||||
*(uint32_t*)(codeReadDatasetTweaked + 23) = DatasetBaseMask;
|
||||
*(uint32_t*)(codeReadDatasetLightSshInitTweaked + 59) = DatasetBaseMask;
|
||||
|
||||
*(uint32_t*)(codePrefetchScratchpadTweaked + 4) = ScratchpadL3Mask64_Calculated;
|
||||
*(uint32_t*)(codePrefetchScratchpadTweaked + 18) = ScratchpadL3Mask64_Calculated;
|
||||
|
||||
#define JIT_HANDLE(x, prev) randomx::JitCompilerX86::engine[k] = &randomx::JitCompilerX86::h_##x
|
||||
|
||||
#elif defined(XMRIG_ARM)
|
||||
|
||||
Log2_ScratchpadL1 = Log2(ScratchpadL1_Size);
|
||||
Log2_ScratchpadL2 = Log2(ScratchpadL2_Size);
|
||||
Log2_ScratchpadL3 = Log2(ScratchpadL3_Size);
|
||||
Log2_DatasetBaseSize = Log2(DatasetBaseSize);
|
||||
Log2_CacheSize = Log2((ArgonMemory * randomx::ArgonBlockSize) / randomx::CacheLineSize);
|
||||
|
||||
#define JIT_HANDLE(x, prev) randomx::JitCompilerA64::engine[k] = &randomx::JitCompilerA64::h_##x
|
||||
|
||||
#else
|
||||
#define JIT_HANDLE(x, prev)
|
||||
#endif
|
||||
|
||||
constexpr int CEIL_NULL = 0;
|
||||
int k = 0;
|
||||
|
||||
#define INST_HANDLE(x, prev) \
|
||||
CEIL_##x = CEIL_##prev + RANDOMX_FREQ_##x; \
|
||||
for (; k < CEIL_##x; ++k) { JIT_HANDLE(x, prev); }
|
||||
@@ -435,12 +451,12 @@ extern "C" {
|
||||
assert(inputSize == 0 || input != nullptr);
|
||||
assert(output != nullptr);
|
||||
alignas(16) uint64_t tempHash[8];
|
||||
rx_blake2b(tempHash, sizeof(tempHash), input, inputSize, nullptr, 0);
|
||||
rx_blake2b(tempHash, sizeof(tempHash), input, inputSize, nullptr, 0);
|
||||
machine->initScratchpad(&tempHash);
|
||||
machine->resetRoundingMode();
|
||||
for (uint32_t chain = 0; chain < RandomX_CurrentConfig.ProgramCount - 1; ++chain) {
|
||||
machine->run(&tempHash);
|
||||
rx_blake2b(tempHash, sizeof(tempHash), machine->getRegisterFile(), sizeof(randomx::RegisterFile), nullptr, 0);
|
||||
rx_blake2b(tempHash, sizeof(tempHash), machine->getRegisterFile(), sizeof(randomx::RegisterFile), nullptr, 0);
|
||||
}
|
||||
machine->run(&tempHash);
|
||||
machine->getFinalResult(output, RANDOMX_HASH_SIZE);
|
||||
|
||||
@@ -133,6 +133,14 @@ struct RandomX_ConfigurationBase
|
||||
|
||||
uint32_t ConditionMask_Calculated;
|
||||
|
||||
#ifdef XMRIG_ARM
|
||||
uint32_t Log2_ScratchpadL1;
|
||||
uint32_t Log2_ScratchpadL2;
|
||||
uint32_t Log2_ScratchpadL3;
|
||||
uint32_t Log2_DatasetBaseSize;
|
||||
uint32_t Log2_CacheSize;
|
||||
#endif
|
||||
|
||||
int CEIL_IADD_RS;
|
||||
int CEIL_IADD_M;
|
||||
int CEIL_ISUB_R;
|
||||
|
||||
@@ -64,7 +64,7 @@ protected:
|
||||
alignas(64) randomx::RegisterFile reg;
|
||||
alignas(16) randomx::ProgramConfiguration config;
|
||||
randomx::MemoryRegisters mem;
|
||||
uint8_t* scratchpad;
|
||||
uint8_t* scratchpad = nullptr;
|
||||
union {
|
||||
randomx_cache* cachePtr = nullptr;
|
||||
randomx_dataset* datasetPtr;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user