Skip to content

Calling random.random_sample with different dpctl device during same runtime causes error #614

Open
@reazulhoque

Description

@reazulhoque

The following program is resulting in error:

dpctl: fd63a3e2b15942e0b93f98e7dbbb14ae49e5a724
dpnp: 43a4b538722b26ca00b0a475e44a4a5f8376267c

import dpctl
import dpnp

with dpctl.device_context("level0:gpu:0"):
    gpu_result = dpnp.random.random_sample(9)

with dpctl.device_context("opencl:gpu:0"):
    gpu_result = dpnp.random.random_sample(9)

This is the output:

DPNP: Module NumPy found. Please load DPNP module before NumPy.

  warnings.warn("\nDPNP: Module NumPy found. Please load DPNP module before NumPy.\n")
Running on: Intel(R) Graphics [0x9bca]
DPCtrl SYCL queue used
SYCL kernels link time: 0.0918841 (sec.)

Traceback (most recent call last):
  File "different_device_reproducer.py", line 10, in <module>
    gpu_result = dpnp.random.random_sample(9)
  File "dpnp/dpnp/random/dpnp_iface_random.py", line 1169, in random_sample
    return dpnp_rng_random(size)
  File "dpnp/random/dpnp_algo_random.pyx", line 773, in dpnp.random.dpnp_algo_random.dpnp_rng_random
  File "dpnp/random/dpnp_algo_random.pyx", line 794, in dpnp.random.dpnp_algo_random.dpnp_rng_random
RuntimeError: Native API failed. Native API returns: -30 (CL_INVALID_VALUE) -30 (CL_INVALID_VALUE)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions