You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi, I was able to get progcen works on my macbook M1 by doing the following:
Install glfw with homebrew (and make sure the lib path is in DYLD_LIBRARY_PATH)
modify the march=native to mcpu=lightning in the cmake configuration file ...
It is quite an easy fix, so may be good if you want to implement it ...
@olmoulin Hi, and thanks for the solution you mentioned!
However, since I'm novice to mac computer, can you elaborate what is the lib path here and
let me know where is the cmake configuration file you mentioned?
If mcpu=lightning doesn't work, you can try mcpu=apple-m1. That worked for me. You can check available cpus with the command clang --print-supported-cpus
mcpu=lightning does not work for me too. I tried changing to mcpu=apple-m1. But I got the following errors. Has anyone encountered the same? Is this related to some version issues? I am using python3.8 if it helps.
building procgen...RUN FAILED ['cmake', '--build', '.', '--config', 'relwithdebinfo']:
[ 3%] Building CXX object CMakeFiles/env.dir/src/assetgen.cpp.o
[ 6%] Building CXX object CMakeFiles/env.dir/src/cpp-utils.cpp.o
[ 13%] Building CXX object CMakeFiles/env.dir/src/game.cpp.o
[ 13%] Building CXX object CMakeFiles/env.dir/src/entity.cpp.o
[ 16%] Building CXX object CMakeFiles/env.dir/src/game-registry.cpp.o
[ 20%] Building CXX object CMakeFiles/env.dir/src/games/bigfish.cpp.o
[ 23%] Building CXX object CMakeFiles/env.dir/src/basic-abstract-game.cpp.o
[ 26%] Building CXX object CMakeFiles/env.dir/src/games/dodgeball.cpp.o
[ 30%] Building CXX object CMakeFiles/env.dir/src/games/bossfight.cpp.o
[ 33%] Building CXX object CMakeFiles/env.dir/src/games/caveflyer.cpp.o
[ 36%] Building CXX object CMakeFiles/env.dir/src/games/climber.cpp.o
[ 40%] Building CXX object CMakeFiles/env.dir/src/games/coinrun_old.cpp.o
[ 43%] Building CXX object CMakeFiles/env.dir/src/games/coinrun.cpp.o
[ 46%] Building CXX object CMakeFiles/env.dir/src/games/fruitbot.cpp.o
[ 50%] Building CXX object CMakeFiles/env.dir/src/games/heist.cpp.o
[ 53%] Building CXX object CMakeFiles/env.dir/src/games/jumper.cpp.o
[ 56%] Building CXX object CMakeFiles/env.dir/src/games/leaper.cpp.o
[ 60%] Building CXX object CMakeFiles/env.dir/src/games/maze.cpp.o
[ 63%] Building CXX object CMakeFiles/env.dir/src/games/miner.cpp.o
[ 66%] Building CXX object CMakeFiles/env.dir/src/games/ninja.cpp.o
[ 70%] Building CXX object CMakeFiles/env.dir/src/games/chaser.cpp.o
[ 73%] Building CXX object CMakeFiles/env.dir/src/games/plunder.cpp.o
[ 76%] Building CXX object CMakeFiles/env.dir/src/games/starpilot.cpp.o
[ 80%] Building CXX object CMakeFiles/env.dir/src/mazegen.cpp.o
[ 83%] Building CXX object CMakeFiles/env.dir/src/randgen.cpp.o
/mydir/procgen/procgen/src/games/chaser.cpp:296:13: error: variable 'num_orbs' set but not used [-Werror,-Wunused-but-set-variable]
int num_orbs = 0;
^
[ 86%] Building CXX object CMakeFiles/env.dir/src/roomgen.cpp.o
[ 90%] Building CXX object CMakeFiles/env.dir/src/resources.cpp.o
[ 93%] Building CXX object CMakeFiles/env.dir/src/vecgame.cpp.o
1 error generated.
make[2]: *** [CMakeFiles/env.dir/src/games/chaser.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/mydir/procgen/procgen/src/games/starpilot.cpp:231:18: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
for (int i = 0; t <= SHOOTER_WIN_TIME; i++) {
^
1 error generated.
make[2]: *** [CMakeFiles/env.dir/src/games/starpilot.cpp.o] Error 1
make[1]: *** [CMakeFiles/env.dir/all] Error 2
make: *** [all] Error 2
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/mydir/procgen/procgen/env.py", line 246, in __init__
super().__init__(num, env_name, options, **kwargs)
File "/mydir/procgen/procgen/env.py", line 96, in __init__
lib_dir = build(debug=debug)
File "/mydir/procgen/procgen/builder.py", line 138, in build
check(run(build_cmd), verbose=package)
File "/mydir/procgen/procgen/builder.py", line 47, in check
raise RunFailure("failed to build procgen from source")
procgen.builder.RunFailure: failed to build procgen from source
@raymondchua this seems to be a breaking behavior of c compiler clang from 12 to 13 (my up-to-date M1 Mac's clang is 14) mentioned elsewhere. I bypassed it by adding another flag to CMakeLists.txt. Let me make a quick PR.
Activity
christopherhesse commentedon Jan 14, 2022
I don't have an M1 mac but would accept a PR that improved support for M1. cibuildwheel https://cibuildwheel.readthedocs.io/en/stable/#what-does-it-do says it supports apple silicon, so there's probably some way to make the github actions workflow build a wheel for that platform.
[-]Not an issue, just a suggestion[/-][+]Apple Silicon Support[/+]heyzude commentedon Feb 9, 2022
@olmoulin Hi, and thanks for the solution you mentioned!
However, since I'm novice to mac computer, can you elaborate what is the lib path here and
let me know where is the cmake configuration file you mentioned?
Thank you :)
skezle commentedon Apr 25, 2022
Thanks for the answer above!
I found this worked for me without editing the CMakeLists.txt file.
Changes to support Apple M1
jhsul commentedon Mar 14, 2023
If
mcpu=lightningdoesn't work, you can trymcpu=apple-m1. That worked for me. You can check available cpus with the commandclang --print-supported-cpusraymondchua commentedon Apr 19, 2023
mcpu=lightningdoes not work for me too. I tried changing tomcpu=apple-m1. But I got the following errors. Has anyone encountered the same? Is this related to some version issues? I am using python3.8 if it helps.raymondchua commentedon Apr 19, 2023
Ok, I manage to fix the errors I had by commenting out the following lines in chaser.cpp:296:
// int num_orbs = 0;and chaser.cpp:306://num_orbs++;And by replacing cpp:231:18 in starpilot.cpp with:
while (t <= SHOOTER_WIN_TIME) {falcondai commentedon May 3, 2023
@raymondchua this seems to be a breaking behavior of c compiler
clangfrom 12 to 13 (my up-to-date M1 Mac's clang is 14) mentioned elsewhere. I bypassed it by adding another flag to CMakeLists.txt. Let me make a quick PR.fix compilation error in openai#69
raymondchua commentedon May 3, 2023
Thanks for following up, @falcondai. My clang version:
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.4.0