On this page1. Read the driver and CUDA versions correctly
A GPU server bills from the moment it boots, so the first hour should answer one question: is this machine ready for the real job? That means the card runs at full speed, the driver suits your framework, containers can see the GPU, and the setup will survive the next round of package updates. This walkthrough assumes Ubuntu or Debian with the NVIDIA driver already installed, as on most GPU images. To confirm which card and how much memory you actually received, start with the checks in shared, passthrough or bare-metal GPU, then continue here.
1. Read the driver and CUDA versions correctly
The nvidia-smi header shows a driver version and a "CUDA Version". The second number confuses many people: it is the newest CUDA release the driver supports, not the CUDA toolkit installed on the machine.
nvidia-smi --query-gpu=name,driver_version,memory.total --format=csv
nvcc --version 2>/dev/null || ls -d /usr/local/cuda* # the toolkit, if one is installed
python3 -c "import torch; print(torch.__version__, torch.version.cuda, torch.cuda.is_available())"
Frameworks such as PyTorch ship their own CUDA runtime libraries inside their packages, so most projects never touch the system toolkit. What matters is that the driver is new enough for the CUDA build of your framework. If it is not, you will see "CUDA driver version is insufficient for CUDA runtime version". The fix is a framework build that matches the driver, or a newer driver; installing a second toolkit does not help.
2. Check that the card runs at full speed
A card held back by a power cap, heat or a narrow PCIe link still works, just slower than you are paying for. Three queries show it:
nvidia-smi -q -d PERFORMANCE,POWER,TEMPERATURE | less
nvidia-smi --query-gpu=pcie.link.gen.current,pcie.link.gen.max,pcie.link.width.current,pcie.link.width.max --format=csv
nvidia-smi -q -d ECC | grep -i -A 2 "ecc mode" # A100 and RTX PRO cards
Read them under load, not at idle. The PCIe link drops to a lower generation when the card is idle to save power, and the clock event (throttle) reasons are only meaningful while a job runs. A link width well below the maximum limits how fast data moves between host and card, which hurts data loading more than pure compute. Inside a virtual machine, the values show what the passthrough presents.
Make sure the persistence daemon runs, so the driver stays initialized between jobs and short jobs do not pay a startup delay each time:
systemctl status nvidia-persistenced --no-pager || sudo systemctl enable --now nvidia-persistenced
3. Run a short throughput test
A one-minute matrix multiplication gives a sanity check against the card's published numbers. It is not a benchmark of your workload, but it catches a card that is badly throttled:
# gpu_matmul.py: rough dense BF16 throughput, a sanity check rather than a benchmark
import time, torch
n, iters = 8192, 50
a = torch.randn(n, n, device="cuda", dtype=torch.bfloat16)
b = torch.randn(n, n, device="cuda", dtype=torch.bfloat16)
for _ in range(5): # warm-up
a @ b
torch.cuda.synchronize()
start = time.perf_counter()
for _ in range(iters):
a @ b
torch.cuda.synchronize()
elapsed = time.perf_counter() - start
print(f"{torch.cuda.get_device_name(0)}: {2 * n**3 * iters / elapsed / 1e12:.0f} TFLOPS (bf16 matmul)")
While it runs, watch power, clocks and violations from a second terminal with nvidia-smi dmon -s pucv. A result far below the card's published dense figure, with power pinned at its limit or a thermal violation counting up, is worth a support ticket before you start a long job.
4. Give containers the GPU
Docker needs the NVIDIA Container Toolkit to pass the GPU into containers. With Docker Engine already installed, add NVIDIA's repository and configure the runtime:
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey \
| sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list \
| sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' \
| sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
sudo docker run --rm --gpus all ubuntu nvidia-smi # should print the same table as the host
In Docker Compose, request the GPU per service:
services:
inference:
image: ghcr.io/example/inference:latest
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
Containers share the host's driver, so the driver on the host must still satisfy the CUDA version inside each image.
5. Keep the driver stable
A driver upgrade in the middle of a project can break a working environment, and every kernel update has to rebuild the NVIDIA kernel module. Find out how the driver was installed, then decide when it changes:
dpkg -l | grep -E 'nvidia-(driver|dkms|utils)' # driver installed from packages?
dkms status # module built for which kernels
If the driver came from packages, keep unattended upgrades away from it with a small file such as /etc/apt/apt.conf.d/51nvidia-hold:
Unattended-Upgrade::Package-Blacklist {
"nvidia-";
"libnvidia-";
};
Security updates for everything else keep flowing. After any kernel update, reboot and run nvidia-smi before starting the next job. If it reports that it "couldn't communicate with the NVIDIA driver", check dkms status and install the headers for the running kernel (linux-headers-$(uname -r)). Once the stack works, take a snapshot, so a bad upgrade costs a restore instead of an afternoon.
6. Put the data where the card can reach it
A fast GPU fed from a slow or full disk spends its time waiting. Keep the working set (model weights, the current dataset, checkpoints) on the server's local NVMe storage rather than streaming it from remote storage on every epoch. Caches grow quickly: model hubs, pip and container images can fill tens of gigabytes in the first day. Check free space before a long run, and point caches at the largest volume:
df -h / /data 2>/dev/null
du -sh ~/.cache/* 2>/dev/null | sort -h | tail -n 5
export HF_HOME=/data/hf-cache # Hugging Face downloads go here instead of the home folder
7. Keep notebooks and dashboards private
Jupyter, TensorBoard, ComfyUI and model APIs listen on ports that should never face the internet. Bind them to 127.0.0.1 and reach them through an SSH tunnel from your laptop:
ssh -N -L 8888:127.0.0.1:8888 user@203.0.113.40 # then open http://localhost:8888
Then confirm from the server that nothing unexpected listens on a public address with sudo ss -tlnp.
8. Stop paying for idle hours
The cheapest GPU hour is the one you do not run. Keep datasets and checkpoints somewhere that outlives the server, script the setup above, and delete the server when the job ends. CloudSat GPU servers come with the NVIDIA driver and CUDA preinstalled and bill by the hour, and a startup script can repeat the remaining steps on every new server.
The first hour, as a checklist
| Check | How | A good result |
|---|---|---|
| Card and memory | nvidia-smi --query-gpu=name,memory.total --format=csv |
The card and full memory you ordered |
| Driver against framework | torch.cuda.is_available() |
True, with no driver-version error |
| Speed under load | nvidia-smi dmon -s pucv during the test |
Steady clocks, no violation counters climbing |
| PCIe link under load | The pcie.link query |
Current generation and width close to the maximum |
| Containers | sudo docker run --rm --gpus all ubuntu nvidia-smi |
The same table as on the host |
| Driver pinned | The unattended-upgrades file | NVIDIA packages skipped by automatic updates |
| Private ports | sudo ss -tlnp |
Notebooks and APIs on 127.0.0.1 only |
Run it again after every rebuild, resize or driver change. It takes ten minutes and saves the hours a quietly throttled or misconfigured card would waste.
FAQ
Do I need the full CUDA toolkit?
Not to run PyTorch, TensorFlow or JAX from their standard packages, or prebuilt containers: they carry the runtime libraries they need. Install the toolkit when you compile CUDA code yourself, such as custom kernels or some Python extensions that build on install.
Should I upgrade the driver right away?
Only when a framework or image needs a newer one. A driver that works with your stack is worth keeping for the life of a project. Plan upgrades between projects, after a snapshot.
Can several containers share one GPU?
Yes. They take turns on the compute units and share the memory, so their combined memory use must fit on the card. For hard isolation between jobs, an A100 can be split into separate instances with Multi-Instance GPU.
How do I know the GPU is the bottleneck?
Watch utilization.gpu and memory.used during a real run. High utilization means the card is the limit and a faster one would help. Low utilization usually means data loading, preprocessing or disk reads are holding it back, and a bigger GPU would not.
Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.




