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

Way to query free memory from an openCL backend on discrete Intel GPUs #810

Open
icfaust opened this issue Feb 9, 2025 · 3 comments
Open
Labels
Feature request New driver feature

Comments

@icfaust
Copy link

icfaust commented Feb 9, 2025

As a developer for the uxlfoundation on the oneDAL and scikit-learn-intelex, I would like to query the free memory of an Intel GPU when a level zero driver is unavailable, but an openCL is. This would be especially important for automated testing using Intel Data Center GPU products (Intel Max 1550) when accessing the underlying shared object memory allocations are not possible simply and/or directly.

While the functionality is available in SYCL when the level Zero SysMan is available, there is no equivalent for openCL backends on intel discrete products. However, for other vendors such functionality exists: nvmlDeviceGetMemoryInfo for NVidia and CL_DEVICE_GLOBAL_FREE_MEMORY_AMD for Radeon products.

Replicated from this reddit post (could not find the related issues in the compute-runtime closed/open list): https://www.reddit.com/r/OpenCL/comments/uocbbq/comment/i8rcfhs/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

@JablonskiMateusz JablonskiMateusz added the Feature request New driver feature label Feb 10, 2025
@eero-t
Copy link

eero-t commented Feb 12, 2025

@icfaust see #586.

@icfaust
Copy link
Author

icfaust commented Feb 13, 2025

@eero-t Thank you for the link, I do appreciate your suggestion here to use ze_sysman for querying the free memory. We use that successfully already on level-zero enabled discrete intel GPUs, however, in some cases we are trying to verify operation on openCL backends, while it is discussed how to query the total available memory on a device via openCL, it does not return the current free memory on a device.

@eero-t
Copy link

eero-t commented Feb 13, 2025

I was thinking of CL_DEVICE_MAX_MEM_ALLOC_SIZE adapting to available memory, but looking closer at spec: https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_DEVICE_MAX_MEM_ALLOC_SIZE

Its minimum value seems to be 1GB.

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

No branches or pull requests

3 participants