> ## Content Index
> Fetch the complete content index at: https://www.stirup.si/llms.txt
> Use this file to discover other available public pages before exploring further.

# Sharing a T4 between Qwen and SDXL: a cautious operating procedure
- URL: https://www.stirup.si/sharing-a-t4-between-qwen-and-sdxl-a-cautious-operating-procedure-96744679/
- Published: 2026-10-12T15:44:27.000Z
- Updated: 2026-10-12T15:44:27.000Z
- Description: A measured, conservative procedure for inspecting GPU memory, checking inference queues and running reversible image jobs on a shared T4.
- Author: Satish Das
- Tags: Infrastructure, Guide, Hardware

A shared GPU can look idle while most of its useful capacity is already committed. Before adding an image generator beside a language model, inspect loaded models, waiting work and memory together. This guide describes the conservative checks used in Stirup's own automated test run on 12 October 2026\. It is not a general throughput benchmark, and it does not establish that two arbitrary models can safely run at once.

## What this procedure assumes

The commands below assume a Linux host with a working NVIDIA driver, the `nvidia-smi` utility, curl, an existing ComfyUI service on loopback port 8188 and an existing Ollama service on loopback port 11434\. Run them on that host through an already trusted administrative session. If your services use different addresses or authentication, use their actual documented configuration. Do not expose a private inference service to the internet just to make these commands work.

This is an inspection and scheduling procedure, not an installation recipe. It does not require restarting either service, clearing someone else's queue, changing driver versions or replacing model weights. On a shared machine, establish who owns each workload before making any change that might interrupt it.

## Check memory before calling the GPU idle

```
nvidia-smi --query-gpu=memory.used,memory.free,utilization.gpu --format=csv,noheader,nounits
```

The three values report used memory, free memory and utilization for each GPU. NVIDIA documents the selective-query and CSV output options in its [nvidia-smi reference](https://docs.nvidia.com/deploy/nvidia-smi/index.html?ref=stirup.si). Save the command and output with the test record rather than interpreting a single percentage in isolation.

In Stirup's initial observation, the Tesla T4 showed 5,405 MiB used even though utilization was zero. ComfyUI already had a model resident. That distinction matters operationally: a moment with no active computation is not the same as an empty accelerator. A short sample also cannot rule out a burst of work immediately afterward.

## Inspect both services, not just their processes

```
curl --fail --silent --show-error http://127.0.0.1:8188/queue
curl --fail --silent --show-error http://127.0.0.1:11434/api/ps
```

ComfyUI's queue response exposes running and pending work. Ollama's model-list endpoint reports currently loaded models. These are separate checks: an empty image queue says nothing about a resident language model. The interfaces are documented in the [ComfyUI route reference](https://docs.comfy.org/development/comfyui-server/comms%5Froutes?ref=stirup.si) and [Ollama running-model reference](https://docs.ollama.com/api/ps?ref=stirup.si).

For this deployment, the image worker defers if either ComfyUI queue is nonempty or Ollama reports any loaded model. It also defers below 6,000 MiB of reported free memory or above five percent utilization. Those thresholds are local conservative choices, not vendor guarantees or universal sizing recommendations. The worker repeats the checks before submitting a job, but another application can still start between inspection and submission.

## Use one image job and preserve its receipt

The test worker submitted one image at a time through ComfyUI's existing local API. It used the installed SDXL Base 1.0 checkpoint, a 1,152 by 640 latent image, batch size one, 20 sampling steps, DPM++ 2M and the Karras schedule. It did not install an alternative model or clear the existing cache. Each job retained its prompt, seed, model filename, source association and returned prompt identifier.

That identifier is important when a request times out. A client timeout does not prove that the server rejected the job. Our worker records a submission before sending it, and an interrupted or ambiguous run requires reconciliation instead of automatic resubmission. It does not call ComfyUI's global interrupt or memory-clearing controls. A local file lock serializes this worker's own jobs; it does not coordinate unrelated clients that ignore the same lock.

For another installation, start with a single bounded test during an agreed quiet period. Record the settings and inspect the queue again afterward. Do not turn a successful first sample into an unattended schedule until you have tested your own larger prompts, intended resolutions and failure handling.

## What the measured run actually showed

| Illustration sample           | Worker elapsed time | Peak sampled GPU memory |
| ----------------------------- | ------------------- | ----------------------- |
| Geospatial research concept   | 15.92 seconds       | 5,629 MiB               |
| Software-isolation concept    | 15.67 seconds       | 5,629 MiB               |
| Industrial-controller concept | 15.64 seconds       | 5,629 MiB               |

These are three sequential observations from one existing installation, not statistically representative performance results. Worker time includes polling, retrieval and image conversion; it is not pure diffusion time. Memory was sampled periodically, so a shorter transient peak could have been missed. The installed service used ComfyUI 0.38.0, PyTorch 2.7.1 with CUDA 12.8 and its low-VRAM startup option.

A separate Qwen3 14B Q4\_K\_M request used a 2,048-token context setting and returned 24 output tokens. Its measured wall time was 7.27 seconds, including 5.66 seconds reported for loading. Immediately after that request, nvidia-smi reported 13,813 MiB used and 1,100 MiB free while ComfyUI's cached model remained resident. We did not run diffusion and text generation simultaneously. These observations support deferring new image work while Ollama is loaded; they do not prove concurrent generation is safe.

## Keep the output honest and the rollout reversible

Our image worker produced 1,200 by 630, 800 by 420 and 400 by 210 WebP variants after generation. This conversion does not create extra source detail. Every asset retains an image digest, prompt and source association, and requires visual inspection before use. A near-blank-image check catches some failures but cannot establish that an illustration depicts the intended subject accurately.

Use explicit captions for synthetic editorial artwork. It should not be mistaken for a product photograph, a measured chart, a real screenshot or evidence of an incident. In the tested backfill, only featured-image fields changed, with Ghost's update timestamp used as a concurrency check. Article bodies, canonical URLs and access settings were checked for preservation, and the previous image values were saved for rollback.

The practical stopping rule is simple: defer when ownership or capacity is unclear. For this shared T4, the tested policy favors predictable, sequential jobs over squeezing a second generator into the last available memory. Larger context windows, other quantizations, different image sizes, cold starts and sustained production traffic still need their own tests.

## Test and editorial disclosure

This guide was prepared by an AI assistant from recorded commands, execution results and the linked primary documentation, then checked against those records. It is not independently human-verified. No comparative hardware ranking, long-duration reliability claim or universal capacity guarantee is made. The diagnostic commands were exercised against the existing test host; no public service exposure or shared-workload interruption was part of the procedure.