mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-06 23:52:38 -05:00
Compare commits
4 Commits
dc9be5dea1
...
5a82440a74
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a82440a74 | ||
|
|
36fdfa2694 | ||
|
|
6cfc02d24f | ||
|
|
df031be628 |
45
Dockerfile
Normal file
45
Dockerfile
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# Build in disposable container so run-time container is small
|
||||||
|
FROM alpine:latest as build
|
||||||
|
|
||||||
|
# Build from master by default but allow build time specification
|
||||||
|
ARG ref=master
|
||||||
|
ENV my_ref=$ref
|
||||||
|
|
||||||
|
# Developers may wish to specify an alternate repository for source
|
||||||
|
ARG repo=https://github.com/xmrig/xmrig.git
|
||||||
|
ENV my_repo=$repo
|
||||||
|
|
||||||
|
RUN set -ex && \
|
||||||
|
# testing required for hwloc
|
||||||
|
echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
|
||||||
|
|
||||||
|
RUN set -ex && \
|
||||||
|
apk --no-cache --update add \
|
||||||
|
coreutils file grep openssl tar binutils \
|
||||||
|
cmake g++ git linux-headers libpthread-stubs make hwloc-dev@testing \
|
||||||
|
libuv-dev openssl-dev
|
||||||
|
|
||||||
|
WORKDIR /usr/local/src
|
||||||
|
|
||||||
|
RUN set -ex && \
|
||||||
|
git clone $my_repo xmrig && \
|
||||||
|
cd xmrig && git checkout $my_ref && \
|
||||||
|
cmake -B build && \
|
||||||
|
cd build && \
|
||||||
|
make
|
||||||
|
|
||||||
|
# runtime container
|
||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
|
RUN set -ex && \
|
||||||
|
# testing required for hwloc
|
||||||
|
echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
|
||||||
|
|
||||||
|
RUN set -ex && \
|
||||||
|
apk --no-cache --update add \
|
||||||
|
# required libraries packages
|
||||||
|
openssl libuv hwloc@testing
|
||||||
|
|
||||||
|
COPY --from=build /usr/local/src/xmrig/build/xmrig /bin/
|
||||||
|
|
||||||
|
ENTRYPOINT ["/bin/xmrig"]
|
||||||
@@ -320,8 +320,13 @@ void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorith
|
|||||||
L2 += l2->attr->cache.size;
|
L2 += l2->attr->cache.size;
|
||||||
L2_associativity = l2->attr->cache.associativity;
|
L2_associativity = l2->attr->cache.associativity;
|
||||||
|
|
||||||
if (L3_exclusive && l2->attr->cache.size >= scratchpad) {
|
if (L3_exclusive) {
|
||||||
extra += scratchpad;
|
if (vendor() == VENDOR_AMD) {
|
||||||
|
extra += std::min<size_t>(l2->attr->cache.size, scratchpad);
|
||||||
|
}
|
||||||
|
else if (l2->attr->cache.size >= scratchpad) {
|
||||||
|
extra += scratchpad;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user