khoj-ai / khoj

Your AI second brain. Self-hostable. Get answers from the web or your docs. Build custom agents, schedule automations, do deep research. Turn any online or local LLM into your personal, autonomous AI (e.g gpt, claude, gemini, llama, qwen, mistral).
https://khoj.dev
GNU Affero General Public License v3.0
15.39k stars 769 forks source link

[FIX] torch can not use GPU #924

Open andreiramani opened 1 month ago

andreiramani commented 1 month ago

Describe the bug

I have successfully setup khoj using conda, postgresql 16, pytorch=2.1.0, torchvision=0.16.0, torchaudio=2.1.0, pytorch-cuda=12.1.

How to set torch.device to use my GPU?

Screenshots/Error message

UserWarning: Failed to initialize NumPy: DLL load failed while importing _multiarray_umath: The specified module could not be found. (Triggered internally at C:\cb\pytorch_1000000000000\work\torch\csrc\utils\tensor_numpy.cpp:84.) device: torch.device = torch.device(torch._C._get_default_device()), # torch.device('cpu'),

Platform

andreiramani commented 1 month ago

Force upgrade to numpy 2.0.1 gave error start. So, I downgraded to numpy=1.26.4. Relaunch khoj successfully, but it still not detect the GPU.