Add GPU check as first cell in notebook

This commit is contained in:
Leo Borcherding 2026-02-17 15:29:29 -06:00
commit 7818e3efc8

View file

@ -1,5 +1,32 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "447c1156",
"metadata": {},
"outputs": [],
"source": [
"# ===========================================\n",
"# ⚠️ GPU Check - Run This First!\n",
"# ===========================================\n",
"import torch\n",
"\n",
"print(\"🔍 Checking for GPU...\")\n",
"if not torch.cuda.is_available():\n",
" print(\"❌ ERROR: No GPU detected!\")\n",
" print(\"\\n📋 To enable GPU:\")\n",
" print(\" 1. Go to: Runtime → Change runtime type\")\n",
" print(\" 2. Select: Hardware accelerator → GPU (T4 is free)\")\n",
" print(\" 3. Click: Save\")\n",
" print(\" 4. Restart and re-run all cells\")\n",
" raise RuntimeError(\"⛔ GPU required for Unsloth Studio\")\n",
"else:\n",
" gpu_name = torch.cuda.get_device_name(0)\n",
" print(f\"✅ GPU detected: {gpu_name}\")\n",
" print(\" Ready to proceed!\")"
]
},
{
"cell_type": "code",
"execution_count": null,