--- /dev/null
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use CGI qw(:standard);
+use DBI;
+
+print header(-type => 'text/html', -charset => 'utf-8');
+print start_html(-title => "GPU Leaderboard",
+ -style => "background-image: url('/bg.gif')");
+
+my $db_file = "/www/leader/gpu.db";
+my $dbh = DBI->connect("dbi:SQLite:dbname=$db_file", "", "", {
+ RaiseError => 1,
+ AutoCommit => 1
+}) or die $DBI::errstr;
+
+my $query = qq{
+ SELECT u.name, SUM(g.util * (1.0/60.0)) AS gpu_hours
+ FROM usage g
+ JOIN users u ON g.uid = u.uid
+ GROUP BY u.uid
+ ORDER BY gpu_hours DESC;
+};
+
+my $sth = $dbh->prepare($query);
+$sth->execute();
+
+print h1("GPU Leaderboard");
+
+print "<table border='1' cellspacing='0' cellpadding='5'>";
+print "<tr><th>Name</th><th>GPU Hours</th></tr>";
+
+while (my $row = $sth->fetchrow_hashref) {
+ print "<tr>";
+ print "<td>$row->{name}</td>";
+ print "<td>" . sprintf("%.2f", $row->{gpu_hours} || 0) . "</td>";
+ print "</tr>";
+}
+
+print "</table>";
+
+print <<'END';
+<hr />
+<footer style="text-align:center">
+<a href="https://acme.com/software/thttpd/"><img src="/badges/thttpd.gif" alt="powered by thttpd" height="31" width="88"></a>
+<a href="https://www.freebsd.org/"><img src="/badges/freebsd.gif" alt="powered by FreeBSD" height="31" width="88"></a>
+<a href="//cherf.ais-ucla.org/"><img src="/badges/cherf.gif" alt="powered by cherf" height="31" width="88"></a>
+<address>
+© 2025 Christopher Milan
+<br />
+<a href="/">stats.ais-ucla.org</a>
+</address>
+</footer>
+</body>
+</html>
+END
+
+# Finish HTML and cleanup
+print end_html;
+$sth->finish();
+$dbh->disconnect();
+