Closed altunenes closed 3 months ago
This project is really cool and working very well!! :)
Thanks
By the way I really appreciate bug reports. More than feature requests ;)
error: linking with
link.exe
failed: exit code: 1181 LINK : fatal error LNK1181: cannot open input file 'onnxruntime.lib'
Weird. I tested it on macOS and Windows. Fresh build works.
ort = { version = "2.0.0-rc.4", features = ["cuda", "load-dynamic"] }
Then looks like for some reason it failed to link onxxruntime statically but works dynamically (Although on my end it works)
Also, it works pretty fast actually! segmentation is better! But identification looked pretty much the same to me on my tests (well I can say 'slightly better, not significantly).
Yes it's super fast! Like one hour in a minute or less on CPU. And the speaker identification is pretty accurate. Wdym by segmentation is better?
Few things you can try check
Get-ChildItem -Recurse -Filter "*.lib"
Thank you! I solved it with clearing everything and re-install (onnx). The strange thing was that the project I'm working on for my academic project at the moment depends on exactly the same version of Ort and it works, but it didn't work here. I checked with some env variables and solved it.
PS: I hate having to work on a Windows machine 🥲
out of context: @thewh1teagle by the way, do you plan to use pyannote-rs with sherpa-rs for the transciption or using directly whishper-rs? I just wanted to hear your opinion. :) https://github.com/thewh1teagle/sherpa-rs/blob/main/examples/diarize_whisper.rs
by the way, do you plan to use pyannote-rs with sherpa-rs for the transciption or using directly whishper-rs? I just wanted to hear your opinion. :)
I plan to use whisper-rs directly. sherpa-rs (onnx) doesn't have enough support for whisper yet and it works much slower even with directml optimization with whisper.
I already added it to vibe. it works amazingly on macOS. But now I encountered the same issue you created here on Windows
log_when_knf-rs_link_dynamic_msvc.txt
Looks like the issues comes from ort
https://github.com/ggerganov/whisper.cpp/issues/2109#issuecomment-2274829722
Some notes for future
It solved the issue. cargo errors are very confusing and it was diffecult finding the cause. Native libraries such as whisper.cpp / onnxruntime / knf-rs depends on msvc runtime library for core c++ functions In single program the link of all the native libraries should be to the same kind of linking to msvc runtime
In general this is the setting and it should be set on every CmakeLists.txt https://cmake.org/cmake/help/latest/prop_tgt/MSVC_RUNTIME_LIBRARY.html
If the cmake is old / the config of cmake then the options in the link pasted won't work. knf-rs link msvc static, also onnx. but whisper doens't so that was the issue for me. I ended with custom whisper.cpp cmake file
if (MSVC)
set(CompilerFlags
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELEASE
)
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
endif()
"linking" releated errors are probably the most annoying errors in rust. And usually the problem is caused by version incompatibility of different libraries with each other... By the way, I got a different linking error when I tried to test this with sherpa-rs. But as you said, it makes more sense to continue with whisper-rs for now...
and bingo,
Some notes for future
It solved the issue. cargo errors are very confusing and it was diffecult finding the cause. Native libraries such as whisper.cpp / onnxruntime / knf-rs depends on msvc runtime library for core c++ functions In single program the link of all the native libraries should be to the same kind of linking to msvc runtime
In general this is the setting and it should be set on every CmakeLists.txt https://cmake.org/cmake/help/latest/prop_tgt/MSVC_RUNTIME_LIBRARY.html
If the cmake is old / the config of cmake then the options in the link pasted won't work. knf-rs link msvc static, also onnx. but whisper doens't so that was the issue for me. I ended with custom whisper.cpp cmake file
if (MSVC) set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE ) foreach(CompilerFlag ${CompilerFlags}) string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") endforeach() endif()
And now, I got exactly same error when I try it with whishper-rs hah! I will try your solution now
Some notes for future
It solved the issue. cargo errors are very confusing and it was diffecult finding the cause. Native libraries such as whisper.cpp / onnxruntime / knf-rs depends on msvc runtime library for core c++ functions In single program the link of all the native libraries should be to the same kind of linking to msvc runtime
In general this is the setting and it should be set on every CmakeLists.txt https://cmake.org/cmake/help/latest/prop_tgt/MSVC_RUNTIME_LIBRARY.html
If the cmake is old / the config of cmake then the options in the link pasted won't work. knf-rs link msvc static, also onnx. but whisper doens't so that was the issue for me. I ended with custom whisper.cpp cmake file
if (MSVC) set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE ) foreach(CompilerFlag ${CompilerFlags}) string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") endforeach() endif()
I'm still encountering the same error after making the changes. Since I have nearly no experience with CMake or Cpp, could you please specify exactly which file I should edit and where to find it in the whisper-rs project structure?
( I assumed I should edit the file at 'target\debug\build\whisper-rs-sys-eed943a0d7bbe2f1\out\whisper.cpp\CMakeLists.txt' and made the changes you recommended. But probably I'm probably on the wrong track). . Thank you for your patience :(
note my cmake version: 3.30.0
"linking" releated errors are probably the most annoying errors in rust. And usually the problem is caused by version incompatibility of different libraries with each other... By the way, I got a different linking error when I tried to test this with sherpa-rs. But as you said, it makes more sense to continue with whisper-rs for now...
Yes even now I don't fully understand the errors...
I'm still encountering the same error after making the changes. Since I have nearly no experience with CMake or Cpp, could you please specify exactly which file I should edit and where to find it in the whisper-rs project structure?
( I assumed I should edit the file at 'target\debug\build\whisper-rs-sys-eed943a0d7bbe2f1\out\whisper.cpp\CMakeLists.txt' and made the changes you recommended. But probably I'm probably on the wrong track). . Thank you for your patience :(
note my cmake version: 3.30.0
I forgot to mention that you also need to tell cargo to link msvc statically too
Set RUSTFLAGS
environment variable to -C target-feature=+crt-static
(clean and rebuild)
Also for patching whisper you need custom whisper-rs with custom git submodule of whisper.cpp which modified. See https://github.com/thewh1teagle/vibe/blob/feat/diarization-v1/core/Cargo.toml#L12C1-L14C4
This project is really cool and working very well!! :)
(I hate to be that person who always comes with such problems) but it fails simply with:
error: linking with
link.exe
failed: exit code: 1181 LINK : fatal error LNK1181: cannot open input file 'onnxruntime.lib'git clone cd pyannote-rs get models/example waw cargo run
but if I change tihs: ort = { version = "2.0.0-rc.4" }
with this, it works without error
ort = { version = "2.0.0-rc.4", features = ["cuda", "load-dynamic"] }
or with this (both is work):ort = { version = "2.0.0-rc.4", features = [ "load-dynamic"] }
Also, it works pretty fast actually! segmentation is better! But identification looked pretty much the same to me on my tests (well I can say 'slightly better, not significantly).
Thank you for your contributions!