1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-06 23:52:38 -05:00

Compare commits

...

4 Commits

Author SHA1 Message Date
h8llama
5a82440a74 Merge df031be628 into 36fdfa2694 2025-03-26 15:29:23 +07:00
xmrig
36fdfa2694 Merge pull request #3646 from SChernykh/dev
Optimized autoconfig for AMD CPUs with < 2 MB L3 cache per thread
2025-03-22 18:36:09 +07:00
SChernykh
6cfc02d24f Optimized autoconfig for AMD CPUs with < 2 MB L3 cache per thread 2025-03-22 11:34:23 +01:00
h8llama
df031be628 Add Dockerfile
By default this Dockerfile is suitable for using dockerhub auto build
feature to build new :latest when ever there's a new push to the
github master branch allowing for simple "official" image
distribution.

Adding build args allow specifying alternate repository (default:
https://github.com/xmrig/xmrig.git) or build reference (default:
master) example:

docker build --build-arg repo=https://github.com/<username>/xmrig.git \
             --build-arg ref=dev --tag xmrig:dev .

A multi stage build is used to keep run time image small.
2021-01-02 12:20:40 -05:00
2 changed files with 52 additions and 2 deletions

45
Dockerfile Normal file
View 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"]

View File

@@ -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;
}
} }
} }
} }