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

Numba 0.61.0 broken on Google Colab (Feb 25) #528

Open
jacobtomlinson opened this issue Feb 14, 2025 · 2 comments
Open

Numba 0.61.0 broken on Google Colab (Feb 25) #528

jacobtomlinson opened this issue Feb 14, 2025 · 2 comments
Labels
bug Something isn't working platform/colab

Comments

@jacobtomlinson
Copy link
Member

jacobtomlinson commented Feb 14, 2025

As of Feb 13th 2025 the latest numba release 0.61.0 is not compatible with the Google Colab GPU runtime.

Reproducer

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'
@jacobtomlinson jacobtomlinson added bug Something isn't working platform/colab labels Feb 14, 2025
@jacobtomlinson jacobtomlinson changed the title Numba broken on Colab Numba 0.61.0 broken on Colab (Feb 25) Feb 14, 2025
@jacobtomlinson jacobtomlinson changed the title Numba 0.61.0 broken on Colab (Feb 25) Numba 0.61.0 broken on Google Colab (Feb 25) Feb 14, 2025
@jacobtomlinson
Copy link
Member Author

jacobtomlinson commented Feb 14, 2025

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

@ncclementi
Copy link
Contributor

cc: @taureandyernv for visibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform/colab
Projects
None yet
Development

No branches or pull requests

2 participants