Coder Social home page Coder Social logo

Comments (10)

edran avatar edran commented on May 18, 2024

Hijacking this issue to ask for some clarification about the lua API: as far as I can see, right now lua_api.md and tensor.md are providing a basic lua interface, however it doesn't seem to be particularly built around Torch.

Are you planning to add a full Torch interface any time soon? Otherwise I might put some effort in writing a wrapper over the next couple of weeks.

from lab.

tkoeppe avatar tkoeppe commented on May 18, 2024

@edran: Although I can't promise how the future will play out, I believe that at the moment we have no plans to offer actual Torch bindings. The API was designed with the goal of familiarity and simplicity, not interoperability.

from lab.

edran avatar edran commented on May 18, 2024

Fair enough :)

from lab.

MrGoogol avatar MrGoogol commented on May 18, 2024

My machine seems to meet all requirements and even tensorflow library imports in python2.7. But I don't get how to install OpenGL because I opted out when installing cuda. I am using Ubuntu16.04 and GTX card. Thank you.

from lab.

tkoeppe avatar tkoeppe commented on May 18, 2024

Update: I added experimental Python 3 support to the Python extension. See 3fd8582 for a demo of Python code that can run under both Py2 and Py3. Note that in Py3, strings coming out of the DMLab environment (e.g. string observations produced by Lua scripts) need to be valid UTF-8.

Please consult the Bazel documentation for how to select a Python version for py_binary and py_test targets (https://docs.bazel.build/versions/master/be/python.html#py_binary_args). You may want to set the default_python_version attribute.

from lab.

tkoeppe avatar tkoeppe commented on May 18, 2024

Update: I've put together a few commits that might enable a few useful things on macOS in the new "macos" branch.

To try it out, grab the branch and adjust the library paths in WORKSPACE to match your system (presumably to find your homebrew library installations). You should be able to run the levels with windowed output, e.g.:

bazel run -c opt --define graphics=sdl //:game -- --level_script lt_chasm
bazel run -c opt --define graphics=sdl //:python_random_agent -- --length=10000 --width=640 --height=480

This was all pretty straightforward. What doesn't work is the "headless" mode that you will most likely want to train agents efficiently, and that's where the hard part lies.

All of this is only very poorly tested and documented, so don't be surprised if something doesn't work. We don't really have the means to develop or test this, so rather than sending bug reports, please send pull requests that fix things, or at least precise descriptions of what goes wrong.

Things that are currently missing or broken:

  • None of the existing headless renderers work (OSMesa, EGL, GLX). This may just be a matter of installing the right dependencies.

  • There was a proposed native renderer in #76, but I'm not sure if it's working right, or at all.

  • I think text map compilation doesn't work, but I'm not sure why.

  • There seems to be a linking problem whereby our own MD5 library is mistakenly not used and instead the system's OpenSSL library is used, which then crashes. This can perhaps be avoided via --dynamic_mode=off, but then that might not work with SDL.

  • Remember to always pass --apple_platform_type=macos to all Bazel invocations.

from lab.

MrQbit avatar MrQbit commented on May 18, 2024

For OSMesa you need at least one of these drivers: swrast, softpipe, llvmpipe or swr (SWR is not yet supported on macOS, so avoid --with-gallium-drivers=swrast ).
For GLX, run this command defaults write org.macosforge.xquartz.X11 enable_iglx -bool true (it worked for me on Mojave).
EGL I have not done anything about yet.

from lab.

tkoeppe avatar tkoeppe commented on May 18, 2024

@MrQbit: Thanks! Do you know how I get <GL/glext.h> to be found? I added the linker option -framework OpenGL to //:game_lib_headless_glx, but I still don't find the header. It does exist on disk at /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/glext.h.

Also, are there any relatively "natural" ways to install OSMesa plus drivers on macOS?

from lab.

MrQbit avatar MrQbit commented on May 18, 2024

I am trying to reproduce the issue with the header file.

Your question about OSMesa, I do not know of any native method, to make it worse OpenGL support in MacOS is deprecated, the renderer is Metal, Metal 2 in Mojave.
I am new with lab trying to go through the code to see if I can find a cleaner way.

from lab.

tkoeppe avatar tkoeppe commented on May 18, 2024

Thank you -- it's by no means necessary or important to have OSMesa. We just need one headless renderer, and the alternatives besides OSMesa are EGL, GLX (?) and whatever native API macOS has. As you can see from the branch, and from #76, we have a proposal for some sort of native renderer, but it doesn't seem to quite work, and it's suspicious that it's missing thread switching logic.

from lab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.