Attempting to run PyOpenCL on google colab GPU environment returns that no devices were found

50 Views Asked by At

I was trying to start my program that I had running before on Google Colab once again, but this time, the moment I invoke

!sudo apt update
!sudo apt purge *nvidia* -y
!sudo apt install nvidia-driver-530 -y
!pip install pyopencl
!pip install tqdm

and right after that

import pyopencl as cl
ctx = cl.create_some_context()

It returns me an error:

LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR

I have launched my notebook in a GPU environment and nvidia-smi shows me this:

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.104.05             Driver Version: 535.104.05   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| 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  Tesla T4                       Off | 00000000:00:04.0 Off |                    0 |
| N/A   45C    P8               9W /  70W |      0MiB / 15360MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |

So I definetely have a GPU environment attached and visible. I also tried to run an clinfo command, and it shows me that NVIDIA Tesla T4 is visible. I have also tried to run a CUDA example program using PyCuda and it worked completely fine.

I tried to reinstall the drivers and to install difirent version of the drivers.

0

There are 0 best solutions below