Issues after upgrading from 1.6.0 fro 1.7.0

After upgrading to ray[rllib] 1.7.0 on Ubuntu Linux 20.04 with latest tensorflow and tensorflow-gpu python packages installed. I’m seeing the following error while tryping to create workers. What might be the problem?

The issue appears when I set ‘num_gpus’ config to any value above 0. Here is the script as well.

from ray import tune

env_cfg = {
    "env": "gym_backtest:backtest-v0",
    "env_config" : {
        "port": 8125,
        "host": "127.0.0.1",
    },
    "num_gpus": 0.01,
    "num_workers": 1,
    "gamma": 0.9,
    "timesteps_per_iteration": 100000,
    "model" : {
        "fcnet_hiddens": [ 64 ],
        "fcnet_activation": "relu",
    },
}

tune.run(
    "PPO",
    num_samples=32,
    config=env_cfg)

  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/tune/trial_runner.py", line 812, in _process_trial
    results = self.trial_executor.fetch_result(trial)
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/tune/ray_trial_executor.py", line 767, in fetch_result
    result = ray.get(trial_future[0], timeout=DEFAULT_GET_TIMEOUT)
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/_private/client_mode_hook.py", line 89, in wrapper
    return func(*args, **kwargs)
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/worker.py", line 1623, in get
    raise value
ray.exceptions.RayActorError: The actor died because of an error raised in its creation task, ray::PPO.__init__() (pid=1060557, ip=192.168.1.3)
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/rllib/agents/trainer_template.py", line 137, in __init__
    Trainer.__init__(self, config, env, logger_creator)
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/rllib/agents/trainer.py", line 611, in __init__
    super().__init__(config, logger_creator)
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/tune/trainable.py", line 106, in __init__
    self.setup(copy.deepcopy(self.config))
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/rllib/agents/trainer_template.py", line 147, in setup
    super().setup(config)
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/rllib/agents/trainer.py", line 764, in setup
    self._init(self.config, self.env_creator)
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/rllib/agents/trainer_template.py", line 171, in _init
    self.workers = self._make_workers(
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/rllib/agents/trainer.py", line 846, in _make_workers
    return WorkerSet(
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/rllib/evaluation/worker_set.py", line 103, in __init__
    self._local_worker = self._make_worker(
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/rllib/evaluation/worker_set.py", line 399, in _make_worker
    worker = cls(
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/rllib/evaluation/rollout_worker.py", line 583, in __init__
    self._build_policy_map(
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/rllib/evaluation/rollout_worker.py", line 1382, in _build_policy_map
    self.policy_map.create_policy(name, orig_cls, obs_space, act_space,
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/rllib/policy/policy_map.py", line 123, in create_policy
    sess = self.session_creator()
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/ray/rllib/evaluation/worker_set.py", line 316, in session_creator
    return tf1.Session(
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/tensorflow/python/client/session.py", line 1601, in __init__
    super(Session, self).__init__(target, graph, config=config)
  File "/home/anton/miniconda3/envs/rllib/lib/python3.9/site-packages/tensorflow/python/client/session.py", line 711, in __init__
    self._session = tf_session.TF_NewSessionRef(self._graph._c_graph, opts)
MemoryError: std::bad_alloc

Hi @akhodakivskiy , I can’t think of why. It seems you are running conda. Would you please share the conda environment details? This may help.

# packages in environment at /home/anton/miniconda3/envs/rllib:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main
_openmp_mutex             4.5                       1_gnu
absl-py                   0.14.1                   pypi_0    pypi
aiohttp                   3.7.4.post0              pypi_0    pypi
aiohttp-cors              0.7.0                    pypi_0    pypi
aioredis                  1.3.1                    pypi_0    pypi
astunparse                1.6.3                    pypi_0    pypi
async-timeout             3.0.1                    pypi_0    pypi
attrs                     21.2.0                   pypi_0    pypi
blessings                 1.7                      pypi_0    pypi
ca-certificates           2021.9.30            h06a4308_1
cachetools                4.2.4                    pypi_0    pypi
certifi                   2021.10.8        py39h06a4308_0
chardet                   4.0.0                    pypi_0    pypi
charset-normalizer        2.0.7                    pypi_0    pypi
clang                     5.0                      pypi_0    pypi
click                     8.0.3                    pypi_0    pypi
cloudpickle               2.0.0                    pypi_0    pypi
colorful                  0.5.4                    pypi_0    pypi
cycler                    0.10.0                   pypi_0    pypi
dm-tree                   0.1.6                    pypi_0    pypi
filelock                  3.3.0                    pypi_0    pypi
flatbuffers               1.12                     pypi_0    pypi
gast                      0.4.0                    pypi_0    pypi
google-api-core           2.1.0                    pypi_0    pypi
google-auth               1.35.0                   pypi_0    pypi
google-auth-oauthlib      0.4.6                    pypi_0    pypi
google-pasta              0.2.0                    pypi_0    pypi
googleapis-common-protos  1.53.0                   pypi_0    pypi
gpustat                   0.6.0                    pypi_0    pypi
gputil                    1.4.0                    pypi_0    pypi
grpcio                    1.41.0                   pypi_0    pypi
gym                       0.21.0                   pypi_0    pypi
gym-backtest              0.0.1                     dev_0    <develop>
h5py                      3.1.0                    pypi_0    pypi
hiredis                   2.0.0                    pypi_0    pypi
idna                      3.2                      pypi_0    pypi
imageio                   2.9.0                    pypi_0    pypi
jsonschema                4.1.0                    pypi_0    pypi
keras                     2.6.0                    pypi_0    pypi
keras-preprocessing       1.1.2                    pypi_0    pypi
kiwisolver                1.3.2                    pypi_0    pypi
ld_impl_linux-64          2.35.1               h7274673_9
libffi                    3.3                  he6710b0_2
libgcc-ng                 9.3.0               h5101ec6_17
libgomp                   9.3.0               h5101ec6_17
libstdcxx-ng              9.3.0               hd4cf53a_17
lz4                       3.1.3                    pypi_0    pypi
markdown                  3.3.4                    pypi_0    pypi
matplotlib                3.4.2                    pypi_0    pypi
msgpack                   1.0.2                    pypi_0    pypi
multidict                 5.2.0                    pypi_0    pypi
ncurses                   6.2                  he6710b0_1
networkx                  2.6.3                    pypi_0    pypi
numpy                     1.19.5                   pypi_0    pypi
nvidia-ml-py3             7.352.0                  pypi_0    pypi
oauthlib                  3.1.1                    pypi_0    pypi
opencensus                0.8.0                    pypi_0    pypi
opencensus-context        0.1.2                    pypi_0    pypi
openssl                   1.1.1l               h7f8727e_0
opt-einsum                3.3.0                    pypi_0    pypi
pandas                    1.3.3                    pypi_0    pypi
pillow                    8.3.2                    pypi_0    pypi
pip                       21.2.4           py39h06a4308_0
prometheus-client         0.11.0                   pypi_0    pypi
protobuf                  3.18.1                   pypi_0    pypi
psutil                    5.8.0                    pypi_0    pypi
py-spy                    0.3.10                   pypi_0    pypi
pyasn1                    0.4.8                    pypi_0    pypi
pyasn1-modules            0.2.8                    pypi_0    pypi
pyparsing                 2.4.7                    pypi_0    pypi
pyrsistent                0.18.0                   pypi_0    pypi
python                    3.9.7                h12debd9_1
python-dateutil           2.8.2                    pypi_0    pypi
pytz                      2021.3                   pypi_0    pypi
pywavelets                1.1.1                    pypi_0    pypi
pyyaml                    5.4.1                    pypi_0    pypi
ray                       1.7.0                    pypi_0    pypi
readline                  8.1                  h27cfd23_0
redis                     3.5.3                    pypi_0    pypi
requests                  2.26.0                   pypi_0    pypi
requests-oauthlib         1.3.0                    pypi_0    pypi
rsa                       4.7.2                    pypi_0    pypi
scikit-image              0.18.3                   pypi_0    pypi
scipy                     1.7.1                    pypi_0    pypi
setuptools                58.0.4           py39h06a4308_0
six                       1.15.0                   pypi_0    pypi
sqlite                    3.36.0               hc218d9a_0
tabulate                  0.8.9                    pypi_0    pypi
tensorboard               2.6.0                    pypi_0    pypi
tensorboard-data-server   0.6.1                    pypi_0    pypi
tensorboard-plugin-wit    1.8.0                    pypi_0    pypi
tensorboardx              2.4                      pypi_0    pypi
tensorflow                2.6.0                    pypi_0    pypi
tensorflow-estimator      2.6.0                    pypi_0    pypi
tensorflow-gpu            2.6.0                    pypi_0    pypi
termcolor                 1.1.0                    pypi_0    pypi
tifffile                  2021.10.10               pypi_0    pypi
tk                        8.6.11               h1ccaba5_0
typing-extensions         3.7.4.3                  pypi_0    pypi
tzdata                    2021a                h5d7bf9c_0
urllib3                   1.26.7                   pypi_0    pypi
werkzeug                  2.0.2                    pypi_0    pypi
wheel                     0.37.0             pyhd3eb1b0_1
wrapt                     1.12.1                   pypi_0    pypi
xz                        5.2.5                h7b6447c_0
yarl                      1.7.0                    pypi_0    pypi
zlib                      1.2.11               h7b6447c_3

Installed nightly wheel, and all is back to normal. Thanks!