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

Google Colab With Cuda 12.4 and Numba gives - CUDA_ERROR_UNSUPPORTED_PTX_VERSION #5081

Closed
mnielsm opened this issue Feb 1, 2025 · 10 comments
Labels

Comments

@mnielsm
Copy link

mnielsm commented Feb 1, 2025

Describe the current behavior
I am using NUMBA on the GPU and as of a couple of days it no longer works in google colab.

The following code worked fine before and now it doesn't any more.

from numba import cuda
import numpy as np

@cuda.jit
def increment_by_one(an_array):
    pos = cuda.grid(1)
    if pos < an_array.size:
        an_array[pos] += 1

an_array = np.zeros(10)
increment_by_one[16,16](an_array)

Describe the expected behavior
It shows an error about CUDA_ERROR_UNSUPPORTED_PTX_VERSION which seems to come from the CUDA driver.

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'

What web browser you are using
Doesn't matter for this bug

Additional context
Crossposted to the NVIDIA NUMBA CUDA github as bug (link)

@mnielsm
Copy link
Author

mnielsm commented Feb 2, 2025

When looking a bit futher I expect the issue to be that the Nvidia T4 Driver (550.54.15) only supports CUDA 12.4 as far as I can find on the NVIDIA page (link)
And the current installed CUDA Runtime Version is 12.5.

After updating cuda in google colab to 12.8 the error changes slightly (from unsupported version 8.5 to 8.7 so it has to do something with the version of CUDA installed in google colab:

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

@lizhieffe
Copy link

Short-term workaround:

In the colab, switch to the fallback version in the Command palette. It changes the CUDA runtime to 12.2

(I met the same issue today and this works for me)

@metrizable
Copy link
Contributor

metrizable commented Feb 2, 2025

@mnielsm Thanks for filing the issue and thanks for using Colab.

If you'd like to use numba with CUDA, you'll want to install the latest version of the numba-cuda package, since the CUDA target built into Numba was deprecated and further development has been moved to the NVIDIA numba-cuda package.

!uv pip install -q --system numba-cuda==0.4.0

And to ensure that numba-cuda uses the JIT link for compatibility, specify the following:

from numba import config
config.CUDA_ENABLE_PYNVJITLINK = 1

Example:

Image

Also, as aside, for small examples, you can hide the low occupancy warnings, if desired, by specifying:

config.CUDA_LOW_OCCUPANCY_WARNINGS = 0

We will consider pre-installing numba-cuda==0.4.0 in the runtime in the future.

@mnielsm
Copy link
Author

mnielsm commented Feb 3, 2025

@mnielsm Thanks for filing the issue and thanks for using Colab.

If you'd like to use numba with CUDA, you'll want to install the latest version of the numba-cuda package, since the CUDA target built into Numba was deprecated and further development has been moved to the NVIDIA numba-cuda package.

!uv pip install -q --system numba-cuda==0.4.0
And to ensure that numba-cuda uses the JIT link for compatibility, specify the following:

from numba import config
config.CUDA_ENABLE_PYNVJITLINK = 1
Example:

Image

Also, as aside, for small examples, you can hide the low occupancy warnings, if desired, by specifying:

config.CUDA_LOW_OCCUPANCY_WARNINGS = 0
We will consider pre-installing numba-cuda==0.4.0 in the runtime in the future.

Well I was doubtful this would do it but it seems to work fine indeed with the numba-cuda package.

@metrizable
Copy link
Contributor

Re: #5061, great to hear!

@oginito
Copy link

oginito commented Feb 8, 2025

it worked for me also. many thanks!!

@HadasRavikovitch
Copy link

Hi,
I have the same problem but this commands didnt solve it for me :(
Is there any other way you know?
Maybe something different in my case?

Image Image Image

@Yaroslav-Muravev
Copy link

Add '--force-reinstall' after the command. It helped me

@HadasRavikovitch
Copy link

It worked!
Thank you so much :)

@TLTechbender
Copy link

Super Helpful, Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants