Skip to content

Commit 95eb8d8

Browse files
gnurizenclaude
andcommitted
Add GitHub Actions workflows to test GPU runner access
Two workflows to test GPU runner availability: 1. gpu-runner-test.yml - Tests different runner labels: - ubuntu-latest-gpu - ubuntu-latest-4-cores-gpu - ubuntu-22.04-16core-gpu - ubuntu-latest (fallback, always works) All jobs use continue-on-error so workflow completes even if GPU runners aren't available. 2. gpu-test.yml - Full GPU test workflow: - Checks nvidia-smi and CUDA availability - Compiles and runs simple CUDA hello world - Includes fallback job for non-GPU runners Usage: - Push to 'proton' branch to trigger automatic test - Use 'Actions' tab -> 'Test GPU Runner Access' -> 'Run workflow' to manually test which runner labels are available These workflows will reveal if GitHub provides GPU runners for this open source project. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ce12e67 commit 95eb8d8

File tree

2 files changed

+146
-0
lines changed

2 files changed

+146
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Test GPU Runner Access
2+
3+
# Simple workflow to test if GitHub provides GPU runners for open source projects
4+
# This tests various possible runner labels
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches: [ proton ]
10+
11+
jobs:
12+
# Test 1: Try standard GitHub GPU runner label (if it exists)
13+
test-gpu-runner-standard:
14+
runs-on: ubuntu-latest-gpu
15+
continue-on-error: true
16+
17+
steps:
18+
- name: Check GPU
19+
run: |
20+
echo "Testing ubuntu-latest-gpu runner"
21+
nvidia-smi || echo "No GPU found"
22+
23+
# Test 2: Try 4-core GPU runner
24+
test-gpu-runner-4core:
25+
runs-on: ubuntu-latest-4-cores-gpu
26+
continue-on-error: true
27+
28+
steps:
29+
- name: Check GPU
30+
run: |
31+
echo "Testing ubuntu-latest-4-cores-gpu runner"
32+
nvidia-smi || echo "No GPU found"
33+
34+
# Test 3: Try larger runner with GPU
35+
test-gpu-runner-large:
36+
runs-on: ubuntu-22.04-16core-gpu
37+
continue-on-error: true
38+
39+
steps:
40+
- name: Check GPU
41+
run: |
42+
echo "Testing ubuntu-22.04-16core-gpu runner"
43+
nvidia-smi || echo "No GPU found"
44+
45+
# Test 4: Fallback - standard runner (always works)
46+
test-standard-runner:
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- name: Info
51+
run: |
52+
echo "Standard runner (no GPU expected)"
53+
echo ""
54+
echo "=== CPU Info ==="
55+
lscpu | grep "Model name"
56+
echo ""
57+
echo "=== Memory ==="
58+
free -h
59+
echo ""
60+
echo "=== Check for GPU ==="
61+
lspci | grep -i nvidia || echo "No NVIDIA GPU found (expected on standard runner)"
62+
echo ""
63+
echo "=== Summary ==="
64+
echo "If you see this, at least the standard runner works!"
65+
echo "Check the other jobs to see if GPU runners are available."

.github/workflows/gpu-test.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: GPU Test
2+
3+
on:
4+
push:
5+
branches: [ proton ]
6+
pull_request:
7+
branches: [ main, proton ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
gpu-hello-world:
12+
# Try GitHub's GPU-enabled runners
13+
# For open source projects: https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners
14+
runs-on: ubuntu-latest-4-cores-gpu
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
22+
- name: Check CUDA availability
23+
run: |
24+
echo "=== Checking for NVIDIA GPU ==="
25+
nvidia-smi || echo "nvidia-smi not available"
26+
27+
echo ""
28+
echo "=== Checking for CUDA ==="
29+
nvcc --version || echo "nvcc not available"
30+
31+
echo ""
32+
echo "=== GPU Device Info ==="
33+
if command -v nvidia-smi &> /dev/null; then
34+
nvidia-smi --query-gpu=name,driver_version,memory.total --format=csv
35+
fi
36+
37+
- name: Simple CUDA test
38+
run: |
39+
if command -v nvcc &> /dev/null; then
40+
echo "=== Compiling simple CUDA program ==="
41+
cat > test.cu << 'EOF'
42+
#include <stdio.h>
43+
44+
__global__ void hello() {
45+
printf("Hello from GPU thread %d!\n", threadIdx.x);
46+
}
47+
48+
int main() {
49+
printf("Hello from CPU!\n");
50+
hello<<<1, 4>>>();
51+
cudaDeviceSynchronize();
52+
printf("CUDA test completed successfully!\n");
53+
return 0;
54+
}
55+
EOF
56+
57+
nvcc test.cu -o test_cuda
58+
./test_cuda
59+
else
60+
echo "CUDA not available, skipping CUDA test"
61+
fi
62+
63+
gpu-fallback-test:
64+
# Fallback to standard runner if GPU runner not available
65+
runs-on: ubuntu-latest
66+
67+
steps:
68+
- name: Checkout code
69+
uses: actions/checkout@v4
70+
with:
71+
submodules: recursive
72+
73+
- name: Check environment
74+
run: |
75+
echo "=== Standard runner environment ==="
76+
echo "This runner does not have GPU access"
77+
echo "GPU detection:"
78+
lspci | grep -i nvidia || echo "No NVIDIA GPU found"
79+
80+
echo ""
81+
echo "This job exists to ensure CI doesn't fail if GPU runner unavailable"

0 commit comments

Comments
 (0)