Skip to content

Conversation

tkatila
Copy link
Contributor

@tkatila tkatila commented May 27, 2025

No description provided.

@tkatila
Copy link
Contributor Author

tkatila commented May 27, 2025

Not tested on real hardware. Development done based on the kernel API and example listings from a real system.

@tkatila
Copy link
Contributor Author

tkatila commented May 28, 2025

I dropped the preferred allocation policy as it would require more than one NPU to exist and that's not expected as the NPUs are tied to CPUs.

@tkatila
Copy link
Contributor Author

tkatila commented Aug 5, 2025

Tested the plugin on a MeteorLake hardware. Plugin works ok: it registers the resource, container requesting the resources is started, and container gets the /dev/accel/ devices.
I also tried running some tests/demos. The results are mixed. Some pass while some don't.

I'll add a test Dockerfile into this PR and move this to "ready to review" state.

@tkatila
Copy link
Contributor Author

tkatila commented Aug 5, 2025

Added a workload dockerfile and a job for it. The workload has a selection of tests that I've tested to work. There are also additional tests, but they require the NPU compiler & openvino runtime, which can be included, but they take such a long time to compile.

@tkatila tkatila marked this pull request as ready for review August 5, 2025 19:12
@tkatila tkatila force-pushed the npu-plugin branch 3 times, most recently from 915ead2 to a7ccdbd Compare August 6, 2025 09:52
@tkatila tkatila force-pushed the npu-plugin branch 2 times, most recently from f84a009 to 347fd7b Compare August 11, 2025 11:05
Copy link
Contributor

@mythi mythi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@eero-t eero-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit-picks.

@tkatila
Copy link
Contributor Author

tkatila commented Aug 12, 2025

Thanks for the review @eero-t. I fixed all but two that I objected to.

Copy link
Contributor

@eero-t eero-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, assuming GPU->NPU typos will be fixed.

(Did not review the controller part, I'll leave that to somebody whole knows that functionality better.)

Comment on lines +80 to +82
setDefaultImageIfNeeded(&v.Spec.Image)
case *NpuDevicePlugin:
setDefaultImageIfNeeded(&v.Spec.Image)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These calls in the switch are all identical, so there could as well be just a single call after the switch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be written like so:

	// type switches can have only one type in a case so the same repeats for
	// all xDevicePlugin types.
	// TODO: implement receivers if more complex logic is needed.

	var image *string

	switch v := obj.(type) {
	case *DlbDevicePlugin:
		image = &v.Spec.Image
	case *DsaDevicePlugin:
		image = &v.Spec.Image
	case *FpgaDevicePlugin:
		image = &v.Spec.Image
	case *GpuDevicePlugin:
		image = &v.Spec.Image
	case *IaaDevicePlugin:
		image = &v.Spec.Image
	case *QatDevicePlugin:
		image = &v.Spec.Image
	case *SgxDevicePlugin:
		image = &v.Spec.Image
	case *NpuDevicePlugin:
		image = &v.Spec.Image
	default:
		return fmt.Errorf("%w: expected an xDevicePlugin object but got %T", errObjType, obj)
	}

	if len(*image) == 0 {
		*image = r.defaultImage
	}

But I'm not sure if it's any better.

tkatila and others added 4 commits August 13, 2025 09:33
Supports Core Ultra 1, 2 and 200V series NPUs.

Signed-off-by: Tuomas Katila <[email protected]>
Co-authored-by: Eero Tamminen <[email protected]>
Signed-off-by: Tuomas Katila <[email protected]>
Signed-off-by: Tuomas Katila <[email protected]>
@tkatila
Copy link
Contributor Author

tkatila commented Aug 13, 2025

Rebased against current main. I also verified that everything still works against a real hw.

@mythi mythi merged commit c81472c into intel:main Aug 13, 2025
139 of 166 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants