I'm trying to run YOLOv8 inference using Ultralytics on CPU, but I get a RuntimeError: could not create a primitive. I'm using Windows and working in a virtual environment with PyTorch. I'm new to YOLO and would appreciate help understanding this.
🔁 Code I'm using:
from ultralytics import YOLO
model = YOLO('yolov8n')
results = model.predict('input_videos/08fd33_4.mp4', save=True, device='cpu', stream=True)
for r in results:
print(r)
print('======================================')
for box in r.boxes:
print(box)
Error:
RuntimeError: could not create a primitive
File ".../torch/nn/modules/conv.py", line 549, in _conv_forward
return F.conv2d(...)
My environment:
OS: Windows 11
Python: 3.12.9
Torch: 2.7.0
Ultralytics: 8.3.133
Device: CPU (no GPU)
My questions:
- How can I fix this error when running YOLOv8 on CPU?
- Is it possible the model needs GPU even for basic prediction?
- Are there config settings to make it work safely on CPU under Windows?

