Google colab tutorial on GPU: "OSError: libcudart.so.10.2: cannot open shared object file: No such file or directory"

Viewed 318

I am trying to run a PyTorch geometric tutorial from this webpage; specifically, tutorial #3 on Graph Classification. Before running any cells I connected to GPU by selecting Runtime --> change runtime type --> GPU, and the command !nvidia-smi returns the following info:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.74       Driver Version: 460.32.03    CUDA Version: 11.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 K80           Off  | 00000000:00:04.0 Off |                    0 |
| N/A   44C    P8    31W / 149W |      3MiB / 11441MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

However, when I execute the following lines from the second code block:

import torch
from torch_geometric.datasets import TUDataset

I see this error message:

OSError: libcudart.so.10.2: cannot open shared object file: No such file or directory

I am using Chrome OS Version 93.0.4577.95 (Official Build) (64-bit). Interestingly, I have run this tutorial before on GPU without problems; I only started seeing this error when I returned to re-run the notebook today. I have tried a factory reset of runtime to no effect.

I can see a number of other help articles with a similar error, but the most relevant one seems to be this post where the solution was to connect to GPU runtime. I can't find other examples of this occurring in a colab tutorial. It was my impression that colab tutorials such as this one should generally run out-of-the-box, and I'm not sure what I need to install or import to fix it. I appreciate any advice you may have, thanks.

Full stack trace:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-3-00fc1f8d4ac6> in <module>()
      1 import torch
----> 2 from torch_geometric.datasets import TUDataset
      3 
      4 dataset = TUDataset(root='data/TUDataset', name='MUTAG')
      5 

6 frames
/usr/local/lib/python3.7/dist-packages/torch_geometric/__init__.py in <module>()
      5 from .debug import is_debug_enabled, debug, set_debug
      6 
----> 7 import torch_geometric.data
      8 import torch_geometric.loader
      9 import torch_geometric.transforms

/usr/local/lib/python3.7/dist-packages/torch_geometric/data/__init__.py in <module>()
----> 1 from .data import Data
      2 from .hetero_data import HeteroData
      3 from .temporal import TemporalData
      4 from .batch import Batch
      5 from .dataset import Dataset

/usr/local/lib/python3.7/dist-packages/torch_geometric/data/data.py in <module>()
      1 from typing import (Optional, Dict, Any, Union, List, Iterable, Tuple,
      2                     NamedTuple, Callable)
----> 3 from torch_geometric.typing import OptTensor, NodeType, EdgeType
      4 from torch_geometric.deprecation import deprecated
      5 

/usr/local/lib/python3.7/dist-packages/torch_geometric/typing.py in <module>()
      2 
      3 from torch import Tensor
----> 4 from torch_sparse import SparseTensor
      5 
      6 # Types for accessing data ####################################################

/usr/local/lib/python3.7/dist-packages/torch_sparse/__init__.py in <module>()
     14 ]:
     15     torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
---> 16         f'{library}_{suffix}', [osp.dirname(__file__)]).origin)
     17 
     18 if torch.cuda.is_available():  # pragma: no cover

/usr/local/lib/python3.7/dist-packages/torch/_ops.py in load_library(self, path)
    102             # static (global) initialization code in order to register custom
    103             # operators with the JIT.
--> 104             ctypes.CDLL(path)
    105         self.loaded_libraries.add(path)
    106 

/usr/lib/python3.7/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    362 
    363         if handle is None:
--> 364             self._handle = _dlopen(self._name, mode)
    365         else:
    366             self._handle = handle

OSError: libcudart.so.10.2: cannot open shared object file: No such file or directory
0 Answers
Related