Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

illegal instruction (core dumped) #5

Open
CUN-bjy opened this issue Sep 7, 2020 · 3 comments
Open

illegal instruction (core dumped) #5

CUN-bjy opened this issue Sep 7, 2020 · 3 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@CUN-bjy
Copy link
Owner

CUN-bjy commented Sep 7, 2020

root@9d149295c54a:~# python ant_v1.py 
Illegal instruction (core dumped)

that is roboschool module import problem.
'cause of hardware(e.g. GPU) compatible, you should build again even though you're using container.

@CUN-bjy CUN-bjy self-assigned this Sep 7, 2020
@CUN-bjy
Copy link
Owner Author

CUN-bjy commented Sep 7, 2020

Installation from source

Prerequisites

First, make sure you are installing from a github repo (not a source package on pypi). That is, clone this repo and cd into cloned folder:

git clone https://github.com/openai/roboschool && cd roboschool

The system-level dependencies of roboschool are qt5 (with opengl), boost-python3 (or boost-python if you are compiling with python2), assimp and cmake.
Linux-based distros will need patchelf utility to tweak the runtime paths. Also, some version of graphics libraries is required.
Qt5, assimp, cmake and patchelf are rather straightforward to install:

  • Ubuntu / Debian:

    sudo apt-get install qtbase5-dev libqt5opengl5-dev libassimp-dev cmake patchelf
  • OSX:

    brew install qt assimp cmake

Next, we'll need boost-python3. On osx brew install boost-python3 is usually sufficient, however, on linux it is not always available as a system-level package (sometimes it is available, but compiled against wrong version of python). If you are using anaconda/miniconda, boost-python3 can be installed via conda install boost. Otherwise, do we despair? Of course not! We install it from source!
There is a script install_boost.sh that should do most of the heavy lifting - note that it will need sudo
to install boost-python3 after compilation is done.

Next, need a custom version of bullet physics engine. In both osx and linux its installation is a little involved, fortunately, there is a
helper script install_bullet.sh that should do it for you.
Finally, we also need to set up some environment variables (so that pkg-config knows where has the software been installed) - this can be done via sourcing exports.sh script

To summarize, all the prerequisites can be installed as follows:

  • Ubuntu / Debian:

    sudo apt-get install qtbase5 libqt5opengl5-dev libassimp-dev patchelf cmake
    ./install_boost.sh
    ./install_bullet.sh
    source exports.sh
  • Ubuntu / Debian with anaconda:

    sudo apt-get install qtbase5 libqt5opengl5-dev libassimp-dev patchelf cmake
    conda install boost
    ./install_bullet.sh
    source exports.sh
  • OSX:

    brew install qt assimp boost-python3 cmake
    ./install_bullet.sh
    source exports.sh

To check if that installation is successful, run pkg-config --cflags Qt5OpenGL assimp bullet - you should see something resembling compiler options and not
an error message. Now we are ready to compile the roboschool project itself.

Compile and install

The compiler options are configured in the Makefile. Feel free to tinker with them or leave those as is. To
compile the project code, and then install it as a python package, use the following:

cd roboschool/cpp-household && make clean && make -j4 && cd ../.. && pip install -e .

A simple check if resulting installation is valid:

import roboschool
import gym

env = gym.make('RoboschoolAnt-v1')
while True:
    env.step(env.action_space.sample())
    env.render()

@CUN-bjy
Copy link
Owner Author

CUN-bjy commented Sep 7, 2020

follow above installation guide again.
especially,

./install_boost.sh
./install_bullet.sh
source exports.sh

and

cd roboschool/cpp-household && make clean && make -j4 && cd ../.. && pip install -e .

@CUN-bjy
Copy link
Owner Author

CUN-bjy commented Sep 7, 2020

result:

composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed

????

@CUN-bjy CUN-bjy added the help wanted Extra attention is needed label Sep 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant