In order to move a YOLO model to GPU you must use the pytorch .to syntax like so:
model = YOLO("yolov8n.pt", device='gpu')
model.to('cuda')
some useful docs here
You can also explicitly run a prediction and specify the device. See docs here
model.predict(source, save=True, imgsz=320, conf=0.5,device='xyz')