9 Commits

Author SHA1 Message Date
Jarvis Carroll 8d3d30425b Fix semicolon 2025-06-24 07:04:32 +10:00
spivee 92d061f572 Disable AVX2 for now
AVX2 is much less available than one would expect, is hard for e.g. me to test, and because of the way gmhive_worker currently works, the illegal-instruction exit codes go undetected, leaving users confused as their balance stays at zero, despite the app saying they are getting solutions.
2025-06-23 22:19:04 +09:00
zxq9 6795c187c3 Drop test export 2025-06-18 23:04:38 +09:00
zxq9 09ec2a8e0d Oops 2025-06-18 23:02:31 +09:00
zxq9 a9581291aa Make Windows memory inspection more robust 2025-06-18 22:41:11 +09:00
zxq9 2938686b1c Update deps to use new gmhive_client 2025-06-12 21:33:11 +09:00
zxq9 bd1c779d09 Change how we discover memory on Windows 2025-06-12 20:31:52 +09:00
zxq9 002196059e Fix configuration crashes 2025-06-12 18:04:36 +09:00
zxq9 e86a130180 Add version to title, update deps to memory fix 2025-05-28 21:22:03 +09:00
7 changed files with 50 additions and 28 deletions
+1 -1
View File
@@ -3,6 +3,6 @@
{registered,[]},
{included_applications,[]},
{applications,[stdlib,kernel]},
{vsn,"0.2.0"},
{vsn,"0.2.5"},
{modules,[gajumine,gmc_con,gmc_conf,gmc_gui,gmc_sup]},
{mod,{gajumine,[]}}]}.
+1 -1
View File
@@ -3,7 +3,7 @@
%%% @end
-module(gajumine).
-vsn("0.2.0").
-vsn("0.2.5").
-behavior(application).
-author("Craig Everett <craigeverett@qpq.swiss>").
-copyright("QPQ AG <craigeverett@qpq.swiss>").
+30 -14
View File
@@ -3,7 +3,7 @@
%%% @end
-module(gmc_con).
-vsn("0.2.0").
-vsn("0.2.5").
-author("Craig Everett <craigeverett@qpq.swiss>").
-copyright("QPQ AG <craigeverett@qpq.swiss>").
-license("GPL-3.0-or-later").
@@ -205,10 +205,7 @@ do_start_stop(#s{acc = PubKey, keys = Keys, network = Network, max_cores = MaxCo
{Fatness, Type} =
case os:type() of
{unix, linux} ->
case Network of
<<"mainnet">> -> {"mean", "avx2"};
<<"testnet">> -> {"mean", "generic"}
end;
{"mean", "generic"};
{unix, darwin} ->
% Check memory. >7gb gets mean, <7gb gets lean
{"mean", "generic"};
@@ -216,10 +213,7 @@ do_start_stop(#s{acc = PubKey, keys = Keys, network = Network, max_cores = MaxCo
% Check memory. >7gb gets mean, <7gb gets lean
% Check avx2.
% Both should be provided by the F# start program
case Network of
<<"mainnet">> -> {"mean", "avx2.exe"};
<<"testnet">> -> {"mean", "generic.exe"}
end
{"mean", "generic"}
end,
Miner = filename:join(platform_dir(), unicode:characters_to_binary([Fatness, Bits, "-", Type])),
Count = optimize_count(MaxCores, MaxMem),
@@ -283,18 +277,40 @@ proc_mem() ->
{unix, linux} ->
{processor, Cores} = hd(erlang:system_info(cpu_topology)),
P = length(Cores),
M = list_to_integer(string:trim(os:cmd("cat /proc/meminfo | grep MemTotal | awk '{print $2}'"))) * 1024,
M = s_to_i(mem, string:trim(os:cmd("cat /proc/meminfo | grep MemTotal | awk '{print $2}'"))) * 1024,
{P, M};
{unix, darwin} ->
P = list_to_integer(string:trim(os:cmd("sysctl -n hw.physicalcpu"))),
M = list_to_integer(string:trim(os:cmd("sysctl -n hw.memsize"))),
P = s_to_i(cpu, string:trim(os:cmd("sysctl -n hw.physicalcpu"))),
M = s_to_i(mem, string:trim(os:cmd("sysctl -n hw.memsize"))),
{P, M};
{win32, nt} ->
P = list_to_integer(os:getenv("NUMBER_OF_PROCESSORS")),
M = list_to_integer(string:strip(lists:nth(2, string:split(os:cmd("wmic computersystem get TotalPhysicalMemory"), "\r\r\n", all)))),
P = s_to_i(cpu, os:getenv("NUMBER_OF_PROCESSORS")),
M = win_mem(),
{P, M}
end.
s_to_i(Type, "") ->
default_spec(Type);
s_to_i(Type, String) ->
case is_0_9(String) of
true -> list_to_integer(String);
false -> default_spec(Type)
end.
is_0_9("") ->
true;
is_0_9([H | T]) when $0 =< H, H =< $9 ->
is_0_9(T);
is_0_9(_) ->
false.
default_spec(cpu) -> 1;
default_spec(mem) -> 3550722201.
win_mem() ->
Out = os:cmd("powershell -Command \"(Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory\""),
s_to_i(mem, lists:last(string:split(string:trim(Out), "\r\n", all))).
do_gajudesk() ->
ok = tell(info, "Running gajudesk"),
+9 -4
View File
@@ -3,7 +3,7 @@
%%% @end
-module(gmc_conf).
-vsn("0.2.0").
-vsn("0.2.5").
-author("Craig Everett <craigeverett@qpq.swiss>").
-copyright("QPQ AG <craigeverett@qpq.swiss>").
-license("GPL-3.0-or-later").
@@ -51,7 +51,6 @@ trouble(Info) ->
start_link(Prefs) ->
wx_object:start_link({local, ?MODULE}, ?MODULE, Prefs, []).
init({Prefs, {Net, Acc, Keys, {AProcs, AMem, MProcs, MMem}}}) ->
ok = log(info, "GUI starting..."),
Lang = maps:get(lang, Prefs, en_US),
@@ -70,8 +69,8 @@ init({Prefs, {Net, Acc, Keys, {AProcs, AMem, MProcs, MMem}}}) ->
KeysTx = wxTextCtrl:new(Frame, ?wxID_ANY, [{style, ?wxTE_MULTILINE}, {value, keys(Keys)}]),
_ = wxStaticBoxSizer:add(KeysSz, KeysTx, wide(5)),
StatSz = wxStaticBoxSizer:new(?wxVERTICAL, Frame, [{label, J("Max System Committment (optional)")}]),
AProcsS = integer_to_list(AProcs),
MProcsS = integer_to_list(MProcs),
AProcsS = i_to_l(AProcs),
MProcsS = i_to_l(MProcs),
AMemS = gigs(AMem),
MMemS = gigs(MMem),
Labels = [{J("HW Cores"), J("Max Cores"), AProcsS, MProcsS}, {J("Memory (GB)"), J("Max Memory"), AMemS, MMemS}],
@@ -105,12 +104,18 @@ init({Prefs, {Net, Acc, Keys, {AProcs, AMem, MProcs, MMem}}}) ->
{Frame, State}.
i_to_l(none) -> "0";
i_to_l(N) when is_integer(N) -> integer_to_list(N).
base(Padding) -> [{proportion, 0}, {flag, ?wxEXPAND bor ?wxALL}, {border, Padding}].
wide(Padding) -> [{proportion, 1}, {flag, ?wxEXPAND bor ?wxALL}, {border, Padding}].
center() -> [{proportion, 0}, {flag, ?wxEXPAND bor ?wxALIGN_CENTER_VERTICAL}].
gigs(none) ->
"0";
gigs(Bytes) ->
float_to_list(Bytes / gig(), [{decimals, 2}, compact]).
+4 -3
View File
@@ -3,7 +3,7 @@
%%% @end
-module(gmc_gui).
-vsn("0.2.0").
-vsn("0.2.5").
-author("Craig Everett <craigeverett@qpq.swiss>").
-copyright("QPQ AG <craigeverett@qpq.swiss>").
-license("GPL-3.0-or-later").
@@ -87,13 +87,14 @@ start_link(Title) ->
init(Prefs) ->
ok = log(info, "GUI starting..."),
Lang = maps:get(lang, Prefs, en_US),
Trans = gd_jt:read_translations(?MODULE),
J = gd_jt:j(Lang, Trans),
AppName = J("GajuMine"),
VSN = proplists:get_value(vsn, ?MODULE:module_info(attributes)),
WX = wx:new(),
Frame = wxFrame:new(WX, ?wxID_ANY, J("GajuMine")),
Frame = wxFrame:new(WX, ?wxID_ANY, AppName ++ " v" ++ VSN),
MainSz = wxBoxSizer:new(?wxVERTICAL),
LeftRight = wxBoxSizer:new(?wxHORIZONTAL),
Left = wxBoxSizer:new(?wxVERTICAL),
+1 -1
View File
@@ -12,7 +12,7 @@
%%% @end
-module(gmc_sup).
-vsn("0.2.0").
-vsn("0.2.5").
-behaviour(supervisor).
-author("Craig Everett <craigeverett@qpq.swiss>").
-copyright("QPQ AG <craigeverett@qpq.swiss>").
+4 -4
View File
@@ -4,10 +4,10 @@
{prefix,"gmc"}.
{author,"Craig Everett"}.
{desc,"Mining client for the Gajumaru Root"}.
{package_id,{"qpq","gajumine",{0,2,0}}}.
{deps,[{"qpq","cuckoo_cpu",{0,3,0}},
{"uwiger","gmhive_client",{0,4,0}},
{"uwiger","gmcuckoo",{1,1,1}},
{package_id,{"qpq","gajumine",{0,2,5}}}.
{deps,[{"uwiger","gmhive_client",{0,4,4}},
{"uwiger","gmcuckoo",{1,2,3}},
{"qpq","cuckoo_cpu",{0,3,0}},
{"uwiger","gmhive_worker",{0,3,0}},
{"uwiger","gmconfig",{0,1,2}},
{"uwiger","gproc",{1,0,1}},