-
Notifications
You must be signed in to change notification settings - Fork 11
Headless renderer #14
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
Changes from all commits
8ad2d3f
6173102
ef83b83
8c3723a
49be8b5
59a83a5
10af879
772ae82
3fa414c
43f69bc
37f4282
67ba452
467ce1f
724bb7c
c2ede77
0c9e65b
07ad613
f76587f
f1882c9
610c7f0
7358d6b
25e0cce
65b624e
b3a7477
b33b8ec
0a9a351
4b70f36
b11d2d8
564b4ba
078108a
7c3effd
691eb6f
e615079
ad86c4c
2c33126
7b01b1b
3ffe1ad
7ff403c
d21895c
fc5b597
e93b26a
2f3ce0f
8161954
53ca098
95fa15a
b8913a3
191dec2
1d0bf70
ac11d8c
6d25eb5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
[submodule "lib/irrlichtmt"] | ||
path = lib/irrlichtmt | ||
url = [email protected]:EleutherAI/irrlicht.git | ||
branch = headless-rendering | ||
|
||
[submodule "lib/zmqpp"] | ||
path = lib/zmqpp | ||
url = [email protected]:zeromq/zmqpp.git |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
1. Install prereqs | ||
1. sudo apt-get install xvfb g++ make libzmq3-dev libtool pkg-config build-essential autoconf automake libc6-dev cmake libpng-dev libjpeg-dev libxi-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libzstd-dev libluajit-5.1-dev protobuf-compiler | ||
|
||
2. Build SDL2 | ||
1. clone the SDL2 repo https://github.com/libsdl-org/SDL | ||
2. checkout release-2.26.2 https://github.com/libsdl-org/SDL/tree/release-2.26.2 | ||
3. create a build directory inside the SDL repo | ||
4. cd into it and run ../configure --prefix=/path/to/SDL/dir/build && make && make install | ||
|
||
3. Build zmqpp | ||
1. clone https://github.com/zeromq/zmqpp | ||
2. checkout the develop branch | ||
3. run make | ||
|
||
4. Clone EAI alignment minetest repos | ||
1. clone https://github.com/EleutherAI/minetest | ||
2. checkout the develop branch | ||
3. clone https://github.com/EleutherAI/irrlicht | ||
4. checkout headless-renderer | ||
|
||
5. Clone minetest game spec | ||
1. clone https://github.com/minetest/minetest_game | ||
2. checkout master branch | ||
|
||
5. Establish symlinks | ||
1. cd into minetest/lib | ||
2. rm -r zmqpp irrlichtmt | ||
3. ln -s ../../zmqpp/ zmqpp | ||
4. ln -s ../../irrlicht/ irrlichtmt | ||
5. cd into minetest/games | ||
6. ln -s ../../minetest_game/ minetest_game | ||
|
||
6. Build minetest | ||
1. cd into minetest | ||
2. either run | ||
cmake . -DRUN_IN_PLACE=TRUE -DBUILD_HEADLESS=1 -DSDL2_DIR=<path to SDL repo>/SDL/build/lib/cmake/SDL2/ | ||
or | ||
cmake . -DRUN_IN_PLACE=TRUE -DBUILD_HEADLESS=0 -DSDL2_DIR= | ||
3. run make -j$(nproc) | ||
|
||
7. setup python | ||
1. create a new python conda env or venv (tested with python3.9) | ||
2. pip install gym matplotlib protobuf==3.20.1 psutil zmq | ||
3. cd into the scripts directory and run compile_proto.sh | ||
4. run python -m minetester.scripts.test_loop | ||
|
||
|
||
|
||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,17 @@ set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING | |
# Set some random things default to not being visible in the GUI | ||
mark_as_advanced(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH) | ||
|
||
if(BUILD_CLIENT AND BUILD_HEADLESS) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should not be in both CMakeLists.txt and src/CMakeLists.txt. |
||
find_package(SDL2 REQUIRED NO_DEFAULT_PATH) | ||
# SDL2 exports targets since 2.0.6, but some distributions override config. | ||
if(NOT TARGET SDL2::SDL2) | ||
add_library(SDL2::SDL2 INTERFACE IMPORTED) | ||
set_target_properties(SDL2::SDL2 PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIRS} | ||
INTERFACE_LINK_LIBRARIES ${SDL2_LIBRARIES} | ||
) | ||
endif() | ||
endif() | ||
|
||
if(NOT (BUILD_CLIENT OR BUILD_SERVER)) | ||
message(WARNING "Neither BUILD_CLIENT nor BUILD_SERVER is set! Setting BUILD_SERVER=true") | ||
|
@@ -64,7 +75,6 @@ if(NOT USE_CURL) | |
endif() | ||
endif() | ||
|
||
|
||
option(ENABLE_GETTEXT "Use GetText for internationalization" ${BUILD_CLIENT}) | ||
set(USE_GETTEXT FALSE) | ||
|
||
|
@@ -528,10 +538,12 @@ include_directories(SYSTEM | |
${ZMQ_INCLUDE_DIR} | ||
${ZMQPP_INCLUDE_DIR} | ||
${SQLITE3_INCLUDE_DIR} | ||
${SDL2_INCLUDE_DIR} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed. |
||
${LUA_INCLUDE_DIR} | ||
${GMP_INCLUDE_DIR} | ||
${JSON_INCLUDE_DIR} | ||
${LUA_BIT_INCLUDE_DIR} | ||
${SDL2_INCLUDE_DIR} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed. |
||
) | ||
|
||
if(USE_GETTEXT) | ||
|
@@ -560,16 +572,22 @@ endif() | |
if(BUILD_CLIENT) | ||
add_executable(${PROJECT_NAME} ${client_SRCS} ${extra_windows_SRCS}) | ||
add_dependencies(${PROJECT_NAME} GenerateVersion) | ||
|
||
if(BUILD_HEADLESS) | ||
set(SDL2_TARGET SDL2::SDL2) | ||
endif() | ||
target_link_libraries( | ||
${PROJECT_NAME} | ||
${ZLIB_LIBRARIES} | ||
IrrlichtMt::IrrlichtMt | ||
${SDL2_TARGET} | ||
${ZSTD_LIBRARY} | ||
${ZMQ_LIBRARY} | ||
${ZMQPP_LIBRARY} | ||
${X11_LIBRARIES} | ||
${SOUND_LIBRARIES} | ||
${SQLITE3_LIBRARY} | ||
${SDL2_LIBRARY} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed. |
||
${LUA_LIBRARY} | ||
${GMP_LIBRARY} | ||
${JSON_LIBRARY} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't merge TODO comments.