Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Numba examples in the Python tutorial are broken on Colab #46

Open
1 task done
jacobtomlinson opened this issue Feb 14, 2025 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@jacobtomlinson
Copy link
Member

jacobtomlinson commented Feb 14, 2025

Is this a duplicate?

Describe the bug

Changes to package versions in Google Colab break numba.

See rapidsai/deployment#528 for more information

Steps to reproduce

Expected behavior

The notebook runs

Actual behavior

The first numba cell fails

import numpy as np
from numba import cuda

data = np.asarray(range(10))
output = np.zeros(len(data))

@cuda.jit
def foo(input_array, output_array):
    i = cuda.grid(1)
    output_array[i] = input_array[i]
    
foo[1, len(data)](data, output)

output
/usr/local/lib/python3.11/dist-packages/numba_cuda/numba/cuda/dispatcher.py:536: NumbaPerformanceWarning: Grid size 1 will likely result in GPU under-utilization due to low occupancy.
  warn(NumbaPerformanceWarning(msg))
ERROR:numba.cuda.cudadrv.driver:Call to cuLinkAddData results in CUDA_ERROR_UNSUPPORTED_PTX_VERSION

---------------------------------------------------------------------------

CudaAPIError                              Traceback (most recent call last)

[/usr/local/lib/python3.11/dist-packages/numba_cuda/numba/cuda/cudadrv/driver.py](https://localhost:8080/#) in add_ptx(self, ptx, name)
   2806         try:
-> 2807             driver.cuLinkAddData(self.handle, enums.CU_JIT_INPUT_PTX,
   2808                                  ptxbuf, len(ptx), namebuf, 0, None, None)

10 frames

CudaAPIError: [222] Call to cuLinkAddData results in CUDA_ERROR_UNSUPPORTED_PTX_VERSION


During handling of the above exception, another exception occurred:

LinkerError                               Traceback (most recent call last)

[/usr/local/lib/python3.11/dist-packages/numba_cuda/numba/cuda/cudadrv/driver.py](https://localhost:8080/#) in add_ptx(self, ptx, name)
   2808                                  ptxbuf, len(ptx), namebuf, 0, None, None)
   2809         except CudaAPIError as e:
-> 2810             raise LinkerError("%s\n%s" % (e, self.error_log))
   2811 
   2812     def add_file(self, path, kind):

LinkerError: [222] Call to cuLinkAddData results in CUDA_ERROR_UNSUPPORTED_PTX_VERSION
ptxas application ptx input, line 9; fatal   : Unsupported .version 8.5; current version is '8.4'

Environment

No response

Additional context

There is a workaround from googlecolab/colabtools#5081 where you upgrade the numba-cuda package and enable JIT link for compatibility.

!uv pip install -q --system numba-cuda==0.4.0
from numba import config
config.CUDA_ENABLE_PYNVJITLINK = 1
@jacobtomlinson jacobtomlinson added the bug Something isn't working label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant