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

Add CUDA support for Linux #63

Merged
merged 24 commits into from
Nov 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add CUDA support for Linux
  • Loading branch information
Macoron committed Nov 26, 2023
commit d410345f6307eb68442764a8c4c09b099e339d9f
34 changes: 30 additions & 4 deletions build_cpp_linux.sh
Original file line number Diff line number Diff line change
@@ -11,15 +11,15 @@ clean_build(){
cd "$build_path"
}

build_linux() {
build_cpu() {
clean_build
echo "Starting building for Linux..."
echo "Starting building for CPU..."

cmake -DCMAKE_BUILD_TYPE=Release \
-DWHISPER_BUILD_TESTS=OFF -DWHISPER_BUILD_EXAMPLES=OFF ../
make

echo "Build for Linux complete!"
echo "Build for CPU complete!"

artifact_path="$build_path/libwhisper.so"
target_path="$unity_project/Packages/com.whisper.unity/Plugins/Linux/libwhisper.so"
@@ -28,4 +28,30 @@ build_linux() {
echo "Build files copied to $target_path"
}

build_linux
build_cuda() {
clean_build
echo "Starting building for CUDA..."

cmake -DWHISPER_CUBLAS=ON -DCMAKE_BUILD_TYPE=Release \
-DWHISPER_BUILD_TESTS=OFF -DWHISPER_BUILD_EXAMPLES=OFF ../
make

echo "Build for CUDA complete!"

artifact_path="$build_path/libwhisper.so"
target_path="$unity_project/Packages/com.whisper.unity/Plugins/Linux/libwhisper_cuda.so"
cp "$artifact_path" "$target_path"

echo "Build files copied to $target_path"
}

if [ "$targets" = "all" ]; then
build_cpu
build_cuda
elif [ "$targets" = "cpu" ]; then
build_cpu
elif [ "$targets" = "cuda" ]; then
build_cuda
else
echo "Unknown targets: $targets"
fi