I am trying to connect a Raspberry pi front end (notebook) to a remote kernel running Ubuntu with the free Wolfram engine.
I have researched this answer but it never worked.
Using the code below I can launch remote kernels but I want the front end to NOT use the local kernel but to use the remote kernel for all evaluations as the memory on the Pi is too small (I even have the 4 GB Pi4).
Is this even possible?
I am having trouble in the kernel configuration options dialog. Its frustrating as I can launch remote kernels but can't connect a front end. Maybe this is by design?
I keep getting the error The kernel CONNECTION_NAME failed to connect to the front end. (Error = MLECONNECT). You should try running the kernel connection outside the front end.
Needs["SubKernels`RemoteKernels`"];
Parallel`Settings`$MathLinkTimeout = 1000;
createConnectionString[user_, ip_] := Module[
{ssh, math, number, machine, connectionString, remote},
ssh = "export LD_LIBRARY_PATH=;ssh";
math = "/usr/local/Wolfram/WolframEngine/12.0/Executables/\
WolframKernel" <>
" -wstp -linkmode Connect `4` -linkname `2` -subkernel -noinit >& \
/dev/null &";
number = 6;
machine = ip;
connectionString =
ssh <> " " <> user <> "@" <> machine <> " \"" <> math <> "\"";
remote =
SubKernels`RemoteKernels`RemoteMachine[machine, connectionString,
number]
]
kernel = createConnectionString[USERNAME, "192.168.1.2"];
kerns = LaunchKernels[kernel]
Out[5]= {"KernelObject"[1, "192.168.1.2"],
"KernelObject"[2, "192.168.1.2"], "KernelObject"[3, "192.168.1.2"],
"KernelObject"[4, "192.168.1.2"], "KernelObject"[5, "192.168.1.2"],
"KernelObject"[6, "192.168.1.2"]}
In[6]:= ParallelEvaluate[$MachineName]
Out[6]= {"USERNAME-System-Product-Name", \
"USERNAME-System-Product-Name", "USERNAME-System-Product-Name", \
"USERNAME-System-Product-Name", "USERNAME-System-Product-Name", \
"USERNAME-System-Product-Name"}