Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ray.init bug on windows linux subsystem #3059

Closed
robertnishihara opened this issue Oct 14, 2018 · 3 comments
Closed

ray.init bug on windows linux subsystem #3059

robertnishihara opened this issue Oct 14, 2018 · 3 comments

Comments

@robertnishihara
Copy link
Collaborator

robertnishihara commented Oct 14, 2018

The following happens when doing ray.init on WSL for Windows. This can be fixed by doing pip install psutil.

CalledProcessError                        Traceback (most recent call last)
<ipython-input-2-193b426d1a4d> in <module>()
      2 import ray
      3 #ray.init("localhost:6380")
----> 4 ray.init()


~/miniconda3/envs/tf-latest/lib/python3.6/site-packages/ray/worker.py in init(redis_address, num_cpus, num_gpus, resources, object_store_memory, node_ip_address, object_id_seed, num_workers, local_mode, driver_mode, redirect_worker_output, redirect_output, ignore_reinit_error, num_redis_shards, redis_max_clients, redis_protected_mode, plasma_directory, huge_pages, include_webui, use_raylet, configure_logging, logging_level, logging_format)

   1864         include_webui=include_webui,
   1865         object_store_memory=object_store_memory,
-> 1866         use_raylet=use_raylet)
   1867     for hook in _post_init_hooks:
   1868         hook()

 
~/miniconda3/envs/tf-latest/lib/python3.6/site-packages/ray/worker.py in _init(address_info, start_ray_local, object_id_seed, num_workers, num_local_schedulers, object_store_memory, local_mode, driver_mode, redirect_worker_output, redirect_output, start_workers_from_local_scheduler, num_cpus, num_gpus, resources, num_redis_shards, redis_max_clients, plasma_directory, huge_pages, include_webui, use_raylet)

   1659             huge_pages=huge_pages,
   1660             include_webui=include_webui,
-> 1661             use_raylet=use_raylet)
   1662     else:
   1663         if redis_address is None:


~/miniconda3/envs/tf-latest/lib/python3.6/site-packages/ray/services.py in start_ray_head(address_info, node_ip_address, redis_port, redis_shard_ports, num_workers, num_local_schedulers, object_store_memory, worker_path, cleanup, redirect_worker_output, redirect_output, start_workers_from_local_scheduler, resources, num_redis_shards, redis_max_clients, redis_protected_mode, include_webui, plasma_directory, huge_pages, autoscaling_config, use_raylet)

   1800         huge_pages=huge_pages,
   1801         autoscaling_config=autoscaling_config,
-> 1802         use_raylet=use_raylet)
   1803
   1804
 

~/miniconda3/envs/tf-latest/lib/python3.6/site-packages/ray/services.py in start_ray_processes(address_info, node_ip_address, redis_port, redis_shard_ports, num_workers, num_local_schedulers, object_store_memory, num_redis_shards, redis_max_clients, redis_protected_mode, worker_path, cleanup, redirect_worker_output, redirect_output, include_global_scheduler, include_log_monitor, include_webui, start_workers_from_local_scheduler, resources, plasma_directory, huge_pages, autoscaling_config, use_raylet)

   1522             plasma_directory=plasma_directory,
   1523             huge_pages=huge_pages,
-> 1524             use_raylet=use_raylet)
   1525         object_store_addresses.append(object_store_address)
   1526         time.sleep(0.1)
 

~/miniconda3/envs/tf-latest/lib/python3.6/site-packages/ray/services.py in start_plasma_store(node_ip_address, redis_address, object_manager_port, store_stdout_file, store_stderr_file, manager_stdout_file, manager_stderr_file, objstore_memory, cleanup, plasma_directory, huge_pages, use_raylet)

   1122     if objstore_memory is None:
   1123         # Compute a fraction of the system memory for the Plasma store to use.
-> 1124         system_memory = ray.utils.get_system_memory()
   1125         if sys.platform == "linux" or sys.platform == "linux2":
   1126             # On linux we use /dev/shm, its size is half the size of the
 

~/miniconda3/envs/tf-latest/lib/python3.6/site-packages/ray/utils.py in get_system_memory()

    324         # Handle Linux.
    325         bytes_in_kilobyte = 1024
--> 326         return vmstat("total memory") * bytes_in_kilobyte
    327     else:
    328         # Handle MacOS.
 

~/miniconda3/envs/tf-latest/lib/python3.6/site-packages/ray/utils.py in vmstat(stat)

    279         The parsed output.
    280     """
--> 281     out = subprocess.check_output(["vmstat", "-s"])
    282     stat = stat.encode("ascii")
    283     for line in out.split(b"\n"):
 

~/miniconda3/envs/tf-latest/lib/python3.6/subprocess.py in check_output(timeout, *popenargs, **kwargs)

    334
    335     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
--> 336                **kwargs).stdout
    337
    338
 

~/miniconda3/envs/tf-latest/lib/python3.6/subprocess.py in run(input, timeout, check, *popenargs, **kwargs)

    416         if check and retcode:
    417             raise CalledProcessError(retcode, process.args,
--> 418                                      output=stdout, stderr=stderr)
    419     return CompletedProcess(process.args, retcode, stdout, stderr)
    420

CalledProcessError: Command '['vmstat', '-s']' returned non-zero exit status 102.

The issue may be that /proc doesn't exist.

@animesh
Copy link

animesh commented Feb 12, 2019

Thanks @robertnishihara

sudo pip3 install psutil
sudo pip3 install setproctitle

saved the day 👍

@ninafiona
Copy link

Unfortunately the solution 'pip3 install psutil setproctitle' didn't work for me.
I tried to run ray.init() and get the error 'Could not establish connection to redis ... (context.err = 1)'.
It works on my other Linux machine, but not on the WSL. Any other ideas?

@mehrdadn
Copy link
Contributor

Closing this as it is now tracked on #6900.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants