GPU guide
Your AI says you need a GPU? Run your Python script on a GPU in minutes
Updated on
Short answer
Rent an NVIDIA GPU server by the hour: at GPU Cloud, an RTX A6000 with 48 GB costs CA$0.67/h in Canada, with PyTorch and CUDA already installed by the one-click template. Copy your project with rsync, run your script over SSH, then hibernate or delete the server to stop the charges.
Why your AI says you need a GPU
Your assistant (Claude, Claude Code, ChatGPT, Codex, Cursor or Copilot) usually sees one of these signs: your code calls .to("cuda") but torch.cuda.is_available() returns False, training ends with CUDA out of memory, or it takes hours on the CPU. In all three cases you need an NVIDIA card with enough memory (VRAM).
- You are on a Mac or a PC without an NVIDIA card: read torch.cuda.is_available() returns False.
- Your card runs out of memory: read CUDA out of memory.
- Your code runs but too slowly: a GPU rented by the hour runs the same script without changing your code.
Which GPU to rent, and what it costs
| GPU | Memory (VRAM) | On demand, per hour | Spot, per hour |
|---|---|---|---|
| NVIDIA RTX A6000 | 48 GB | $0.67 | $0.54 |
| NVIDIA L40 | 48 GB | $1.34 | $1.07 |
| NVIDIA A100 PCIe | 80 GB | $1.81 | $1.45 |
| NVIDIA RTX PRO 6000 | 96 GB | $2.48 | $1.98 |
| NVIDIA H100 PCIe | 80 GB | $3.35 | $2.68 |
Price of a 1-GPU server in Canadian dollars, taxes extra, read from the catalog when the page is built.
For a PyTorch script, start with the RTX A6000 with 48 GB. If your model does not fit in memory, move to a card with 80 GB or 96 GB. The pricing page also lists the servers with 2 to 8 GPUs.
The steps, with the code to copy
1.Check what your code sees
On your computer, check whether PyTorch finds a GPU.
Falseconfirms there is no usable CUDA GPU.On your computer python -c "import torch; print(torch.__version__, torch.cuda.is_available())"2.Launch a server with the PyTorch (CUDA) template
In the console, pick the PyTorch (CUDA) template, an RTX A6000 and your SSH key, then confirm the price. PyTorch and CUDA install into /opt/pytorch in a few minutes; the console shows the progress and the IP address.
3.Copy your project to the server
Send your folder with rsync or scp. The SSH user is
ubuntu.On your computer (replace IP_ADDRESS with the address shown in the console) # Copy the project without the local virtual environment rsync -avz --exclude .venv --exclude __pycache__ ./my-project/ ubuntu@IP_ADDRESS:~/my-project/ # Without rsync (on Windows for example), scp works too scp -r ./my-project ubuntu@IP_ADDRESS:~/4.Log in and install your dependencies
The PyTorch environment is activated at login: install only what your project adds.
On the server ssh ubuntu@IP_ADDRESS # The /opt/pytorch environment is activated at login cd ~/my-project pip install -r requirements.txt5.Check the GPU
nvidia-smishows the card, and PyTorch should now answerTrue.On the server nvidia-smi python -c "import torch; print(torch.cuda.is_available(), torch.cuda.get_device_name(0))"6.Run your script
With
nohup, the job keeps running even if you close your terminal.On the server # The script keeps running even if your SSH connection drops nohup python train.py > train.log 2>&1 & tail -f train.log7.Fetch your results
Copy your output files (models, logs, figures) back before you stop the server.
On your computer rsync -avz ubuntu@IP_ADDRESS:~/my-project/outputs/ ./outputs/8.Stop the charges
An on-demand server can be hibernated ($0.02 per hour (about $14.60 per month)): the disk is kept and you resume later. A Spot machine cannot be hibernated: delete it. Stopping the server is not enough, it is still billed at the full rate. Do it in the console or with the API.
With the REST API (API key created in the console) export GPUCLOUD_API_KEY="<your API key>" # On-demand server: hibernate it (the disk is kept) curl -X POST "https://gpucloud.ca/api/servers/SERVER_ID/actions" \ -H "Authorization: Bearer $GPUCLOUD_API_KEY" \ -H "Origin: https://gpucloud.ca" \ -H "Content-Type: application/json" \ -d '{"action": "hibernate"}' # Spot machine, or work finished: delete the server curl -X DELETE "https://gpucloud.ca/api/servers/SERVER_ID" \ -H "Authorization: Bearer $GPUCLOUD_API_KEY" \ -H "Origin: https://gpucloud.ca"
Keep your code portable between your computer and the GPU
Pick the device at startup instead of hard-coding cuda: the same script runs on your computer (CPU) and on the server (GPU).
import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
print("device:", device)
model = model.to(device)
for inputs, targets in loader:
inputs, targets = inputs.to(device), targets.to(device)
...Your assistant can rent the GPU for you
If your assistant speaks MCP (Claude Code, Cursor, VS Code or Claude Desktop), connect it to the GPU Cloud MCP server, https://gpucloud.ca/api/mcp, with a spending-capped MCP key. It reads the catalog, asks for a quote, shows you the price in Canadian dollars and creates the server only after you confirm. The configuration to paste is on the Developers page.
Good to know before you launch
- Billing is hourly, at the server’s hourly rate, from prepaid credit. There is no per-minute billing, and the first hour is charged when you deploy.
- A stopped server is still billed at the full hourly rate. To pay less, hibernate it ($0.02 per hour (about $14.60 per month), disk kept) or delete it. A Spot machine cannot be hibernated: delete it when you are done.
- The minimum top-up is CA$25.00, paid by credit card.
- Servers and their disks stay in Canada (region canada-montreal, in Montreal). Account information (identity, billing, e-mails) may be processed outside Quebec, as the privacy policy explains.
Frequently asked questions
How much does an hour of GPU cost for my Python script?
An RTX A6000 with 48 GB costs CA$0.67 per hour on demand, or CA$0.54 on Spot (interruptible), taxes extra. Three hours cost three times that hourly rate.
How long before I can run my script?
A few minutes after the server starts: the PyTorch template installs PyTorch and CUDA by itself, and the console shows the progress, then the IP address.
Do I need to change my code?
No, if your code picks its device with torch.cuda.is_available(). The same script runs on the server, which has an NVIDIA GPU with CUDA.
How do I stop paying when I am done?
Delete the server, or hibernate it if it is on demand ($0.02 per hour (about $14.60 per month)). A server that is only stopped is still billed at the full hourly rate.
Can my AI assistant rent the GPU for me?
Yes, if it speaks MCP: it connects to https://gpucloud.ca/api/mcp with a capped key, asks for a quote and waits for your confirmation before creating the server.
Where are my files hosted?
In Canada, in Montreal. A server cannot be deployed outside Canada, and prices are in Canadian dollars.
Need GPUs? We’ve got you.
Launch an NVIDIA GPU server by the hour in Canada, paid in Canadian dollars by credit card, or reserve a GPU for a given date.
Other guides
- CUDA out of memory: causes, fixes, and when to move to a GPU with more VRAM
- torch.cuda.is_available() returns False: causes and fixes (Mac, PC without NVIDIA, Docker)
- How much does a GPU cost per hour in Canada, in Canadian dollars?
- OpenAI API too expensive? Host your LLM on a GPU by the hour, in Canada
- Rent a GPU by the hour in Canada: prices, steps and billing
- GPU cloud in Montreal, Canada: NVIDIA GPU servers hosted in the country
- Rent an H100 in Canada: PCIe, NVLink or SXM, by the hour
- Which GPU to fine-tune an LLM? Memory, machine and cost
- Cheap GPU cloud: how to pay as little as possible for a GPU