0

I am trying to use the library envpool to parallelize OpenAI gym environments. I run the simplest example provide by envpool, which looks as follows:

env = envpool.make('HalfCheetah-v3', env_type='gym', num_envs=100)
obs = env.reset()
act - np.zeros((100, 6))
obs, rew, done, info = env.step(act, env_id=np.arange(100))

It works as in it produces the desired output, but it also throws the following:

Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot 
open shared object file: No such file or directory; LD_LIBRARY_PATH:
:/home/user/.mujoco/mujoco210/bin:/usr/lib/nvidia:/home/user/.mujoco/mujoco210/bin:/usr/lib/nvidia

Moreover, when I run echo $LD_LIBRARY_PATH I get the same directory. Why is it duplicated and how to fix it? My .bashrc is as follows:

export PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/user/.mujoco.mujoco210/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/nvidia

I already tried a couple of things, such as appending both paths to one or this answer, but nothing changes.

Schach21
  • 412
  • 4
  • 21
  • 1
    at a minimum: add `typeset -p LD_LIBRARY_PATH` before and after the pair of `export LD_LIBRARY_PATH=` lines; objective being to see what's in `LD_LIBRARY_PATH` before/after the explicit assignments; if the two `typeset -p` calls show everything's ok then there would appear to be an issue downstream; in the case of something resourcing `.bashrc` you should receive 4 sets of `typeset -p` output; I don't work with `python` but I'm assuming you could add some debug statements to look at the contents of `LD_LIBRARY_PATH` at different steps in the process ... ? – markp-fuso Jul 05 '22 at 16:47
  • You really don't want that leading `:`. Either specify the value completely, or append with `LD_LIBRARY_PATH+=${LD_LIBRARY_PATH:+:}new_path` You also want to ensure you're not adding values that are already there. – William Pursell Jul 05 '22 at 17:30
  • @markp-fuso I did that. The first ```typeset -p``` actually prints the desired path, whereas the second (after both ```export``` statements) prints the duplicated path. I don't know why/how ```LD_LIBRARY_PATH``` is set to the correct path before the ```export``` statements. On the other hand, even after I get the correct path, I still get the same error/warning about ```Could not load... No such file or directory;```. – Schach21 Jul 05 '22 at 17:51
  • 1
    it's not clear from what you've posted (in question, in comment) so I'll ask the basic questions ... have you verified *if* the file `libcudart.so.11.0` exists *and* if if does exist does it exist in one of the directories listed in your `LD_LIBRARY_PATH`? as for how `LD_LIBRARY_PATH` is initially set .... initial guess would be `.bashrc` is being sourced twice (perhaps with one source redirecting stdout to `/dev/null` so as to mask one set of `typeset -p` output) ... ? – markp-fuso Jul 05 '22 at 18:02
  • 1
    I actually had just assumed it exists because I installed the nvidia drivers, but after checking, I couldn't find it. Sorry about that. Thanks for your help though! – Schach21 Jul 05 '22 at 18:18

0 Answers0