Poetry2nix error: libcublas.so not found in system path

Hello, I’m currently working on configuring my Python environments using either poetry or poetry2nix. I’ve provided my pyproject.toml, poetry.lock and run.py for reference, but I’m encountering an error after running python run.py -d:

Traceback (most recent call last):
  File "/home/sukhman/Downloads/stanford_nlp_assignments/a3/student/.venv/lib/python3.10/site-packages/torch/__init__.py", line 168, in _load_global_deps
    ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
  File "/nix/store/pkj7cgmz66assy7l18zc7j992npb41nx-python3-3.10.12/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libcurand.so.10: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sukhman/Downloads/stanford_nlp_assignments/a3/student/run.py", line 16, in <module>
    from torch import nn, optim
  File "/home/sukhman/Downloads/stanford_nlp_assignments/a3/student/.venv/lib/python3.10/site-packages/torch/__init__.py", line 228, in <module>
    _load_global_deps()
  File "/home/sukhman/Downloads/stanford_nlp_assignments/a3/student/.venv/lib/python3.10/site-packages/torch/__init__.py", line 189, in _load_global_deps
    _preload_cuda_deps(lib_folder, lib_name)
  File "/home/sukhman/Downloads/stanford_nlp_assignments/a3/student/.venv/lib/python3.10/site-packages/torch/__init__.py", line 154, in _preload_cuda_deps
    raise ValueError(f"{lib_name} not found in the system path {sys.path}")
ValueError: libcublas.so.*[0-9] not found in the system path ['/home/sukhman/Downloads/stanford_nlp_assignments/a3/student', '/nix/store/pkj7cgmz66assy7l18zc7j992npb41nx-python3-3.10.12/lib/python310.zip', '/nix/store/pkj7cgmz66assy7l18zc7j992npb41nx-python3-3.10.12/lib/python3.10', '/nix/store/pkj7cgmz66assy7l18zc7j992npb41nx-python3-3.10.12/lib/python3.10/lib-dynload', '/home/sukhman/Downloads/stanford_nlp_assignments/a3/student/.venv/lib/python3.10/site-packages']
(student-py3.10)

NixOS system:

 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.49, NixOS, 23.11 (Tapir), 23.11pre521611.e56990880811`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.17.0`
 - channels(sukhman): `"home-manager, nixpkgs-unstable"`
 - channels(root): `"home-manager, nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Thank you :slight_smile: