Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCL platform vs device extensions #169

Closed
imyxh opened this issue Jan 24, 2025 · 3 comments
Closed

OpenCL platform vs device extensions #169

imyxh opened this issue Jan 24, 2025 · 3 comments
Labels

Comments

@imyxh
Copy link

imyxh commented Jan 24, 2025

// UUID
if (exts.find("cl_khr_device_uuid") != exts.end())
getKHRDeviceUUID(device, cd);
// PCI Info
if (exts.find("cl_khr_pci_bus_info") != exts.end())
getKHRPCIBusInfo(device, cd);
else TRY_CATCH_DEBUG(3, getPCIInfo(device, cd));

This seems to check that the OpenCL platform supports cl_khr_device_uuid and cl_khr_pci_bus_info. From what I have seen the notion of a platform extension is not extremely clear, and is probably not what we want to check for.

This issue blocks support for rusticl in fah-client (see FoldingAtHome/fah-client-bastet#239).

@jcoffland
Copy link
Member

I don't see anything wrong with this code. This is inline with how the OpenCL API is defined. There's no ambiguity other than that some drivers may be buggy and not implement it correctly.

Does your driver cause an exception in these calls? If so I'd need to see the logs from that. All I've seen is that you commented some of this code out and your GPU started working. The reason it might work without PCI info is because fah-client guesses which GPU it's talking to which is easy if there's only one GPU. The only reason I could see your GPU failing with the above code is if it claimed to support one of those extensions but then returned an error when the extension was actually queried. But I'm just guessing.

@karolherbst
Copy link

You can't rely on the platform extensions containing all supported device extensions as it's the intersection of device extensions, not an union.

So the platform must not advertise cl_khr_device_uuid if a single device doesn't advertise it either.

Granted, the opencl impl in question here doesn't build the intersection at runtime, so extensions might not be listed as platform extensions on top, but applications can't rely on them anyway. Please use CL_DEVICE_EXTENSIONS or better CL_DEVICE_EXTENSIONS_WITH_VERSION instead.

@jcoffland
Copy link
Member

I see, we need to be querying the device specific extensions rather than the platform extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants