Skip to content
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

add install instructions for Ubuntu, Mac and Windows in the README.md #50

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

techmore
Copy link

This add brew install instructions for ffmpeg otherwise it will setup initially but fail after sometimes with error :

RuntimeError: Program 'ffmpeg' is not found; perhaps install ffmpeg using 'apt-get install ffmpeg'.

This add brew install instructions for ffmpeg otherwise it will setup initially but fail after sometimes with error :

RuntimeError: Program 'ffmpeg' is not found; perhaps install ffmpeg using 'apt-get install ffmpeg'.
@techmore techmore changed the title Update README.md add ffmpeg install instructions for apple in README.md Oct 16, 2023
@PWhiddy
Copy link
Owner

PWhiddy commented Oct 16, 2023

Thanks, we do need something mentioning that ffmpeg has to be installed. However until there are specific instructions each for mac/linux/windows this should be platform agnostic not mac only.

Copy link
Author

@techmore techmore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added instructions for Windows Mac and Linux.
Windows seemed to require an installer and not a single command unfortunately.
Screenshot 2023-10-17 at 11 42 20 AM

@PWhiddy PWhiddy added the documentation Improvements or additions to documentation label Oct 19, 2023
@techmore
Copy link
Author

I think this feature should probably grow to be better documentation for all platforms for an easier start. I should be able to test on Ubuntu and Windows 11 this weekend.

Adding a file like this seems to like me create a fresh conda environment and install dependancies to run the code and avoids needing pip -r install requirements which seems Ubuntu specific at this time.

(base) baselines/Techmore$ cat mac_run.sh
#!/bin/bash

conda create -n poke python=3.11
conda activate poke

pip install numpy einops matplotlib scikit-image pyboy hnswlib mediapy pandas gymnasium stable-baselines3 tensorflow tensorboard

(base) baselines/Techmore$

@PWhiddy
Copy link
Owner

PWhiddy commented Oct 20, 2023

Would love to have a comprehensive setup guide for each platform!

@techmore techmore changed the title add ffmpeg install instructions for apple in README.md add install instructions for Ubuntu, Mac and Windows in the README.md Oct 20, 2023
@techmore
Copy link
Author

techmore commented Oct 21, 2023

Updating this topic. I've been able to confirm a nearly 1 line install on most system. Ubuntu ARM / x86 via Multipass, Mac ARM, and Windows x86 through WSL. This code base also download Pokemon Red from archive.org and places it in roms/ in the root and allows ./install.sh to work from root by changes the rom and state locations.

This setup does not use env, conda or anything so it affects your native installed software. It uses sudo, you should read it before running it.

Windows users must install WSL and change there Memory and Processor value to match there desired environment
wsl --install
notepad "$env:USERPROFILE\.wslconfig"

[wsl2]
memory=32GB  
processors=12

1 liner to install

git clone https://github.com/techmore/PokemonRedExperiments.git; cd PokemonRedExperiments; wget https://archive.org/download/INSERT URL HERE; mv "Pokémon Red Version.gb" roms/PokemonRed.gb;./install.sh

install.sh

#!/bin/bash

# Windows native ARM appears to not be supported at this time, Windows native ARM WSL(2) works!
# Ubuntu is tested on M1 mac with multipass and works! Ubuntu ARM needs torch nightly to run
# Mac tested on ARM

# create Multipass environment for testing
# multipass launch --name poke --cpus 4 --memory 8gb --disk 100g; multipass exec poke bash
# multipass delete poke; multipass purge; multipass launch --name poke --cpus 4 --memory 8gb --disk 100g; multipass exec poke bash

#1 liner for installs
# git clone https://github.com/techmore/PokemonRedExperiments.git; cd PokemonRedExperiments; wget https://archive.org/download/pokemon-red-version/Pokémon%20Red%20Version.gb; mv "Pokémon Red Version.gb" roms/PokemonRed.gb;./install.sh

# Check the operating system and store the result in a variable
system=$(python3 -c "import platform; print(platform.system())")

if [ "$system" == "Linux" ]; then
    echo "You are in an Linux environment."
    # Ubuntu section - Tested on M1 with Multipass
    # wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh; chmod -v +x Miniconda*.sh; ./Miniconda3-latest-Linux-aarch64.sh
    # conda create -n poke python=3.11
    # conda activate poke
    sudo apt update -y
    sudo apt install libsdl2-dev ffmpeg python3-pip zip -y
    if uname -a | grep -q "aarch64" || uname -a | grep -q "arm64"; then
        # arm needs to reinstall torch with arm support from nightly
        python3 -m pip uninstall torch; python3 -m pip install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
    fi
    python3 -m pip install numpy einops matplotlib scikit-image pyboy hnswlib mediapy pandas gymnasium stable-baselines3 tensorflow tensorboard
    echo -e '\n\nInstallation complete, please run the following command to start training!'
    echo 'python3 baselines/run_baseline_parallel.py'
else
    echo "You are in a macOS (Mac) environment."
    # Mac ARM tested
    # running git clone... will force mac to install git automatically
    
    if command -v brew &> /dev/null; then
        brew install ffmpeg
    else
        /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
        (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/student/.zprofile 
        eval "$(/opt/homebrew/bin/brew shellenv)"
    fi

    #if uname -a | grep -q "arm64"; then
        #wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh
        #./Miniconda3-latest-MacOSX-arm64.sh
    #else
        #wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
        #./Miniconda3-latest-MacOSX-x86_64.sh
    #fi
    
    /Library/Developer/CommandLineTools/us/bin/python3 -m pip install —-upgrade pip
    echo 'Installing dependencies via pip ...'
    pip3 install numpy einops matplotlib scikit-image pyboy hnswlib mediapy pandas gymnasium stable-baselines3 tensorflow tensorboard

    echo -e '\n\n Installation complete, closing out your terminal and when you reopen use the following command to begin training!'
    echo 'brew install ffmpeg; python3 baselines/run_baseline_parallel.py'
fi

# To run python run_baseline_parallels.py we need to edit the PokemonRed.gb locate var since I want to run the command from the root directory
#argparse_pokemon.py, 
#has_pokedex_nballs.state
# Move saved states to saved_states

# wsl --install
# you must reboot
# wsl --set-default-version 2
# https://dev.to/abhijithganesh/how-to-configure-your-wsl-resources-594m

4. Install ffmpeg on Windows, Mac and Linux
<br>Windows installer found <a href="https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z">here</a>
<br>Mac instructions
<br>```brew install ffmpeg -y```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use MacPorts:
sudo port install ffmpeg

@CrizzlyR
Copy link

CrizzlyR commented Nov 8, 2023

Excited to start programming

No intention here to spam but might like notice of something -

to avoid discrepancy I'll begin on topic.

Seems as though this wouldn't require installation. Don't you detail the code on the video and as my knowledge barely consists of some html at the moment, I'm under the impression you just save it jpeg cxi html etc and you get the program.

That being said, my problem is outlined as such and Cc... Lol >>>

Attempting maniacally to provide particular feedback and have enjoyed the navigation of the site no less however, I have been unsuccessful other than within the bounds of commentary.

I have input on the "AI" implications.

I'll make them available here but what can I do to get the notes into collaboration?

Pasting from an attempt>>>

First "pull request" certainly open to feedback towards where suggestions are considered... To begin with:

1 you are simulating the game and it is credit to the game's remarkable functionality

2 you are in construction of a fractal though going off base when interrupting and taking back direct control of the emulator - you severely need to let it play through for a conclusive result requiring much higher processing to isolate bugs. The "conclusive result" is plural and would contain a variety of them if produced with game and not on emulator - in reference to psychology and projected uncontrolled variables and if-so-facto, there would be no repeat of captures without damage as original is sustainably random and ROM is copy of a single playthrough or chain of events*

3 the fractal is functional entirely from control of the parameters of the reinforced (incentivized) learning and taking it over produces 2 incomplete theories.

4 you want much more processing power to run the simulation to the next bug for data analysis. You don't need to observe the button sequencing immediately, nor playthrough or "story" (elegantly eloquent determination), because it works as a controlled variable and the "story" is the end result, sculpture, or the actual analysis. Once the game is played through, then a determination of the button sequence and story might enhance the outcome's complexity. It produces, not necessarily a V intelligence for one npc, but a stratagem that could model out gameplay that might entirely redeem the whole dynamic on evolution that is sending the game off.... As per psychology on the game and staying on topic.

*A fact check might be useful on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants