exo icon indicating copy to clipboard operation
exo copied to clipboard

How install on android

Open artistlu opened this issue 1 year ago • 13 comments

my android device only has python3.11.9. i try every solutinos,cannot install python3.12 on android.

artistlu avatar Jul 30 '24 06:07 artistlu

Are you using a terminal emulator? Which device? Which version of android?

AlexCheema avatar Jul 30 '24 07:07 AlexCheema

Are you using a terminal emulator? Which device? Which version of android?

termux xiaomi 14pro android 14

artistlu avatar Jul 30 '24 07:07 artistlu

Are you using a terminal emulator? Which device? Which version of android?

termux xiaomi 14pro android 14

Use proot-distro and pipenv, here's a little hint:

  1. Install proot-distro: apt update && apt upgrade -y && apt install proot-distro -y
  2. Install the ubuntu distro: pd install --override-alias exo ubuntu
  3. Enter the distro: pd login exo
  4. Install packages and clone the exo repo: apt update && apt upgrade -y && apt install python3 python3-pip pipenv -y use git clone to clone the repo and navigate there with cd
  5. Initiate the python enviroment: pipenv shell
  6. Install python dependencies: pip install . pip install torch flax
  7. Initiate your android node: CLANG=1 python main.py
  8. If you get the error "Illegal instruction" desinstall torch and initiate the node again: pip uninstall torch

ManuXD32 avatar Jul 30 '24 20:07 ManuXD32

This works and should be in the wiki.

My only issue is, getting 0TFLOPS. So my guess is, it did not pick up on the CPU and GPU on the android device.

Daniel-ltw avatar Jul 31 '24 03:07 Daniel-ltw

This works and should be in the wiki.

My only issue is, getting 0TFLOPS. So my guess is, it did not pick up on the CPU and GPU on the android device.

You can run it without CLANG=1 to be able to use GPUs, but I don't think Android GPUs can do much or are even supported.

ManuXD32 avatar Jul 31 '24 07:07 ManuXD32

proot-distro installing debian can run exo, but when multiple phones are connected to the same network, exo cannot be added together, and all nodes are displayed as one.

artistlu avatar Aug 02 '24 03:08 artistlu

proot-distro installing debian can run exo, but when multiple phones are connected to the same network, exo cannot be added together, and all nodes are displayed as one.

Didn't happen to me, I installed exo on my phone and a tablet and it doesn't show as one

ManuXD32 avatar Aug 02 '24 04:08 ManuXD32

I met a problem, which seems to be related to sockets. How to solve it?

(exo) root@localhost:~/exo/exo# CLANG=1 python main.py Traceback (most recent call last): File "/root/exo/exo/main.py", line 13, in from exo.train.dataset import load_dataset, iterate_batches File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/exo/init.py", line 1, in from exo.helpers import DEBUG as DEBUG, DEBUG_DISCOVERY as DEBUG_DISCOVERY, VERSION as VERSION File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/exo/helpers.py", line 10, in from scapy.all import get_if_addr, get_if_list File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/all.py", line 16, in from scapy.arch import * File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/arch/init.py", line 172, in _set_conf_sockets() # Apply config ^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/config.py", line 826, in _set_conf_sockets conf.ifaces.reload() File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/interfaces.py", line 255, in reload self._reload_provs() File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/interfaces.py", line 251, in _reload_provs self._load(prov.reload(), prov) ^^^^^^^^^^^^^ File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/interfaces.py", line 51, in reload return self.load() ^^^^^^^^^^^ File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/arch/linux/init.py", line 166, in load for iface in _get_if_list().values(): ^^^^^^^^^^^^^^ File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/arch/linux/rtnetlink.py", line 798, in _get_if_list results = _sr1_rtrequest( ^^^^^^^^^^^^^^^ File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/arch/linux/rtnetlink.py", line 723, in _sr1_rtrequest sock.bind((0, 0)) # bind to kernel ^^^^^^^^^^^^^^^^^ PermissionError: [Errno 13] Permission denied

belog2867 avatar Feb 04 '25 05:02 belog2867

I met a problem, which seems to be related to sockets. How to solve it?

(exo) root@localhost:~/exo/exo# CLANG=1 python main.py Traceback (most recent call last): File "/root/exo/exo/main.py", line 13, in from exo.train.dataset import load_dataset, iterate_batches File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/exo/init.py", line 1, in from exo.helpers import DEBUG as DEBUG, DEBUG_DISCOVERY as DEBUG_DISCOVERY, VERSION as VERSION File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/exo/helpers.py", line 10, in from scapy.all import get_if_addr, get_if_list File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/all.py", line 16, in from scapy.arch import * File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/arch/init.py", line 172, in _set_conf_sockets() # Apply config ^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/config.py", line 826, in _set_conf_sockets conf.ifaces.reload() File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/interfaces.py", line 255, in reload self._reload_provs() File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/interfaces.py", line 251, in _reload_provs self._load(prov.reload(), prov) ^^^^^^^^^^^^^ File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/interfaces.py", line 51, in reload return self.load() ^^^^^^^^^^^ File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/arch/linux/init.py", line 166, in load for iface in _get_if_list().values(): ^^^^^^^^^^^^^^ File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/arch/linux/rtnetlink.py", line 798, in _get_if_list results = _sr1_rtrequest( ^^^^^^^^^^^^^^^ File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/arch/linux/rtnetlink.py", line 723, in _sr1_rtrequest sock.bind((0, 0)) # bind to kernel ^^^^^^^^^^^^^^^^^ PermissionError: [Errno 13] Permission denied

The same error for me. My environment is Arch Linux in proot-distro, Android 14. Havn't found a solution yet.

383494 avatar Feb 04 '25 08:02 383494

I met a problem, which seems to be related to sockets. How to solve it? (exo) root@localhost:~/exo/exo# CLANG=1 python main.py Traceback (most recent call last): File "/root/exo/exo/main.py", line 13, in from exo.train.dataset import load_dataset, iterate_batches File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/exo/init.py", line 1, in from exo.helpers import DEBUG as DEBUG, DEBUG_DISCOVERY as DEBUG_DISCOVERY, VERSION as VERSION File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/exo/helpers.py", line 10, in from scapy.all import get_if_addr, get_if_list File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/all.py", line 16, in from scapy.arch import * File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/arch/init.py", line 172, in _set_conf_sockets() # Apply config ^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/config.py", line 826, in _set_conf_sockets conf.ifaces.reload() File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/interfaces.py", line 255, in reload self._reload_provs() File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/interfaces.py", line 251, in _reload_provs self._load(prov.reload(), prov) ^^^^^^^^^^^^^ File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/interfaces.py", line 51, in reload return self.load() ^^^^^^^^^^^ File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/arch/linux/init.py", line 166, in load for iface in _get_if_list().values(): ^^^^^^^^^^^^^^ File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/arch/linux/rtnetlink.py", line 798, in _get_if_list results = _sr1_rtrequest( ^^^^^^^^^^^^^^^ File "/root/.local/share/virtualenvs/exo-e6zsp3qK/lib/python3.12/site-packages/scapy/arch/linux/rtnetlink.py", line 723, in _sr1_rtrequest sock.bind((0, 0)) # bind to kernel ^^^^^^^^^^^^^^^^^ PermissionError: [Errno 13] Permission denied

The same error for me. My environment is Arch Linux in proot-distro, Android 14. Havn't found a solution yet.

i have the same issue under termux with proot distro on android 14 on a poco f4 from my understanding the issue is related to android itself due to Seccomp in android

ejrydhfs avatar Feb 09 '25 02:02 ejrydhfs

if i open termux and then start proot with " PROOT_NO_SECCOMP=1 pd login exo ", then try to run exo by running " python3 main.py " in the folder where exo is installed i get this error

Traceback (most recent call last): File "main.py", line 1, in import argparse File "", line 1360, in _find_and_load File "", line 1322, in _find_and_load_unlocked File "", line 1262, in _find_spec File "", line 1528, in find_spec File "", line 1500, in _get_spec File "", line 1479, in _path_importer_cache OSError: [Errno 38] Function not implemented

I am guessing it is related to proot

ejrydhfs avatar Feb 09 '25 02:02 ejrydhfs

Hello according to this https://www.reddit.com/r/termux/comments/1dyvfgq/cannot_bind_netlink_socket_permission_denied/ if you see permission denied you will need to root your device otherwise it won't work. A workaround could be to have the device communicate with a server installed in a local computer and have it communicate via http but I guess it would add overhead noticeable at high speeds like 1gbps of data transfer. Android is expected to have virtual machine support in an upcoming android release

Also see this https://www.reddit.com/r/termux/comments/rktz6d/cant_run_nmap_because_it_cannot_locate_interface/

https://github.com/termux/termux-packages/wiki/Termux-and-Android-10

https://github.com/termux/termux-app/issues/2993

ejrydhfs avatar Feb 10 '25 18:02 ejrydhfs

An alternative is to write your own function to get the interface and IP by making the following changes to exo/helpers.py:

# from scapy.all import get_if_addr, get_if_list


def get_if_list():
  result = subprocess.run(["ifconfig"], capture_output=True, text=True)
  output = result.stdout
  interfaces = re.findall(r'^(\w+):', output, re.MULTILINE)
  return interfaces


def get_if_addr(interface="wlan0"):
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    s.connect(("8.8.8.8", 80))
    return s.getsockname()[0]

I was able to get it to work on proot-distro ubuntu with this.

teticio avatar Feb 24 '25 12:02 teticio

I made another version of exo/helpers.py, but using ifconfig only... socks get IP from interface connected to 8.8.8.8 and on my local network it is not the correct IP for exo network

#from scapy.all import get_if_addr, get_if_list
import re
import subprocess
def get_if_list():
  try:
    result = subprocess.run(['ifconfig'], capture_output=True, text=True, check=True)
    output = result.stdout

    #Procura por interfaces que começam com 'w'
    interfaces = re.findall(r'^(w\w+):', output, re.MULTILINE)
    return interfaces

  except Exception as e:
    print(f"Erro ao obter interfaces: {e}")
    return None

def get_if_addr(interface="wlan0"):
  try:
    result = subprocess.run(['ifconfig'], capture_output=True, text=True, check=True)
    output = result.stdout
    # Procura por endereço IPv4 - padrão mais robusto
    # Funciona com diferentes versões do ifconfig
    ip_patterns = [ 
      r'inet (\d+\.\d+\.\d+\.\d+)',  # Linux moderno
      r'inet addr:(\d+\.\d+\.\d+\.\d+)',  # Linux antigo
      #r'inet\s+(\d+\.\d+\.\d+\.\d+)'  # Variação sem addr:
    ]
    
    ipp = None
    for pattern in ip_patterns:
      ip_match = re.findall(pattern, output)
      for ip in ip_match:
        if ip:
          ip_addr = ip
          # Ignora endereços de loopback
          if not ip_addr.startswith('127.'):
            ipp = ip
    
    return ipp
  except subprocess.CalledProcessError:
    print(f"Interface {interface} não encontrada ou inativa")
    return None
  except Exception as e:
    print(f"Erro ao obter IP da interface {interface}: {e}")
    return None

Anunakin avatar Aug 28 '25 16:08 Anunakin