Skip to content

Commit fbddb78

Browse files
committed
try not using svm on intel
1 parent 3fed163 commit fbddb78

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

arraycontext/impl/pytato/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,20 @@ def __init__(
379379
self.using_svm = None
380380

381381
if allocator is None:
382+
import pyopencl as cl
382383
from pyopencl.characterize import has_coarse_grain_buffer_svm
383384
has_svm = has_coarse_grain_buffer_svm(queue.device)
385+
386+
dev = queue.device
387+
if (has_svm
388+
and dev.type & cl.device_type.CPU
389+
and "intel" in dev.platform.name.lower()):
390+
# The Intel CPU OpenCL runtime advertises coarse-grain buffer
391+
# SVM, but its clEnqueueSVMFree corrupts the host heap ("double
392+
# free or corruption"), aborting the process. Fall back to
393+
# buffer allocation there.
394+
has_svm = False
395+
384396
if has_svm:
385397
self.using_svm = True
386398

0 commit comments

Comments
 (0)