Keeping Intel GPU VRAM Alive — A SYCL Keepalive Solution for Local AI on Windows

Intel Arc B70 SYCL llama.cpp VRAM Keepalive C++ oneAPI

The Problem

If you use an Intel GPU on Windows without a monitor attached, you may encounter a frustrating issue: after approximately 60–70 seconds of inactivity, the driver unloads the VRAM. This is especially problematic when using the GPU for local AI inference with llama.cpp SYCL, as having your loaded model evicted from memory every few seconds not only degrades performance but can also break ongoing tasks.

I experienced this firsthand with my Intel Arc B70 card used for local AI workloads. The constant unloading and reloading of models was both annoying and disruptive.

The Solution

A simple keepalive program written in C++ using SYCL can prevent the driver from considering the GPU idle. It submits a lightweight no-op kernel every 10 seconds, keeping the GPU active without consuming meaningful resources:

#include <sycl/sycl.hpp>
#include <chrono>
#include <thread>
#include <iostream>

int main() {
    sycl::queue q{ sycl::gpu_selector_v };

    std::cout << "Running SYCL keep-alive on: "
              << q.get_device().get_info()
              << "\n";

    while (true) {
        q.submit([&](sycl::handler& h) {
            h.single_task([=]() {
                // no-op kernel
            });
        });
        q.wait();

        std::this_thread::sleep_for(std::chrono::seconds(10));
    }
}

Building the Program

Compile it with Intel's oneAPI compiler:

icx -fsycl keepalive.cpp -o keepalive.exe

Running the Program

You need to run it from an Intel oneAPI terminal. First initialize the environment by running:

"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64

Then simply execute the compiled binary. The program will keep your GPU alive and prevent the driver from unloading your AI model.