mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[GH-ISSUE #94] ImportError: DLL load failed while importing KTransformersOps: The specified module was not found. #49
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SCP12rs on GitHub (Sep 21, 2024).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/94
Error during model run

@SCP12rs commented on GitHub (Sep 21, 2024):
Everything seems to be in place, but the error won't go away.
I use ktransformers-0.1.1+cu125torch24avx2-cp311-cp311-win_amd64.whl
@SCP12rs commented on GitHub (Sep 21, 2024):
Tried to build the project via .bat
An error occurred.
@UnicornChan commented on GitHub (Sep 22, 2024):
Do you have CUDA installed and set in the environment variables?
I see the final compilation error is due to failing to get the CUDA version.
@SCP12rs commented on GitHub (Sep 23, 2024):
Maybe I didn't patch it correctly?
@SCP12rs commented on GitHub (Sep 23, 2024):
Update
@UnicornChan commented on GitHub (Sep 25, 2024):
I'm very sorry about it. The Windows server I previously used for testing was tested with CUDA 12.5, but not with CUDA 12.6. The script failure might be due to the version update. I will upgrade my Windows server and re-test to verify this issue.
@SCP12rs commented on GitHub (Sep 26, 2024):
Thank you. I will keep an eye on your project. Very high hopes.
@micellince commented on GitHub (Feb 11, 2025):
pip install torch装的是cpu版本的,卸载换对应cuda版本的torch就好了。
@micellince commented on GitHub (Feb 11, 2025):
pip uninstall torch ....
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124 ( or 121 126.....).
@fshurra commented on GitHub (Feb 12, 2025):
I meet the same problem recently using a raw python install.
the problem solved after inject the "os.add_dll_directory" to let is search for the cuda library path.
This problem might came from the default .dll searching manner of your python install.
Please check this answer. https://stackoverflow.com/a/71645987/29078640
This problem might simply caused by not using the python inside conda env.
As I will have no surprise if the conda env have patched this default manner for searching .dll
(just like what they have done on searching .so)
@elijahxb commented on GitHub (Feb 15, 2025):
same issue.
@fshurra could you please show us how to add_dll_directory,i mean where the cuda library path is?
for example, should i add the code like below?
os.add_dll_directory('C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\lib\x64')@shijd32 commented on GitHub (Feb 15, 2025):
same issue:
File "D:\ProgramData\anaconda3\envs\Ktransformers\Lib\site-packages\ktransformers\util\custom_gguf.py", line 27, in
import KTransformersOps
ImportError: DLL load failed while importing KTransformersOps: 找不到指定的程序。
How can I solve this problem? Thank you very much!
@shijd32 commented on GitHub (Feb 16, 2025):
WHO KNOW?
@YoungITer commented on GitHub (Feb 16, 2025):
I have the same problem. Please help
@fshurra commented on GitHub (Feb 17, 2025):
@elijahxb
Yes. Please add this directory in the "site-packages\ktransformers\util\custom_gguf.py"
before "import KTransformersOps"
This solved the problem for me.
@ErvinXie commented on GitHub (Dec 11, 2025):
This issue has been automatically closed due to inactivity for 60 days.
If you believe this issue is still relevant, please feel free to reopen it with additional information or context.
Thank you for your contribution to KTransformers!
此 issue 因超过 60 天无活动而被自动关闭。
如果您认为此问题仍然存在,请随时重新打开并提供更多信息或上下文。
感谢您对 KTransformers 的贡献!