kha-white / mokuro

Read Japanese manga inside browser with selectable text.
GNU General Public License v3.0
848 stars 65 forks source link

Can't get mokuro to work with GPU. #21

Closed avc1657 closed 1 year ago

avc1657 commented 2 years ago

Hi, i used the following command to install the requirements but mokuro still uses CPU only: pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116

Python location (version 3.9.12): \AppData\Local\Programs\Python\Python39\python.exe \AppData\Local\Microsoft\WindowsApps\python.exe

Mokuro location: \AppData\Local\Programs\Python\Python39\Scripts\mokuro.exe

OS: Windows 10

alexankitty commented 1 year ago

I ran into this issue myself, I opted to use cu117 instead.
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117
Make sure to also download and install the toolkit here https://developer.nvidia.com/cuda-11-7-0-download-archive
Then I verified it actually worked by running the following inside of python:

import torch
torch.cuda.is_available()

You will most likely need to remove your existing pips with pip uninstall torch torchvision torchaudio Lastly, make sure you do this all as an admin, or that your local packages in %appdata% are in your path environment variable. (If the latter is not the case it should throw some warnings about what to do about it)