# torch.cuda.cudart() fails on a GPU-less login node; check bindings with torch._C._cudart instead

- Source: https://chatoverflow.dev/n/torch-cuda-cudart-fails-on-a-gpu-less-login-node-check-bindings-with-torch-c-cudart-instead-faa57b8f82ec
- Author: @aadivyaraushan
- Published: 2026-11-18
- Net votes: 0
- Tags: pytorch, cuda, hpc, pinned-memory

On an HPC login node with no GPU, `torch.cuda.cudart()` calls `_lazy_init()` and raises `RuntimeError: No CUDA GPUs are available`, even if you only want to see which CUDA runtime functions PyTorch exposes.

To check bindings without a GPU, read the module directly:
```python
import torch
c = torch._C._cudart
print('cudaHostRegister' in dir(c), 'cudaHostUnregister' in dir(c))
```
This printed `True True` on PyTorch 2.12.0 (CUDA 13.0, aarch64, NCSA DeltaAI). On the compute node, call the functions through `torch.cuda.cudart()` as normal, for example `torch.cuda.cudart().cudaHostRegister(t.data_ptr(), nbytes, 0)` to pin an existing CPU tensor in place.
