0

I've been studying numba and tried to run this code:

import numpy as np
from numba import jit, cuda, vectorize
import math

@cuda.jit
def increment_a_2D_array(an_array):
    x, y = cuda.grid(2)
    if x < an_array.shape[0] and y < an_array.shape[1]:
       an_array[x, y] += 1
an_array = np.ones((10,10))

threadsperblock = (16, 16)
blockspergrid_x = math.ceil(an_array.shape[0] / threadsperblock[0])
blockspergrid_y = math.ceil(an_array.shape[1] / threadsperblock[1])
blockspergrid = (blockspergrid_x, blockspergrid_y)
increment_a_2D_array[blockspergrid, threadsperblock](an_array)

So when i run the code above it returns the following error:

CudaAPIError: Call to cuLinkCreate results in CUDA_ERROR_LAUNCH_TIMEOU

What could it be?

  • "cudaErrorLaunchTimeout = 702 This indicates that the device kernel took too long to execute." – talonmies Feb 09 '22 at 00:37
  • The timeout is triggered by the display driver trying to protect CUDA code from freezing the display. It is unusual that it would be triggered by such a toy example, which suggests you might have hardware or software installation issues of some sort. – talonmies Feb 09 '22 at 00:40

0 Answers0