numba-dpex icon indicating copy to clipboard operation
numba-dpex copied to clipboard

Can't run simple program on GPU

Open ZzEeKkAa opened this issue 1 year ago • 1 comments

I'm trying to run simple dpjit code:

import dpnp as dnp
import numpy as np
import numba as nb
from numba_dpex import dpjit

@dpjit
def _sum_nomask(res):
    tot = nb.float32(1.0)
    res[1] = tot

if __name__ == "__main__":
    arr = dnp.arange(10, dtype=np.float32)
    _sum_nomask(res)
    print("dpex:", res)

The example works on cpu, but does not work on GPU:

ONEAPI_DEVICE_SELECTOR=opencl:gpu python example.py
[1]    2251 segmentation fault  ONEAPI_DEVICE_SELECTOR=opencl:gpu python numba_dpex_jax.py

Running on integrated intel gpu 12th gen

ZzEeKkAa avatar Jul 06 '23 18:07 ZzEeKkAa

Following works:

@dpjit
def _sum_nomask2():
    tot=nb.float32(2.0)
    return tot

if __name__ == "__main__":
    arr = dnp.arange(10, dtype=np.float32)
    arr[1]=_sum_nomask2()
    print("done")
    print("dpex:", arr)

mingjie-intel avatar Jul 06 '23 19:07 mingjie-intel