Skip to content

Commit

Permalink
Updated GpuOwl notebook to install the old Nvidia drivers.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdulcet committed Jul 9, 2024
1 parent 8b03cef commit bf8dce4
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 91 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Before script
run: |
sed -i '/^GPU=/,/^fi/ s/^/# /' gpuowl.sh
[[ $CXX =~ ^clang ]] && sed -i 's/-O3 -flto/-O3/' gpuowl.sh
[[ $CXX == clang* ]] && sed -i 's/-O3 -flto/-O3/' gpuowl.sh
sed -i '/^nohup / s/^/# /' gpuowl.sh
sed -i '/^python3 -OO / s/^/# /' gpuowl.sh
$CXX --version
Expand Down Expand Up @@ -186,6 +186,7 @@ jobs:
sysctl -n hw.physicalcpu_max hw.logicalcpu_max
sysctl -n hw.cpufrequency hw.cpufrequency_max hw.tbfrequency kern.clockrate
sysctl -n hw.memsize
sysctl -n hw.l1dcachesize hw.l2cachesize hw.l3cachesize
python3 -X dev -c 'import platform; print(platform.mac_ver())'
python3 -X dev primenet.py --help
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Copyright © 2018 Teal Dulcet and Daniel Connelly

### Prime95/MPrime

Downloads, sets up and runs [Prime95](https://www.mersenne.org/download/#download). Supports only x86 CPUs.
Downloads, sets up and runs [Prime95/MPrime](https://www.mersenne.org/download/#download). Supports only x86 CPUs.

```
wget -qO - https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/mprime.sh | bash -s -- [PrimeNet User ID] [Computer name] [Type of work] [Idle time to run (mins)]
```

To run Prime95 for Stress/Torture Testing, see the [Testing and Benchmarking](https://github.com/tdulcet/Testing-and-Benchmarking-Scripts) scripts.
To run MPrime for Stress/Torture Testing, see the [Testing and Benchmarking](https://github.com/tdulcet/Testing-and-Benchmarking-Scripts) scripts.

### CUDALucas

Expand Down Expand Up @@ -325,6 +325,7 @@ PrimeNet program/script:
* Support reporting interim residues.
* Calculate the rolling average.
* Support downloading certification assignments.
Requires support from one of more of the GIMPS programs.
* Localize the output into other languages (see [here](https://mersenneforum.org/showthread.php?t=27046)).
* Adapt Loïc Le Loarer's [test suite](https://github.com/llloic11/primenet/tree/main/tests).
* Add an optional GUI using [Tk](https://en.wikipedia.org/wiki/Tk_(software)) and the [tkinter library](https://docs.python.org/3/library/tkinter.html)
Expand All @@ -343,7 +344,7 @@ General:

The scripts are all MIT licensed, except the PrimeNet program which is GPLv2.

Thanks to [Daniel Connelly](https://github.com/Danc2050) for updating the PrimeNet Python script from Mlucas to eliminate the password requirement by getting assignments using the [PrimeNet API](http://v5.mersenne.org/v5design/v5webAPI_0.97.html) and to support reporting the assignment results and progress for CUDALucas using the PrimeNet API, for porting the Prime95 script to Python and for helping create and test the Google Colab Jupyter Notebooks!
Thanks to [Daniel Connelly](https://github.com/Danc2050) for updating the PrimeNet Python script from Mlucas to eliminate the password requirement by getting assignments using the [PrimeNet API](http://v5.mersenne.org/v5design/v5webAPI_0.97.html) and to support reporting the assignment results and progress for CUDALucas using the PrimeNet API, for porting the MPrime script to Python and for helping create and test the Google Colab Jupyter Notebooks!

Thanks to Ernst W. Mayer for helping test and for providing feedback on the Mlucas install script.

Expand Down
7 changes: 4 additions & 3 deletions cudalucas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ sed -i 's/\r//g' Makefile
sed -i 's/^OptLevel = 1/OptLevel = 3/' Makefile
CUDA=$(command -v nvcc | sed 's/\/bin\/nvcc$//')
sed -i "s/^CUDA = \/usr\/local\/cuda/CUDA = ${CUDA//\//\\/}/" Makefile
sed -i 's/--compiler-options=-Wall/--compiler-options="-O$(OptLevel) -flto -Wall"/' Makefile
sed -i 's/--compiler-options=-Wall/-use_fast_math --compiler-options="-O$(OptLevel) -flto -Wall"/' Makefile
CC=$(command -v "${CC:-gcc}")
# sed -i "/^CUFLAGS / s/\$/ -ccbin ${CC//\//\\/}/" Makefile # -dlto
sed -i '/^CFLAGS / s/$/ -flto/' Makefile
Expand All @@ -109,10 +109,11 @@ cat <<EOF >/tmp/cudaComputeVersion.cu
#include <stdio.h>
int main()
{
const int device = $DEVICE;
cudaDeviceProp prop;
cudaError_t status = cudaGetDeviceProperties(&prop, $DEVICE);
cudaError_t status = cudaGetDeviceProperties(&prop, device);
if (status != cudaSuccess) {
fprintf(stderr, "cudaGetDeviceProperties() for device $DEVICE failed: %s\n", cudaGetErrorString(status));
fprintf(stderr, "cudaGetDeviceProperties() for device %d failed: %s\n", device, cudaGetErrorString(status));
return 1;
}
const int v = prop.major * 10 + prop.minor;
Expand Down
7 changes: 4 additions & 3 deletions cudalucas2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ else
sed -i 's/^OptLevel = 1/OptLevel = 3/' Makefile
CUDA=$(command -v nvcc | sed 's/\/bin\/nvcc$//')
sed -i "s/^CUDA = \/usr\/local\/cuda/CUDA = ${CUDA//\//\\/}/" Makefile
sed -i 's/--compiler-options=-Wall/--compiler-options="-O$(OptLevel) -flto -Wall"/' Makefile
sed -i 's/--compiler-options=-Wall/-use_fast_math --compiler-options="-O$(OptLevel) -flto -Wall"/' Makefile
CC=$(command -v "${CC:-gcc}")
# sed -i "/^CUFLAGS / s/\$/ -ccbin ${CC//\//\\/}/" Makefile # -dlto
sed -i '/^CFLAGS / s/$/ -flto/' Makefile
Expand All @@ -95,10 +95,11 @@ else
#include <stdio.h>
int main()
{
const int device = $DEVICE;
cudaDeviceProp prop;
cudaError_t status = cudaGetDeviceProperties(&prop, $DEVICE);
cudaError_t status = cudaGetDeviceProperties(&prop, device);
if (status != cudaSuccess) {
fprintf(stderr, "cudaGetDeviceProperties() for device $DEVICE failed: %s\n", cudaGetErrorString(status));
fprintf(stderr, "cudaGetDeviceProperties() for device %d failed: %s\n", device, cudaGetErrorString(status));
return 1;
}
const int v = prop.major * 10 + prop.minor;
Expand Down
26 changes: 13 additions & 13 deletions google-colab/Colab CPU MPrime.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"\n",
"# @markdown #### ↖️ Click the ▶️ button after deciding on the options below.\n",
"# @markdown #### 💡 Keep each notebook **open** in the browser to prevent disconnection. 📌 [the tab](https://support.mozilla.org/kb/pinned-tabs-keep-favorite-websites-open) or move them to a dedicated window for easy access.\n",
"# @markdown #### ℹ️ This notebook uses our Prime95 [Bash install script](https://github.com/tdulcet/Distributed-Computing-Scripts#organizations).\n",
"# @markdown #### ℹ️ This notebook uses our MPrime [Bash install script](https://github.com/tdulcet/Distributed-Computing-Scripts#organizations).\n",
"# @markdown #### 📜 Please see the [documentation](https://github.com/tdulcet/Distributed-Computing-Scripts/tree/master/google-colab) for more information and to ❤️ support us.\n",
"# @markdown #### 🤷 Optionally, create a GIMPS/PrimeNet account [here](https://www.mersenne.org/update/) and [join](https://www.mersenne.org/jteam/) the “Portland State University” team!\n",
"\n",
Expand All @@ -46,7 +46,7 @@
"proof_certification_work = True # @param {type:\"boolean\"}\n",
"computer_number = 'Default (1)' # @param ['Default (1)', '2', '3', '4']{allow-input: true}\n",
"local_time = 'Pacific' # @param ['Pacific', 'Mountain', 'Central', 'Eastern', 'Alaska', 'Hawaii']\n",
"debug = 'False' # @param ['False', 'CPU (Prime95)']\n",
"debug = 'False' # @param ['False', 'CPU (MPrime)']\n",
"\n",
"# @markdown #### 🐛 The *debug* option outputs CPU (Prime95/MPrime) progress and status, then exits.\n",
"\n",
Expand All @@ -63,7 +63,7 @@
" else: # use our notebook\n",
" print('Warning: Google Drive is not mounted')\n",
" print(\n",
" 'If you were not expecting this, on the far left click the folder icon, the \"Mount Drive\" folder button, select \"CONNECT TO GOOGLE DRIVE\" '\n",
" 'If you were not expecting this, on the far left click the folder icon, the \"Mount Drive\" folder button, select \"Connect to Google Drive\" '\n",
" )\n",
" print('and then re-execute this cell.')\n",
" from google.colab import drive\n",
Expand All @@ -79,31 +79,31 @@
"def run():\n",
" '''Run MPrime.'''\n",
" os.chmod('mprime_cpu/mprime', 0o777)\n",
" print('\\nStarting Prime95\\n')\n",
" print('\\nStarting MPrime\\n')\n",
" !cd mprime_cpu && ./mprime -A{computer_number} -d | tee -ia '{'cpu' + computer_number + '.out'}'\n",
"\n",
"\n",
"def debug_exit():\n",
" '''Output of Prime95 CPU outputs.'''\n",
" if debug == 'CPU (Prime95)' and os.path.exists(f'mprime_cpu/cpu{computer_number}.out'):\n",
" print('\\nCPU (Prime95) output:\\n')\n",
" '''Output of MPrime CPU outputs.'''\n",
" if debug.startswith('CPU') and os.path.exists(f'mprime_cpu/cpu{computer_number}.out'):\n",
" print('\\nCPU (MPrime) output:\\n')\n",
" !tail -n 100 '{'mprime_cpu/cpu' + computer_number + '.out'}' # view MPrime progress\n",
" os.chmod('mprime_cpu/mprime', 0o777)\n",
" !cd mprime_cpu && ./mprime -s -A{computer_number}\n",
" print()\n",
" else:\n",
" print(f'No `{debug!r}` output file found for debug option and computer number `{computer_number!r}`.\\n')\n",
" print(f'No {debug!r} output file found for debug option and computer number {computer_number!r}.\\n')\n",
"\n",
"\n",
"def install():\n",
" '''Download/Install/Configure Prime95.'''\n",
" '''Download/Install/Configure MPrime.'''\n",
" !wget -nv -O master.zip https://github.com/tdulcet/Distributed-Computing-Scripts/archive/master.zip\n",
" !unzip -o master.zip\n",
" print('\\nDownloading and setting up Prime95\\n')\n",
" print('\\nDownloading and setting up MPrime\\n')\n",
" !cp Distributed-Computing-Scripts-master/{mprime2.sh,mprime2.exp,idletime.sh} .\n",
" !sed -i 's/\"mprime\"/\"mprime_cpu\"/' mprime2.sh # Name the folder specific to the runtime type\n",
" !sed -i '/^\\.\\/mprime / s/^/echo \"Skipped\" # /' mprime2.sh # Do not start Prime95\n",
" !sed -i '/^nohup / s/^/echo \"Skipped\" # /' mprime2.sh # Do not start Prime95\n",
" !sed -i '/^\\.\\/mprime / s/^/echo \"Skipped\" # /' mprime2.sh # Do not start MPrime\n",
" !sed -i '/^nohup / s/^/echo \"Skipped\" # /' mprime2.sh # Do not start MPrime\n",
" !sed -i '/^expect {/a \\\\t\"Max emergency memory in GiB/worker (*):\" { sleep 1; send -- \"3\\\\r\"; exp_continue }\\n\\t\"Get occasional proof certification work (*):\" { sleep 1; send -- \"PROOF_CERTIFICATION_WORK\\\\r\"; exp_continue }\\n\\t\"Minutes between disk writes (*):\" { sleep 1; send -- \"10\\\\r\"; exp_continue }\\n\\t\"Days of work to queue up (*):\" { sleep 1; send -- \"1\\\\r\"; exp_continue }' mprime2.exp\n",
" !sed -i 's/PROOF_CERTIFICATION_WORK/'$proof_certification_work'/' mprime2.exp\n",
" !sed -i 's/0.25/0.125/' mprime2.exp\n",
Expand Down Expand Up @@ -137,7 +137,7 @@
"computer_name = '' if computer_name.lower() == 'default' else computer_name\n",
"type_of_work = type_of_work.split('-', 1)[0].rstrip()\n",
"proof_certification_work = 'y' if proof_certification_work else 'n'\n",
"computer_number = '1' if computer_number.lower() == 'default (1)' else computer_number.strip()\n",
"computer_number = '1' if computer_number.lower().startswith('default') else computer_number.strip()\n",
"debug = False if debug == 'False' else debug\n",
"\n",
"\n",
Expand Down
Loading

0 comments on commit bf8dce4

Please sign in to comment.