You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using export IGC_OverrideOCLMaxParamSize=4096 to work around a similar kernel-argument-size issue in AMReX, and learned that the PVC GPU has a hardware limit of 2048 bytes (kernel argument register block). The IGC_OverrideOCLMaxParamSize setting doesn't change the hardware limit, but only hides the compiler message about exceeding it. In the AMReX case, this led to silent wrong answers, as I think it would in any case where a single kernel argument exceeds 2048 bytes.
Another case of this, on Aurora (Intel Data Center GPU Max 1550, Level Zero driver v1.3.33578, the LTS stack with ONEAPI_LTS=1), with oneAPI.jl 2.10.0, KernelAbstractions 0.10.7 and Julia 1.13.3.
An ExaModels (0.15) model of a process flowsheet fails while the model is being built, in the first kernel launched for one of its objective terms:
error: Total size of kernel arguments exceeds limit! Total arguments size: 4568, limit: 2048
in kernel: 'gpu_kerg_m(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, ...
ERROR: LoadError: ZeError: error occurred when building module, see build log for details
(code 1879048196, ZE_RESULT_ERROR_MODULE_BUILD_FAILURE)
ExaModels passes each expression pattern to its kernels by value, as an isbits struct whose size grows with the expression. In this model:
the term that fails is 4016 bytes on its own (sizeof on the host); the other kernel arguments account for the rest of the 4568;
45 of the 189 patterns are over 2048 bytes, 14 are over 4096, and the largest is 15,992 bytes.
The same model builds and solves on CUDA, where the largest pattern is within the limit there. Small models on the same Aurora stack are fine: MadNLP with SparseDirectSolver.jl solves HS15 and Luksan-Vlček (N = 20000) on oneVector{Float64}.
Given the comment above that IGC_OverrideOCLMaxParamSize only hides the message on PVC and can give silent wrong answers, I did not use it here; an override to 32768 would be needed and I have not tested it.
Two things that would help:
A check before the module is built: compare the size of the converted arguments with maxArgumentsSize (already exposed in lib/level-zero/device.jl) and throw an error that names the kernel, the size and the limit, instead of the IGC build log.
Passing oversized arguments indirectly: when the arguments exceed the limit, copy the large isbits ones into a USM buffer, pass the pointer, and load them at kernel entry. Metal.jl passes kernel arguments through an argument buffer, which may be a model for this.
Is (2) something you would take in oneAPI.jl, or should packages with large by-value arguments, such as ExaModels, handle it on their side?
Activity
maleadt commentedon Apr 18, 2025
OpenCL has
CL_DEVICE_MAX_PARAMETER_SIZE; I don't see an equivalent in Level Zero.kris-rowe commentedon Apr 18, 2025
I think that ze_device_module_properties_t.maxArgumentsSize is the equivalent.
maleadt commentedon Apr 18, 2025
Ah yes, my grep-fu was lacking this morning. Should be relatively easy to port that functionality, then.
zippylab commentedon Mar 13, 2026
I was using
export IGC_OverrideOCLMaxParamSize=4096to work around a similar kernel-argument-size issue in AMReX, and learned that the PVC GPU has a hardware limit of 2048 bytes (kernel argument register block). TheIGC_OverrideOCLMaxParamSizesetting doesn't change the hardware limit, but only hides the compiler message about exceeding it. In the AMReX case, this led to silent wrong answers, as I think it would in any case where a single kernel argument exceeds 2048 bytes.michel2323 commentedon Nov 12, 2026
Another case of this, on Aurora (Intel Data Center GPU Max 1550, Level Zero driver v1.3.33578, the LTS stack with
ONEAPI_LTS=1), with oneAPI.jl 2.10.0, KernelAbstractions 0.10.7 and Julia 1.13.3.An ExaModels (0.15) model of a process flowsheet fails while the model is being built, in the first kernel launched for one of its objective terms:
ExaModels passes each expression pattern to its kernels by value, as an isbits struct whose size grows with the expression. In this model:
sizeofon the host); the other kernel arguments account for the rest of the 4568;The same model builds and solves on CUDA, where the largest pattern is within the limit there. Small models on the same Aurora stack are fine: MadNLP with SparseDirectSolver.jl solves HS15 and Luksan-Vlček (N = 20000) on
oneVector{Float64}.Given the comment above that
IGC_OverrideOCLMaxParamSizeonly hides the message on PVC and can give silent wrong answers, I did not use it here; an override to 32768 would be needed and I have not tested it.Two things that would help:
maxArgumentsSize(already exposed inlib/level-zero/device.jl) and throw an error that names the kernel, the size and the limit, instead of the IGC build log.Is (2) something you would take in oneAPI.jl, or should packages with large by-value arguments, such as ExaModels, handle it on their side?