Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
FREEDOM251

Freedom251 › Blog › CUDA

What to Do When Your GPU Runs Out of VRAM

By Freedom251 Team · · 10 min read

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When a game or CUDA job runs out of VRAM, the application has requested more memory than the graphics processor can provide at that moment. The fastest reliable fix is to identify what failed, close competing GPU workloads, then reduce the largest memory consumer: textures and resolution in games, or batch size, dimensions, model size and precision in compute workloads. If the workload still cannot fit at an acceptable setting, a graphics card with more VRAM is the durable solution.

What a VRAM-out-of-memory error actually means

Video random-access memory (VRAM) stores data that the GPU must access quickly: textures, frame buffers, shaders, geometry, model weights, activations, attention key-value (KV) caches and CUDA-graph allocations. An out-of-memory (OOM) message means the next allocation could not be satisfied. It does not necessarily mean the GPU is defective, and it is different from running out of ordinary system RAM.

As an Amazon Associate I earn from qualifying purchases.

The same symptom can have different causes. A game may exceed its available texture budget, while a machine-learning process may fail while loading weights, growing a KV cache, capturing a CUDA graph or finding a contiguous block because of allocator fragmentation. NVIDIA’s troubleshooting guidance recommends identifying the phase that failed before changing settings, because each phase has a different remedy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Signs that the problem is VRAM, not something else

  • The complete error names video memory, CUDA out of memory, a failed GPU allocation or an inability to reserve a specified number of megabytes.
  • A monitoring tool shows dedicated GPU memory near its limit when the crash occurs.
  • Lowering textures, resolution, batch size or model dimensions allows the same operation to complete.
  • The error appears only after another GPU application, browser tab or recording tool has been running.

A crash mentioning a display-driver reset, corrupted files, overheating, system RAM or an application exception needs a different investigation. Do not treat every graphics crash as a VRAM shortage.

#1 Best Overall
Sale
ASUS Dual Radeon RX 9060 XT 16GB GDDR6 Gaming Graphics Card | PCIe 5.0, HDMI 2.1b, DisplayPort 2.1a, 2.5-slot design, Axial-tech Fans, 0dB Technology
  • Axial-tech fans now feature a smaller fan hub that facilitates longer blades and a barrier ring that increases downward air pressure
  • 2.5-slot design allows for greater build compatibility while maintaining cooling performance
  • 0dB technology lets you enjoy light gaming in relative silence
  • Dual BIOS switch lets you toggle between Quiet and Performance BIOS profiles
  • Dual ball fan bearings last up to twice as long as sleeve bearing designs

First response: confirm the failure and reset the memory state

  1. Read the entire error. Note whether it occurred during weight loading, inference, training, rendering, shader compilation or CUDA-graph capture. Record the requested allocation and the amounts reported as allocated, reserved and free.
  2. Close other GPU users. Exit other games, video editors, 3D tools, AI processes, browser tabs playing video and screen-recording or overlay software. A process can keep VRAM allocated even when its window is minimized.
  3. Restart the affected process. A clean game restart clears its allocations. For a CUDA job, stop the worker or service and start it again; if a crashed process left a context behind, restart the relevant service or, when safe, reboot the machine.
  4. Remove overclocks while testing. Return the GPU and memory clocks to stock settings. Unstable overclocks can produce allocation failures that look like OOMs.
  5. Update the graphics driver. Install a current driver appropriate for the GPU and operating system, then retest before changing several variables at once. Steam Support lists driver updates, disabling background applications and lowering video settings among its standard remedies.

Keep one change at a time when diagnosing. That makes it clear which reduction solved the allocation and avoids sacrificing more quality or throughput than necessary.

Fixing VRAM exhaustion in games

Games usually expose the biggest VRAM controls in their graphics menu. Apply reductions in this order so you preserve image quality where possible.

1. Lower texture quality and texture-streaming limits

Textures are often the largest persistent allocation, especially at 4K or with high-resolution texture packs. Move the texture-quality setting down one level, restart if the game requests it, and test the same scene. If the game has a texture-streaming pool, reduce that pool rather than immediately dropping every visual setting. Texture reduction affects surface detail more than geometry or lighting.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Reduce output resolution or render scale

Lower the display resolution or internal render scale. Epic’s support guidance for an out-of-video-memory rendering error specifically recommends lowering resolution and closing other applications. Microsoft explains that rendering fewer pixels reduces the GPU workload; an upscaler can then reconstruct a higher-resolution-looking image from that lower-resolution render.

3. Enable an available upscaler

Choose the game’s quality or balanced upscaling mode after reducing the render resolution. Upscaling can preserve perceived sharpness and frame rate better than presenting a permanently low-resolution image, although fine detail and motion clarity vary by implementation. If the game offers a sharpening control, use a modest value; excessive sharpening does not recover missing texture data.

Rank #2
Sale
ASUS Dual GeForce RTX 5060 Ti 16GB GDDR7 OC Edition Gaming Graphics Card | PCIe 5.0, HDMI 2.1b, DisplayPort 2.1b, 2.5-slot, Axial-tech Fans, 0dB Technology, Dual BIOS
  • AI Performance: 767 AI TOPS
  • OC mode: 2632 MHz (OC mode)/ 2602 MHz (Default mode)
  • Powered by the NVIDIA Blackwell architecture and DLSS 4
  • Axial-tech fan design features a smaller fan hub that facilitates longer blades and a barrier ring that increases downward air pressure
  • A 2.5-slot design maximizes compatibility and cooling efficiency for superior performance in small chassis

4. Trim settings that create large transient allocations

  • Lower shadow-map quality or shadow distance.
  • Reduce volumetric effects, reflections and screen-space effects.
  • Disable very large ray-tracing modes or reduce their quality.
  • Reduce crowd, foliage or view-distance settings if the game documents them as memory-heavy.
  • Remove optional high-resolution texture packs.

Change these only after textures and resolution. They can reduce quality or scene complexity, but the amount of VRAM saved differs by engine and scene.

5. Check the game’s stated requirement

Compare your card’s dedicated VRAM with the game’s minimum and recommended video-memory requirements. Requirements are targets for a particular quality level and resolution, not guarantees for every patch or texture pack. If newer games consistently exceed an older card’s capacity even at reduced settings, Steam Support identifies upgrading the video card or its memory as the long-term option.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Game-fix decision table

Change Likely memory effect Image or performance trade-off
Texture quality Reduces resident texture data Less surface detail; usually little change to geometry
Resolution or render scale Reduces render-target and related buffers Lower native detail; upscaling can preserve perceived resolution
Upscaling Allows a lower internal render resolution Quality depends on the mode and motion; may improve frame rate
Ray tracing, shadows and effects Reduces large feature-specific allocations Less accurate lighting, reflections or atmospheric detail
Closing applications Returns their allocations to the system No in-game quality loss

Fixing CUDA and PyTorch out-of-memory errors

Compute workloads have several independent memory consumers. A model can fit when weights are loaded but fail later when activations, a larger batch, a longer sequence, a larger image or a KV cache is created. Apply the change that matches the failing phase.

Reduce batch size first

For training or batched inference, lower the batch size until one iteration completes. If you need the same effective training batch, use gradient accumulation: process several smaller batches, accumulate gradients, then update the weights once. This reduces peak activation memory without pretending that the GPU has more capacity.

Reduce tensor, sequence or image dimensions

Peak memory rises with input dimensions. Shorten the maximum sequence length, crop or resize images, reduce feature-map dimensions or use smaller intermediate tensors. Attention workloads can be especially sensitive to sequence length because KV-cache and attention-related storage grow as context grows.

Rank #3
NVIDIA GeForce RTX 3080 20GB GDDR6X Dual Width Server GPU AI Model Graphics Card 20GB VRAM for Local LLMs; Supports Qwen, GLM, MiniMax & More
  • GPU-Modell: Gefoce RTX 3080
  • Memory Type: GDDR6X Memory Capacity: 20GB Memory Bus Width: 320bit Output Interfaces: 3*DP + HDMI Core Clock: 1710MHz Memory Clock: 19Gbps Power Interface: 8+8pin Recommended Power Supply: 850W or higher

Use a smaller model or distribute weights

Choose a smaller parameter count, a narrower configuration or a quantized model when the required quality allows it. If multiple GPUs are available, distribute model weights across them using the framework’s supported device-mapping or sharding method. Distribution adds communication and configuration overhead; it is not equivalent to combining all cards into one pool for every operation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use lower precision where supported

Lower-precision formats such as FP16 or BF16 can reduce weight and activation storage, but only use a format supported by the model, GPU and operation. Check numerical stability and output quality. NVIDIA states that a 70-billion-parameter model in BF16 requires approximately 140 GB of weight memory (NVIDIA, 2026), before room for activations, KV cache, temporary workspaces and the framework itself is counted.

Account for CUDA graph capture

If the failure occurs during CUDA-graph capture rather than normal execution, the graph itself can consume additional memory. NVIDIA reports that capture can consume 1 to 5 GB (NVIDIA, 2026). Leave more memory unreserved by lowering the serving configuration’s gpu-memory-utilization value, or disable CUDA graphs when the application permits it. Lowering that utilization target can reduce cache capacity or throughput, so change it only for a capture-related failure.

Diagnosing PyTorch allocation, cache and fragmentation

PyTorch distinguishes memory occupied by live tensors from memory reserved by its caching allocator. Add lightweight measurements around the operation that fails:

print(torch.cuda.memory_allocated() / 1024**3, "GiB allocated")
print(torch.cuda.memory_reserved() / 1024**3, "GiB reserved")
print(torch.cuda.memory_summary())

memory_allocated() reports memory held by live tensors; memory_reserved() includes blocks held by the allocator for reuse. A high reserved value with a much lower allocated value suggests cached blocks or fragmentation, not necessarily a leak in live tensors.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
ASUS ROG Astral GeForce RTX 5090 32GB GDDR7 OC Edition Gaming Graphics Card | PCIe 5.0, HDMI/DP 2.1, 3.8-slot, 4-fan, Axial-tech Fans, Vapor Chamber, Phase-change GPU Thermal Pad
  • Powered by the NVIDIA Blackwell architecture and DLSS 4 OC mode: 2610 MHz/ Default mode: 2580 MHz(Boost clock)
  • Quad-fan design boosts air flow and pressure by up to 20%. Compatibility: 357.6mm (14.1") length, 3.8 slots, 6.6 lbs. Confirm case clearance and slot spacing.
  • Patented vapor chamber with milled heatspreader for lower GPU temperatures
  • Phase-change GPU thermal pad ensures optimal heat transfer, lowering GPU temperatures for enhanced performance and reliability
  • 3.8-slot design: massive heatsink and fin array optimized for airflow from the four Axial-tech fans

What empty_cache() can and cannot do

PyTorch documentation states: “Calling empty_cache() releases all unused cached memory from PyTorch so that those can be used by other GPU applications. However, the occupied GPU memory by tensors will not be freed so it can not increase the amount of GPU memory available for PyTorch.” In other words, it can return idle cached blocks to other applications and sometimes reduce external contention, but it does not free tensors or create capacity for live PyTorch data. Use it between independent jobs, not as a substitute for reducing the model or batch.

Capture an allocation history for a repeatable failure

PyTorch’s memory tooling can record allocation history and OOM events. Enable the documented memory-history recorder before the failing operation, reproduce the error, and inspect the resulting snapshot in the memory visualizer. Look for a steadily growing tensor, a one-time large allocation, or many differently sized blocks that leave no contiguous region for the request. Stop recording afterward if the overhead is material for your workload.

Use the expandable-segments allocator option only for fragmentation

If the error reports substantial reserved-but-unallocated memory and the snapshot indicates fragmentation, try the environment setting PYTORCH_ALLOC_CONF=expandable_segments:True before starting the process. On a shell, set it before launching Python; on Windows, define the equivalent environment variable in the process environment. This setting changes allocation behavior; it does not add VRAM and will not solve a workload whose live tensors genuinely exceed capacity. Remove it if it increases overhead or does not address the diagnosed fragmentation.

When settings and allocator changes are not enough

If the smallest practical batch, dimensions, model and precision still exceed available memory, or a game cannot meet its target quality without constant OOMs, the limitation is physical capacity. NVIDIA Support wrote in 2021: “You likely need a GPU with more memory to handle this application.” A replacement graphics card is a durable fix, but verify the complete platform before buying.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Workload headroom: budget for the application’s peak allocation, not merely the model’s weight size or a game’s average usage.
  • Power supply: check the card’s required connectors and recommended wattage.
  • Case and cooling: confirm length, thickness, airflow and thermal limits.
  • Motherboard and slot: verify physical clearance and interface compatibility.
  • Software stack: check driver, CUDA, framework and operating-system support for the intended workload.
  • Multiple-GPU behavior: confirm that the application supports sharding or device mapping before assuming two cards will solve one allocation.

Do not select a card solely by advertised VRAM. Memory bandwidth, compute capability, supported precision, driver support and power can determine whether the extra capacity is useful.

Best Value
MOUGOL AMD Radeon RX 580 8GB GDDR5 Gaming Graphics Card, HDMI/DP/DVI Black | 256-Bit 2048SP PCIe X16 3.0 GPU, HDMI/DP/DVI Triple Output, Dual Fan Cooling Video Card, for Windows 11/10/7 Desktop PC
  • 【Ultimate Triple Display Connectivity】: Features a versatile output array including HDMI, DisplayPort (DP), and DVI. Whether you're connecting a high-refresh-rate gaming monitor via DP or a standard office screen via HDMI, this card supports triple-monitor setups for maximum productivity.
  • 【Compact Size & Wide Compatibility】: Measuring 240x135x45mm (9.45x5.31x1.77 inches), this dual-fan RX 580 fits perfectly into standard ATX Mid-Towers, Micro-ATX (M-ATX), ideal for compact desktop PC upgrades and space-saving gaming builds.
  • 【Optimized Gaming Performance】: With 2048 Stream Processors and a 1206 MHz core clock, this card delivers solid frame rates in popular titles like Fortnite, GTA V, Apex Legends, and Valorant. It’s the ideal budget-friendly GPU for entry-level to mid-range gaming rigs.
  • 【Advanced Thermal Management】: Engineered with a dual-fan cooling system and high-efficiency heat pipes to ensure stable performance under heavy loads. The intelligent fan control keeps your system quiet during light office work and provides maximum airflow during intense gaming sessions.
  • 【Ready for Content Creation】: Supports DirectX 12, Vulkan, and OpenGL 4.6, making it more than just a gaming card. It provides hardware acceleration for video editing in Premiere Pro, 3D rendering in Blender, and smooth streaming for aspiring creators.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choosing the least damaging fix

Approach Best use What you give up
Close applications and restart One-off contention or a stale process Any unsaved work in the closed process
Lower textures or resolution Game-specific VRAM pressure Visual detail; upscaling quality varies
Lower batch or dimensions Training and inference peaks Throughput, context length or output resolution
Lower precision or smaller model Model weights and activations dominate Numerical margin, quality or capability
Allocator tuning Reserved-but-unallocated fragmentation Potential allocator overhead; no extra capacity
Higher-VRAM graphics card Persistent capacity shortfall Hardware cost, installation and platform compatibility

Preventing the next VRAM OOM

  • Set a frame-rate, resolution and texture budget that leaves headroom for busy scenes and future patches.
  • Start long CUDA jobs with a known batch size, maximum sequence or image dimension, and precision setting.
  • Monitor allocated, reserved and total GPU memory during a representative peak, not only at startup.
  • Keep browser, recording and overlay applications out of a constrained gaming session.
  • Document the driver, CUDA, framework and model versions when a workload is stable so regressions are easier to identify.
  • Use memory snapshots for recurring PyTorch failures instead of repeatedly calling cache-clearing functions without evidence.

FAQ

Why does restarting fix an out-of-video-memory error temporarily?

Restarting destroys the old process and its GPU context, returning its allocations and cached blocks. It helps when another application or a previous run consumed memory, but it cannot make a permanently oversized workload fit.

Can system RAM be used as a replacement for VRAM?

Some APIs can page data through system memory, but that is substantially slower and does not guarantee that a game or CUDA allocation will succeed. Treat shared or unified-memory behavior as a platform-specific fallback, not an equivalent replacement for dedicated VRAM.

Should I call torch.cuda.empty_cache() after every batch?

No. It releases unused cached blocks to other GPU applications but does not free live tensors, and frequent calls can add synchronization and allocation overhead. Use it between independent workloads or when measurements show external contention.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I know whether I need more VRAM?

After closing competing applications and applying the appropriate game or compute reductions, compare the peak live allocation with the card’s capacity. If the required live data still exceeds that capacity at an acceptable quality or throughput, more VRAM is the direct solution.

Frequently Asked Questions

Why does restarting fix an out-of-video-memory error temporarily?

Restarting destroys the old process and its GPU context, returning its allocations and cached blocks. It helps when another application or a previous run consumed memory, but it cannot make a permanently oversized workload fit.

Can system RAM be used as a replacement for VRAM?

Some APIs can page data through system memory, but that is substantially slower and does not guarantee that a game or CUDA allocation will succeed. Treat shared or unified-memory behavior as a platform-specific fallback, not an equivalent replacement for dedicated VRAM.

Should I call torch.cuda.empty_cache() after every batch?

No. It releases unused cached blocks to other GPU applications but does not free live tensors, and frequent calls can add synchronization and allocation overhead. Use it between independent workloads or when measurements show external contention.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I know whether I need more VRAM?

After closing competing applications and applying the appropriate game or compute reductions, compare the peak live allocation with the card’s capacity. If the required live data still exceeds that capacity at an acceptable quality or throughput, more VRAM is the direct solution.

Quick Recap

SaleBestseller No. 1
ASUS Dual Radeon RX 9060 XT 16GB GDDR6 Gaming Graphics Card | PCIe 5.0, HDMI 2.1b, DisplayPort 2.1a, 2.5-slot design, Axial-tech Fans, 0dB Technology
ASUS Dual Radeon RX 9060 XT 16GB GDDR6 Gaming Graphics Card | PCIe 5.0, HDMI 2.1b, DisplayPort 2.1a, 2.5-slot design, Axial-tech Fans, 0dB Technology
0dB technology lets you enjoy light gaming in relative silence; Dual BIOS switch lets you toggle between Quiet and Performance BIOS profiles
$542.99
SaleBestseller No. 2
ASUS Dual GeForce RTX 5060 Ti 16GB GDDR7 OC Edition Gaming Graphics Card | PCIe 5.0, HDMI 2.1b, DisplayPort 2.1b, 2.5-slot, Axial-tech Fans, 0dB Technology, Dual BIOS
ASUS Dual GeForce RTX 5060 Ti 16GB GDDR7 OC Edition Gaming Graphics Card | PCIe 5.0, HDMI 2.1b, DisplayPort 2.1b, 2.5-slot, Axial-tech Fans, 0dB Technology, Dual BIOS
AI Performance: 767 AI TOPS; OC mode: 2632 MHz (OC mode)/ 2602 MHz (Default mode); Powered by the NVIDIA Blackwell architecture and DLSS 4
$765.99
Bestseller No. 4
ASUS ROG Astral GeForce RTX 5090 32GB GDDR7 OC Edition Gaming Graphics Card | PCIe 5.0, HDMI/DP 2.1, 3.8-slot, 4-fan, Axial-tech Fans, Vapor Chamber, Phase-change GPU Thermal Pad
ASUS ROG Astral GeForce RTX 5090 32GB GDDR7 OC Edition Gaming Graphics Card | PCIe 5.0, HDMI/DP 2.1, 3.8-slot, 4-fan, Axial-tech Fans, Vapor Chamber, Phase-change GPU Thermal Pad
Patented vapor chamber with milled heatspreader for lower GPU temperatures; Protective PCB coating guards against moisture, dust, and extreme temperatures
$7,998.00

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

CUDAGPUPC gamingPyTorchTroubleshootingVRAM

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.