
NVIDIA RTX 4090: How to Optimize Drivers for Stable Diffusion and AI Rendering
Optimize NVIDIA RTX 4090 drivers for Stable Diffusion and AI rendering. Achieve up to 7.4 it/s on SDXL using Studio drivers, SDP attention, and the right PyTorch setup.
The RTX 4090 ships with 24 GB of GDDR6X and 16,384 CUDA cores, yet many users still see inference speeds drop 20–90 % after a driver update. The difference between a 7.4 it/s SDXL session and a crawl at 2.5 it/s usually comes down to driver choice and a handful of settings rather than the card itself.
Core Specifications That Matter for AI Workloads
The AD102 die contains 512 fourth-generation Tensor Cores and 128 third-generation RT Cores on a 384-bit bus. Memory bandwidth reaches roughly 1 TB/s at 21 Gbps. TDP sits at 450 W and compute capability is 8.9. These numbers hold across every retail board.
Key specs at a glance
| Feature | Value |
|---|---|
| VRAM / Bus | 24 GB GDDR6X / 384-bit |
| Tensor Cores | 512 (4th-gen) |
| FP32 Peak | 82.6 TFLOPS |
| TDP | 450 W |
| Process | TSMC 4N |
Consumer cards lack NVLink, so any multi-GPU setup requires separate PCIe lanes and explicit code handling.
Studio Drivers vs Game Ready Drivers
Studio Drivers carry targeted fixes for creative and AI frameworks. Release 591.44 WHQL (December 2025) adds support for NVFP8/FLUX.2 in ComfyUI and TensorRT-RTX acceleration in Topaz tools. Earlier Game Ready branches (532–535) introduced memory-management changes that slowed Ada GPUs.
Most people get consistent results by staying on the Studio branch or rolling back to 537.58. Install the Studio package, test it, and switch only if something breaks.
Measured Performance on Stable Diffusion Workloads
TensorRT pipelines on the 4090 clear one 512×512 image per second on SD 1.5. At 1024×1024 with SDXL, ComfyUI typically hits 7.2–7.4 it/s when --opt-sdp-attention and PyTorch 2.0+ cu118 are active. The same job drops below 3 it/s with mismatched drivers or xformers on newer Torch builds.
Representative it/s figures (30–35 steps, SDXL 1024×1024)
| Configuration | it/s range |
|---|---|
| ComfyUI + SDP + Studio 591.44 | 7.2–7.4 |
| A1111 + xformers + 535 driver | 2.5–4.0 |
| Fooocus default settings | 6.7–6.9 |
Recommended Configuration Steps
Follow this sequence to eliminate the most common driver-related slowdowns.
flowchart TD
A[Install Studio Driver 591.44] --> B[Set python.exe & WebUI to Maximum Performance in NVIDIA Control Panel]
B --> C[Disable Hardware-Accelerated GPU Scheduling]
C --> D[Launch WebUI with --opt-sdp-attention --no-half-vae]
D --> E[Confirm PyTorch 2.0+ cu118 + matching cuDNN]
E --> F[Run test workload]
- Download and install NVIDIA Studio Driver 591.44 (or the last verified stable build).
- Open NVIDIA Control Panel and set the 3D profile for python.exe and the WebUI executable to Maximum Performance.
- Turn off Hardware-Accelerated GPU Scheduling in Windows Graphics settings.
- Launch the WebUI with these flags:
COMMANDLINE_ARGS=--opt-sdp-attention --no-half-vae
- Confirm the environment uses PyTorch 2.0.0+cu118 (or newer CUDA 12.x builds) with matching cuDNN libraries.
Common Pitfalls and Quick Fixes
- HAGS enabled: Re-enable only after you verify it does not hurt throughput on your model.
- xformers on Ada: Stick with SDP attention unless you have an older PyTorch build that still benefits from xformers.
- Driver rollback needed: Run DDU in Safe Mode, then install the target Studio package. Do not mix branches.
“Performance is highly sensitive to driver version, cuDNN, PyTorch build, and the attention flag chosen.” — aggregated GitHub and Reddit reports.
Pricing Context
New retail cards list between $2,194 and $2,755. Used units move in the $1,100–$1,400 range. At those prices the 4090 remains the highest-VRAM single-GPU option for local Stable Diffusion until next-generation cards arrive.
Key Takeaways
- Start with Studio Drivers for AI work—test 591.44 first.
- Use
--opt-sdp-attentionand disable HAGS. - Match PyTorch and cuDNN versions to the driver branch.
- Expect 7+ it/s on SDXL 1024×1024 under the optimized stack.
The 4090 still delivers strong local inference numbers in 2025 once the software stack lines up with the hardware.