Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUDAをつかっているとき、PCをレジュームしたあと漢字変換ができなくなる #191

Open
ShikiOkasaka opened this issue Oct 28, 2024 · 2 comments

Comments

@ShikiOkasaka
Copy link
Contributor

ShikiOkasaka commented Oct 28, 2024

レジューム後、さいしょに漢字変換をするときに、つぎのような例外が発生する。

2024-10-29 12:20:47,578:ERROR:__main__:crashed:
Traceback (most recent call last):
  File "/usr/share/ibus-hiragana/engine/engine.py", line 1546, in do_process_key_event
    return self._controller.process_key_event(self, keyval, keycode, state)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/ibus-hiragana/engine/event.py", line 370, in process_key_event
    processed = engine.process_key_event(event)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/ibus-hiragana/engine/engine.py", line 1412, in process_key_event
    result = self._process_surrounding_text(e)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/ibus-hiragana/engine/engine.py", line 996, in _process_surrounding_text
    return self._process_replace(e)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/ibus-hiragana/engine/engine.py", line 904, in _process_replace
    cand, size = self._assisted_lookup_dictionary(text, pos)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/ibus-hiragana/engine/engine.py", line 786, in _assisted_lookup_dictionary
    cand, cursor_pos = self._dict.assisted_lookup(self._model, plain, pos, anchor)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/ibus-hiragana/engine/dictionary.py", line 543, in assisted_lookup
    p_dict = model.assist(text[:pos - len(self._yomi)], self._yomi, self._cand)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/ibus-hiragana/engine/llm.py", line 266, in assist
    'input_ids': torch.tensor(truncated).unsqueeze(0).to(self._device)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: CUDA error: unspecified launch failure
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

OS: Ubuntu 24.04.1 LTS

@ShikiOkasaka
Copy link
Contributor Author

ShikiOkasaka commented Oct 28, 2024

done at 2f84b52
CUDAエラーがおきたあと、ひらがなIMEのエンジンを自動的に再起動します。
このとき、すこしのあいだ、IMEがうごいていない状態になります。

@ShikiOkasaka ShikiOkasaka changed the title CUDAをつかっているとき、レジュームしたあと漢字変換ができなくなる CUDAをつかっているとき、PCをレジュームしたあと漢字変換ができなくなる Oct 28, 2024
@ShikiOkasaka
Copy link
Contributor Author

ShikiOkasaka commented Oct 30, 2024

こちらも参考に: CUDA fails to reinitialize after system suspend
うまく設定できていれば、レジューム後にCUDAのRuntimeErrorもおきなくなります。

OS: Ubuntu 22.04.5 LTS, 24.04.1 LTSのばあい:

  1. 下記の内容でファイル /etc/modprobe.d/nvidia-power-management.conf をつくる。
options nvidia NVreg_PreserveVideoMemoryAllocations=1
options nvidia NVreg_TemporaryFilePath=/tmp
  1. initramfs を更新する。
$ sudo update-initramfs -u
  1. 再起動する。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant