CUDA_ERROR_INVALID_HANDLE on rtx 5050

Hi everyone,
I recently bought a new laptop with an RTX 5050 GPU. I installed Ubuntu 24.04.2 LTS and then installed the NVIDIA drivers from the official website. Here’s what I see in nvidia-smi:

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 575.64.03              Driver Version: 575.64.03      CUDA Version: 12.9     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 5050 ...    Off |   00000000:01:00.0 Off |                  N/A |
| N/A   39C    P0              9W /   42W |      15MiB /   8151MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            2964      G   /usr/lib/xorg/Xorg                        4MiB |
+-----------------------------------------------------------------------------------------+

Then, I created a virtual environment and ran python3 -m pip install 'tensorflow[and-cuda].

TensorFlow installs and detects my GPU:

tf.config.list_physical_devices('GPU')
W0000 00:00:1752022359.118443    5335 gpu_device.cc:2430] TensorFlow was not built with CUDA kernel binaries compatible with compute capability 12.0. CUDA kernels will be jit-compiled from PTX, which could take 30 minutes or longer.
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]

But when I try to run any model or even a simple operation, I get this error

    raise core._status_to_exception(e) from None  # pylint: disable=protected-access
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tensorflow.python.framework.errors_impl.InternalError: {{function_node __wrapped__Mul_device_/job:localhost/replica:0/task:0/device:GPU:0}} 'cuLaunchKernel(function, gridX, gridY, gridZ, blockX, blockY, blockZ, 0, reinterpret_cast<CUstream>(stream), params, nullptr)' failed with 'CUDA_ERROR_INVALID_HANDLE' [Op:Mul] name: 

I’ve tried multiple TensorFlow versions. Version 2.16 doesn’t see the GPU. Only 2.19 detects the GPU, but I get that CUDA_ERROR_INVALID_HANDLE error. I suspect that full support for RTX 50xx series might not be available yet.

So:

  • Is there a known fix or workaround for this issue?
  • Should I just wait for TensorFlow 2.20? If so, does anyone know when it’s expected to be released?

I’d really appreciate any advice or a clear step-by-step guide to help me get this working.
Thanks in advance!