Skip to content
RankCore.AI
← All posts

Free GPU and TPU on Kaggle Notebooks: A Step-by-Step Guide

· Kaggle, GPU, TPU, Deep Learning, Machine Learning

The short video above makes a practical promise: if your laptop freezes when you train a model, you can borrow a much bigger machine in the browser, for free. That machine is a Kaggle Notebook — a cloud Jupyter environment with real NVIDIA GPUs and Google TPUs. This is the study version of the same lesson: a step-by-step walkthrough of account setup, phone verification, turning on the accelerator, checking the GPU, attaching data, saving and committing, and staying inside the weekly quota.

Start at the notebook platform itself: kaggle.com/code. That is the page to open, bookmark, and share. From there you can create a new notebook, browse Kaggle at large, take free AI and machine learning courses, and read the official documentation, How to Use Kaggle Notebooks.

RankCore is not affiliated with Kaggle or Google. Accelerator types, weekly hours, and session limits change; treat the figures below as what official Kaggle pages and product announcements said as of late November 2026, and confirm the options you actually see under Settings → Accelerator and in your account quotas.

1. What you actually get

Kaggle is a Google company. Its Notebooks product gives you a remote Linux session with Python or R already set up, plus optional accelerators. You do not need a local GPU, and the notebook product itself does not ask for a credit card. (Google Cloud add-ons such as billing-enabled BigQuery are a separate matter and can incur charges — see the official notebooks docs.)

The video's claimed specs, checked against official sources:

Claim in the videoOfficial position
Two NVIDIA T4 GPUs, 16 GB VRAM eachConfirmed. The notebooks docs list T4 x2 as two NVIDIA Tesla T4 GPUs, 4 CPU cores, and 29 GB of system RAM. A Kaggle Team product announcement (September 2026) states that each T4x2 notebook has "two GPUs with 16 GB of memory each."
About 30 GPU hours per week, subject to availabilityConfirmed. Efficient GPU Usage says the weekly quota "is 30 hours or sometimes higher depending on demand and resources," and that it resets weekly.
About 20 TPU hours per weekConfirmed. The TPU documentation says you can use "up to 20 hours per week of TPUs and up to 9h at a time in a single session."
No local hardware requiredConfirmed. Official notebooks docs: "We provide the hardware—you need only worry about the code."

Limits the two-minute video does not have time for, also from those pages:

  • Session length: 12 hours for CPU and GPU sessions, 9 hours for TPU sessions. A Save & Run All (commit) must finish inside the same cap.
  • Saved disk: 20 GB in /kaggle/working, persisted automatically. Anything outside that path is scratch space and disappears when the session ends.
  • CPU-only session: 4 CPU cores and 30 GB of RAM.
  • Queues: free accelerator availability is limited; in busy times you wait.
  • Idle interactive sessions: the notebooks docs say you get 20 minutes of idle time; if you neither edit nor run code, the session ends and you reopen it with Edit. The GPU-usage tips page instead says interactive sessions remain active until a 60-minute idle timeout. Do not rely on either figure. Stop the session yourself when you are done so leftover idle time does not consume quota.

One important docs mismatch: the notebooks page still describes adding "a single NVIDIA Tesla P100" and "a TPU v3-8." Those passages are stale. In a September 2026 Product Announcement, the Kaggle Team retired the P100 on 15 September 2026 and said T4x2 is the GPU to use; staff later confirmed they could "only offer T4x2 at the moment" as the general notebook GPU. A separate Product Announcement, "New TPU v5e-8s! Phasing out v3-8s," and a warning on the TPU docs ("written for earlier TPU versions that Kaggle no longer supports") mean the editor is likely to show TPU v5e-8, not v3-8. Pick the TPU option that actually appears in Settings. The older TPU page describes an eight-core board (four dual-core chips). The video's "eight chips" is informal shorthand for that eight-core slice.

2. Create an account and verify your phone

  1. Open kaggle.com and sign in or register (Google, email, or the other options on the page).
  2. Open your account settings and complete phone verification. The video is right that this is what unlocks accelerators, even though the main notebooks docs page does not spell it out. Kaggle staff have stated that all GPUs require phone verification, and that TPUs (and some scarcer GPU types used in limited contexts) require phone and identity verification. If Settings will not let you pick a GPU or TPU, follow the verification prompt rather than assuming the hardware is down.
  3. One person, one account. Kaggle's terms do not allow extra accounts as a way to multiply quota.

You do not need to install CUDA, cuDNN, or a local driver. The notebook image already includes GPU-ready packages.

3. Create a notebook and turn on the accelerator

The fastest path is kaggle.com/code/new, or Create → New Notebook from the site header. The official docs describe the same path as Create > New Notebook. The default is a Jupyter notebook in Python; under File you can switch the language to R, or change the editor type to a Script.

Once the editor loads:

  1. Open the Settings (session options) pane. This is where language, Internet, the accelerator, and the Docker image are configured.
  2. Set Accelerator to GPU T4 x2 for general deep learning and fine-tuning, or to the TPU option shown (often TPU v5e-8) if you have a TensorFlow, JAX, or PyTorch/XLA workload that can use it. The session will restart. That can take moments, or several minutes if you are queued.
  3. Leave Internet on unless you are preparing a competition submission that must run offline. Official docs: Internet "will be by default if it's a new notebook," and you need it for !pip install and for fetching remote files. Some competitions require it off; use the Dependency Manager for offline installs in that case.
  4. Wait for the session to come back, then confirm the device before you start a long training run.

4. Confirm the GPU is really there

For a T4 x2 session, run this in a cell:

!nvidia-smi

You should see two Tesla T4 devices, each reporting about 15360–16384 MiB of memory (16 GB). If nvidia-smi is missing or the table is empty, the accelerator did not attach — check Settings, verification, quota, and the queue.

Then, in Python:

import torch
print(torch.cuda.is_available(), torch.cuda.device_count())
for i in range(torch.cuda.device_count()):
    print(i, torch.cuda.get_device_name(i),
          torch.cuda.get_device_properties(i).total_memory // 1024**2, "MiB")

True and 2, with two T4 names, is the healthy result. A TensorFlow check is tf.config.list_physical_devices('GPU').

If you selected a TPU instead, nvidia-smi is the wrong tool. Follow the TPU documentation and connect with TPUClusterResolver (TensorFlow) or the current PyTorch/XLA or JAX path for that runtime. Because the older TPU page is explicitly outdated, prefer a recent public notebook that already runs on the TPU type in your Settings menu.

5. Add data, write code, and run it

The video says "upload your dataset, hit Run." That works, and so do several better options.

In the editor, open the Input / Add Input pane. You can:

  • Upload a small file of your own (the video's dataset.csv example).
  • Attach a public Kaggle Dataset, a competition data directory, a model, or the output of another notebook (up to the 20 GB /kaggle/working limit on what a notebook can save).
  • Read attached inputs from /kaggle/input/.... Write checkpoints, metrics, and export files to /kaggle/working. Do not put anything you care about only in /tmp or another scratch path.

Run a cell with Shift-Enter, or use Run All in the interactive session. The video's "finish in minutes" is a hope, not a contract. A fine-tune can fill most of a 12-hour GPU session. Keep a close eye on VRAM: each T4 has 16 GB, so a large model may need a smaller batch, gradient checkpointing, 4-bit/8-bit loading, or splitting work across both GPUs.

The image already includes current data-science and deep-learning libraries. Install extras only when Internet is on, and pin versions when you need a reproducible run.

6. Save, commit, and share

The video says the notebook "saves automatically" and that you can share it in one click. Interactive edits are kept in the editor, and files you write under /kaggle/working are auto-saved up to 20 GB. That is not the same as publishing a reproducible version.

Click Save Version. Officially you get two choices:

  • Quick Save takes a snapshot of the notebook as it appears in the editor, without running every cell. Use it while you are experimenting.
  • Save & Run All (the older name is Commit) starts a new, clean session and executes the notebook from top to bottom. This is the version other people should trust, and it must finish within 12 hours (9 on a TPU). Output files from a successful commit become available as a data source for later notebooks.

Do not use Save & Run All as a casual checkpoint if a Quick Save would do — a full commit burns quota by rerunning everything. The GPU usage tips are explicit about that. If you start a second commit because you fixed a bug, cancel the outdated one.

Sharing is a visibility setting plus the notebook URL. Public notebooks are how the community teaches; do not publish secrets, API keys, or private data.

7. Manage the weekly quota

GPU time and TPU time are separate weekly budgets. Official figures: about 30 GPU hours (sometimes higher when resources allow) and 20 TPU hours, with a 9-hour cap on a single TPU session. Check what your account currently has under account settings and in the notebook Settings / session UI. Kaggle also surfaces usage at the top of the notebooks listing, on your profile, and in the session management ("Active Events") window.

Practical rules that actually save hours:

  • Leave the accelerator on None (CPU) while you write markdown, wrangle pandas, or debug syntax. Turn the GPU or TPU on only for work that uses TensorFlow, PyTorch, JAX, or another GPU/TPU library. pandas and scikit-learn will not go faster on a T4, and they will spend your quota.
  • Stop the interactive session when you close the laptop. Official GPU tips: if you just close the window, the session can keep billing until the idle timeout (the tips page cites up to 60 minutes).
  • Prefer a tight training script over an all-day interactive session. The Kaggle API can push a notebook version without opening the editor at all.
  • An experimental official promotion lets a linked Colab Pro or Pro+ subscription add 15 or 30 extra GPU hours a week on the same Kaggle hardware, without spending Colab compute units. It is described as limited-time and can change; link it from the editor's File menu if you already pay for Colab, and verify the extra hours in your Kaggle quotas. The same docs paragraph still mentions P100s, which have since been retired — another reminder to trust the quota number you see in your account over older marketing copy.

8. Using both T4s

Two 16 GB GPUs are not the same as one 32 GB GPU. The memories are separate. A single model.to('cuda:0') uses one card and leaves the other idle.

For PyTorch, start with torch.nn.DataParallel only as a quick experiment; DistributedDataParallel (or Hugging Face accelerate / Trainer with CUDA_VISIBLE_DEVICES=0,1) is the usual proper path. Confirm with nvidia-smi that both devices show memory in use. Some libraries need an explicit device_ids=[0, 1] or a launch wrapper.

Good fits for T4 x2: mid-size fine-tunes, image models, and anything you can shard or run as two processes. Bad fits: a model whose weights plus optimizer plus activations will not fit on one 16 GB card and cannot be split. In that case, shrink the batch, use a lighter backbone, or look at a TPU if the stack supports it — do not assume the second T4 silently extends VRAM.

9. When to pick a TPU instead

Choose a TPU when you have a TensorFlow/Keras, JAX, or supported PyTorch/XLA input pipeline that can feed an eight-core device, usually with a larger batch (the older official rule of thumb was 128 examples per core, scaled by tpu_strategy.num_replicas_in_sync). TPUs often want data in TFRecord or a similarly efficient pipeline, sometimes from GCS. They are not a drop-in replacement for a CUDA model.

You have 20 hours a week and at most 9 hours in one session, and TPU access may require identity verification in addition to a phone. If the TPU docs sample and the Settings label disagree on v3-8 versus v5e-8, believe Settings and a recent working notebook.

A typical TensorFlow skeleton, adapted from the official TPU page — test it on the device you actually have:

import tensorflow as tf

tpu = tf.distribute.cluster_resolver.TPUClusterResolver()
tf.tpu.experimental.initialize_tpu_system(tpu)
strategy = tf.distribute.TPUStrategy(tpu)

with strategy.scope():
    model = tf.keras.Sequential([...])  # build and compile here
    model.compile(...)

# Use a large enough per-core batch, and a tf.data pipeline that can keep the TPU busy.
model.fit(training_dataset, epochs=EPOCHS, steps_per_epoch=STEPS)

PyTorch/XLA and JAX setups differ, and startup scripts have changed as Kaggle moved past the v3-8 docs. Copy a current public TPU notebook if the resolver call fails.

10. Troubleshooting the usual failures

torch.cuda.is_available() is False. The session is almost certainly on CPU. Re-open Settings, confirm T4 x2 is selected, and wait for the restart to finish. If the control is disabled, finish phone verification and check that you still have GPU hours left.

nvidia-smi shows one GPU, or the second is at 0%. Your process is bound to cuda:0 only. That is legal, but you are leaving half of the machine idle. Set the device explicitly, or use a distributed/DataParallel path, and watch both rows in nvidia-smi.

CUDA out of memory. Each T4 has 16 GB, not 32 GB pooled. Lower the batch size, shorten sequences, use gradient accumulation or checkpointing, or load the model in 8-bit/4-bit if your library supports it. Delete unused tensors and call torch.cuda.empty_cache() only after you have fixed the actual footprint.

!pip install fails, or the notebook cannot reach GitHub. Turn Internet on and restart if needed. If you are in a competition that requires Internet off, pre-build dependencies with the Dependency Manager instead of installing at runtime.

The commit is stuck on "Queued." Free GPUs are a shared pool. Official docs warn that you may wait "a few moments to several minutes," and at peak times it can be longer. CPU commits often start immediately while a T4 x2 commit waits. Leave it, or cancel and retry later; do not stack several identical GPU commits.

The interactive session vanished. You likely hit the idle timeout, or you closed the browser without stopping the session and it later expired. Click Edit, or rely on Save & Run All for work you cannot babysit.

I need a package version the image does not have. With Internet on, !pip install package==x.y.z in a cell is the usual fix. Record that cell near the top so Save & Run All remains reproducible. Avoid upgrades that break the preinstalled GPU build of PyTorch or CUDA.

Logs or models disappeared after a restart. They were not under /kaggle/working. Restarts and new commits do not keep scratch paths. Write checkpoints to /kaggle/working and confirm they appear in the commit output.

11. A first-day lab

  1. Open kaggle.com/code, create a notebook, leave the accelerator off, and run import sys; print(sys.version).
  2. Enable GPU T4 x2, wait for the restart, and run nvidia-smi plus the torch.cuda snippet above. Save the output.
  3. Attach a small public dataset, read one file from /kaggle/input, and write a short result into /kaggle/working.
  4. Quick Save, then do a short Save & Run All and open the committed version's output.
  5. Stop the session from Active Events and confirm your remaining GPU hours moved by only the time you actually used.

If you can do those five steps, you have the video at working depth.

12. FAQ

Is this really free? The notebook accelerators are free within the weekly quota and session caps. No card is required for that product. Paid Google Cloud integrations are optional and billed by Google Cloud; read those prices before you enable them.

Why is the accelerator menu empty or greyed out? Usually missing phone (or identity) verification, a spent quota, or a queue. Complete verification, check remaining hours, and wait or retry.

Why did my session die while I was away? Interactive idle timeout. Use Save & Run All for long unattended jobs, and stop sessions you are not using.

Can I train a 70B model here? Not realistically on two 16 GB T4s in full precision, and only with aggressive quantization and careful sharding — if at all. This tier is for learning, practice, competition baselines, and small-to-mid fine-tunes.

Does a queued wait spend quota? You are waiting for a machine. Quota is consumed once a session that uses the accelerator is actually running; still, cancel jobs you no longer need.

Where should I learn the libraries? Kaggle Learn is the official free course catalog (Python, pandas, deep learning, and more), and it runs in the same notebook environment.

CPU or GPU for data cleaning? CPU. Save the T4s for work that actually calls CUDA. Leaving the GPU on during an hour of pandas.read_csv is a common way to waste the weekly 30 hours.

Can I connect Google Cloud Storage or BigQuery? Yes, from Add-ons → Google Cloud Services, but those are not part of the free notebook accelerator. Official docs warn that some integrations require a billing-enabled GCP project and can incur charges. The free T4/TPU offer does not.

13. Summary

  • Open Kaggle Notebooks (or create a notebook directly). Sign in at kaggle.com, and verify your phone so accelerators unlock.
  • The current general-purpose free GPU is NVIDIA T4 x2 — two 16 GB cards, 4 CPUs, 29 GB of system RAM. The official P100 option was retired on 15 September 2026, even though some docs pages still mention it.
  • The free TPU is an eight-core Google TPU (the editor now generally lists v5e-8; older docs still say v3-8). Budget about 30 GPU hours and 20 TPU hours per week, with 12-hour GPU sessions and 9-hour TPU sessions. Availability is not guaranteed; you may queue.
  • Confirm a GPU with nvidia-smi and torch.cuda; put durable files in /kaggle/working; use Quick Save while you experiment and Save & Run All when you want a clean, shareable run. Stop idle sessions.
  • Keep Internet on for installs unless a competition forbids it. Read the official notebooks documentation when something in Settings disagrees with a tutorial — including this one.

Follow @rankcore.ai, and read more on blog.rankcore.ai.

Want to go deeper?

Our step-by-step video courses turn these ideas into results.

See courses

Comments

Sign in or create a free account to join the discussion.

No comments yet — be the first.