# Notebook section to set up a gpuowl Google drive folder for a future Colab session # creates subfolder if needed, does git clone or pull as needed for latest commit, make clean/make # it's up to the user to finish setup: # copy the 'gpuowl' elf file to a gpu-model-specific Google drive folder, # set up config.txt, worktodo, etc., primenet.py if using that, # and to use: # launch Colab gpuowl worker sections periodically; # somehow replenish worktodo when needed; # gather and submit results to PrimeNet periodically import os.path from google.colab import drive import sys if not os.path.exists('/content/drive/My Drive'): !echo drive mount drive.mount('/content/drive') !cd '/content/drive/My Drive/' !chmod +rw '/content/drive/My Drive' !echo ls -l '/content/drive/My Drive/' !ls -l '/content/drive/My Drive/' if not os.path.exists('/content/drive/My Drive/gpuowl'): !mkdir '/content/drive/My Drive/gpuowl' !chmod +rw '/content/drive/My Drive/gpuowl' !cd '/content/drive/My Drive/gpuowl/' if os.path.isfile('/content/drive/My Drive/gpuowl/gpuowl/Gpu.h'): #doesn't do wildcards !echo found Gpu.h file, git pull !git pull https://github.com/preda/gpuowl else: !echo no Gpu.h file in /content/drive/My Drive/gpuowl/gpuowl, git clone !git clone https://github.com/preda/gpuowl !echo ls -l '/content/drive/My Drive/gpuowl/' !ls -l '/content/drive/My Drive/gpuowl/' %cd '/content/drive/My Drive/gpuowl/gpuowl//' !chmod +rw '/content/drive/My Drive/gpuowl/gpuowl' !echo ls -l '/content/drive/My Drive/gpuowl/gpuowl/' !ls -l '/content/drive/My Drive/gpuowl/gpuowl/' print('set up/update compile environment:') !apt install libgmp-dev !update-alternatives --remove-all gcc !update-alternatives --remove-all g++ !apt-get install gcc-8 g++-8 !update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 10 !update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 10 !update-alternatives --config gcc !update-alternatives --config g++ !g++ --version if os.path.isfile('/content/drive/My Drive/gpuowl/gpuowl/Gpu.o'): !echo make clean !make clean !make gpuowl !echo ls -l '/content/drive/My Drive/gpuowl/gpuowl/' !ls -l '/content/drive/My Drive/gpuowl/gpuowl/' !echo create config.txt, worktodo.txt before continuing