RunOnGPU is a CLI tool that helps you run GitHub projects on a GPU with minimal setup.
It is useful if you want to test CUDA, PyTorch, or other GPU code but do not have a local NVIDIA GPU.
- Windows
- Python 3.12.13+
- Git
- Google Chrome
- Google account for Colab
Example video: https://www.loom.com/share/79d5dfd3cba4401fb2fd5967a8438391
- Install anaconda with Python >= 3.12.13 for smooth performance
- Publish your code in a public GitHub repo. You will use the GitHub repo URL
- Create conda environment. You can use any name you like but for following example, we used test_env.
conda create --name test_env "python>3.12"
conda activate test_env- Run following commands in your conda enviroment
pip install runongpuCheck setup:
runongpu doctor- Make sure you do not touch chrome or move around your cursor as the program runs the code.
- Be prepared to sign in to your google account once. Your profile will be saved for future sessions.
Go to the project you want to run and initialize RunOnGPU:
runongpu initEnter your GitHub repo URL when asked.
This creates a runongpu.txt file. Edit this file to tell RunOnGPU how to set up, build, test, and run your project.
Then run:
runongpu runRunOnGPU will open Colab, copy the starter notebook, clone your repo, set the runtime to a T4 GPU, and run your commands. If for some reason, it doesn't work on the first try, press enter in your command line interface to restart the program.
You need this to run neccesary commands. You must edit this file to ensure your program runs smoothly.
runongpu.txt controls what happens inside Colab.
It has four sections:
[setup]
# install dependencies here
[build]
# compile or build the project here
[test]
# run tests here
[run]
# run the final program here
Add one command per line.
If your repo has this structure:
my-cuda-project/
├── main.cu
└── runongpu.txt
Use:
[setup]
[build]
nvcc main.cu -o vector_add
[test]
[run]
./vector_add
If your repo has this structure:
runongpu-examples/
├── cuda/
│ └── vector-add/
│ └── main.cu
└── runongpu.txt
Use:
[setup]
[build]
cd cuda/vector-add && nvcc main.cu -o vector_add
[test]
[run]
cd cuda/vector-add && ./vector_add
[setup]
pip install -r requirements.txt
[build]
[test]
pytest
[run]
python main.py
[setup]
[build]
cmake -S . -B build
cmake --build build
[test]
ctest --test-dir build --output-on-failure
[run]
./build/my_program
On the first run, you may need to sign into Google Colab. RunOnGPU saves the copied notebook URL and reuses it on future runs.
Do not interact with the Colab window while RunOnGPU is setting it up.
Examples of RunOnGPU use: https://github.com/MashrafeeAryan/runongpu-examples
python -m pytest