Skip to content

Commit

Permalink
README: add info on fix to GLIBCXX import error with cupy
Browse files Browse the repository at this point in the history
  • Loading branch information
NaderAlAwar committed Oct 3, 2023
1 parent 1514b5f commit 6b894e8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@ pip install --user -e .
```

Note that `cupy` is only required if CUDA is enabled in pykokkos-base.
In some cases, this might result in a `cupy` import error inside
`pykokkos` similar to the following

```
ImportError:
================================================================
Failed to import CuPy.
Original error:
ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /PATH/TO/ENV/lib/python3.11/site-packages/cupy/_core/core.cpython-311-x86_64-linux-gnu.so)
```

This is due to a mismatch in `libstdc++.so` versions between the
system library which `pykokkos-base` depends on and the library in the
conda environment which `cupy` depends on. This can be solved by
setting the `LD_PRELOAD` environment variable to force loading of the
correct library like so

```bash
export LD_PRELOAD=/PATH/TO/ENV/lib/libstdc++.so.6
```

To verify that `pykokkos` has been installed correctly, install
`pytest` and run the tests:
Expand Down

0 comments on commit 6b894e8

Please sign in to comment.