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

clean: remove opencl #366

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion .github/workflows/linux_special.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ jobs:
with:
path: |
desktop/src-tauri/openblas
desktop/src-tauri/clblast
desktop/src-tauri/ffmpeg
key: ${{ runner.os }}-pre-build

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ jobs:
with:
path: |
desktop/src-tauri/openblas
desktop/src-tauri/clblast
desktop/src-tauri/ffmpeg
key: ${{ matrix.platform }}-pre-build

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ openblas/
*.7z
.env
!samples/*
clblast/
vulkan_sdk/
vulkan_runtime/
schemas/
Expand Down
5 changes: 2 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@
"env": {
"FFMPEG_DIR": "${workspaceFolder}\\desktop\\src-tauri\\ffmpeg",
"OPENBLAS_PATH": "${workspaceFolder}\\desktop\\src-tauri\\openblas",
"CLBlast_DIR": "${workspaceFolder}\\desktop\\src-tauri\\clblast",
"LIBCLANG_PATH": "C:\\Program Files\\LLVM\\bin",
"PATH": "${env:PATH};${workspaceFolder}\\desktop\\src-tauri\\openblas\\bin;${workspaceFolder}\\desktop\\src-tauri\\clblast\\bin;${workspaceFolder}\\desktop\\src-tauri\\ffmpeg\\bin\\x64",
"RUSTFLAGS": "-L ${workspaceFolder}\\desktop\\src-tauri\\clblast\\lib -L ${workspaceFolder}\\desktop\\src-tauri\\openblas\\lib"
"PATH": "${env:PATH};${workspaceFolder}\\desktop\\src-tauri\\openblas\\bin;${workspaceFolder}\\desktop\\src-tauri\\ffmpeg\\bin\\x64",
"RUSTFLAGS": "-L ${workspaceFolder}\\desktop\\src-tauri\\openblas\\lib"
},
},
"args": [],
Expand Down
4 changes: 0 additions & 4 deletions core/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ fn main() {
// ffmpeg
let ffmpeg_dir = env::var("FFMPEG_DIR").unwrap_or_default();
let ffmpeg_dir = PathBuf::from(ffmpeg_dir);
// clblast
let clblast_dir = env::var("CLBlast_DIR").unwrap_or_default();
let clblast_dir = PathBuf::from(clblast_dir);

// openblas
let openblas_dir = env::var("OPENBLAS_PATH").unwrap_or_default();
Expand Down Expand Up @@ -94,7 +91,6 @@ fn main() {
format!("{}\\*.dll", ffmpeg_dir.join("bin\\x64").to_str().unwrap()),
format!("{}\\*.exe", ffmpeg_dir.join("bin\\x64").to_str().unwrap()),
format!("{}\\*.dll", openblas_dir.join("..\\bin").to_str().unwrap()),
format!("{}\\*.dll", clblast_dir.join("..\\..\\..\\bin").to_str().unwrap()),
];
for pattern in patterns {
for entry in glob::glob(&pattern).unwrap().flatten() {
Expand Down
3 changes: 2 additions & 1 deletion desktop/src-tauri/tauri.windows.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
}
},
"resources": {
"ffmpeg\\bin\\x64\\*": "./"
"ffmpeg\\bin\\x64\\*": "./",
"vulkan_runtime\\x64\\*.dll": "./"
}
}
}
12 changes: 8 additions & 4 deletions docs/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ _Vulkan (Linux)_
sudo apt-get install -y mesa-vulkan-drivers
```

_Vulkan (Windows)_

**Run as admin once!!!**

```console
bun run scripts\pre_build.js --vulkan
```

## Build

Install dependencies from `desktop` folder
Expand Down Expand Up @@ -66,7 +74,6 @@ See [whisper.cpp#nvidia-support](https://github.com/ggerganov/whisper.cpp?tab=re
"resources": {
"ffmpeg\\bin\\x64\\*.dll": "./",
"openblas\\bin\\*.dll": "./",
"clblast\\bin\\*.dll": "./",
"C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.5\\bin\\cudart64_*": "./",
"C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.5\\bin\\cublas64_*": "./",
"C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.5\\bin\\cublasLt64_*": "./"
Expand Down Expand Up @@ -130,7 +137,6 @@ Rust analyzer failed to run on windows
"rust-analyzer.cargo.extraEnv": {
"FFMPEG_DIR": "${workspaceFolder}\\desktop\\src-tauri\\ffmpeg",
"OPENBLAS_PATH": "${workspaceFolder}\\desktop\\src-tauri\\openblas",
"CLBlast_DIR": "${workspaceFolder}\\desktop\\src-tauri\\clblast",
"LIBCLANG_PATH": "C:\\Program Files\\LLVM\\bin"
}
```
Expand Down Expand Up @@ -226,7 +232,6 @@ cargo +nightly -Zunstable-options update --breaking
"rust-analyzer.runnables.extraEnv": {
"FFMPEG_DIR": "${workspaceFolder}\\desktop\\src-tauri\\ffmpeg",
"OPENBLAS_PATH": "${workspaceFolder}\\desktop\\src-tauri\\openblas",
"CLBlast_DIR": "${workspaceFolder}\\desktop\\src-tauri\\clblast",
"LIBCLANG_PATH": "C:\\Program Files\\LLVM\\bin"
},
"rust-analyzer.runnables.extraArgs": ["--release"]
Expand All @@ -238,7 +243,6 @@ cargo +nightly -Zunstable-options update --breaking
```console
bun run scripts/pre_build.js
# Export env
$env:PATH += ";$pwddesktop\src-tauri\clblast\bin"
$env:PATH += ";$pwd\desktop\src-tauri\openblas\bin"
cargo test --target x86_64-pc-windows-msvc --features "vulkan" -p vibe_core --release -- --nocapture
```
Expand Down
16 changes: 0 additions & 16 deletions scripts/pre_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ function hasFeature(name) {
const config = {
ffmpegRealname: 'ffmpeg',
openblasRealname: 'openblas',
clblastRealname: 'clblast',
vulkanRuntimeRealName: 'vulkan_runtime',
vulkanSdkRealName: 'vulkan_sdk',
windows: {
Expand All @@ -30,9 +29,6 @@ const config = {
openBlasName: 'OpenBLAS-0.3.26-x64',
openBlasUrl: 'https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.26/OpenBLAS-0.3.26-x64.zip',

clblastName: 'CLBlast-1.6.2-windows-x64',
clblastUrl: 'https://github.com/CNugteren/CLBlast/releases/download/1.6.2/CLBlast-1.6.2-windows-x64.zip',

vulkanRuntimeName: 'VulkanRT-1.3.290.0-Components',
vulkanRuntimeUrl: 'https://sdk.lunarg.com/sdk/download/1.3.290.0/windows/VulkanRT-1.3.290.0-Components.zip',
vulkanSdkName: 'VulkanSDK-1.3.290.0-Installer',
Expand Down Expand Up @@ -75,7 +71,6 @@ const config = {
const exports = {
ffmpeg: path.join(cwd, config.ffmpegRealname),
openBlas: path.join(cwd, config.openblasRealname),
clblast: path.join(cwd, config.clblastRealname, 'lib/cmake/CLBlast'),
libClang: 'C:\\Program Files\\LLVM\\bin',
cmake: 'C:\\Program Files\\CMake\\bin',
}
Expand Down Expand Up @@ -114,16 +109,6 @@ if (platform == 'windows') {
fs.cp(path.join(config.openblasRealname, 'lib/libopenblas.lib'), path.join(config.openblasRealname, 'lib/openblas.lib'))
}

// Setup CLBlast
if (!(await fs.exists(config.clblastRealname)) && !hasFeature('cuda')) {
await $`C:\\msys64\\usr\\bin\\wget.exe -nc --show-progress ${config.windows.clblastUrl} -O ${config.windows.clblastName}.zip`
await $`"C:\\Program Files\\7-Zip\\7z.exe" x ${config.windows.clblastName}.zip` // 7z file inside
await $`"C:\\Program Files\\7-Zip\\7z.exe" x ${config.windows.clblastName}.7z` // Inner folder
await $`mv ${config.windows.clblastName} ${config.clblastRealname}`
await $`rm ${config.windows.clblastName}.zip`
await $`rm ${config.windows.clblastName}.7z`
}

// Setup Vulkan
if (!(await fs.exists(config.vulkanSdkRealName)) && hasFeature('vulkan')) {
await $`C:\\msys64\\usr\\bin\\wget.exe -nc --show-progress ${config.windows.vulkanSdkUrl} -O ${config.windows.vulkanSdkName}.exe`
Expand Down Expand Up @@ -344,7 +329,6 @@ if (action?.includes('--build' || action.includes('--dev'))) {
process.env['FFMPEG_DIR'] = exports.ffmpeg
if (platform === 'windows') {
process.env['OPENBLAS_PATH'] = exports.openBlas
process.env['CLBlast_DIR'] = exports.clblast
process.env['LIBCLANG_PATH'] = process.env['LIBCLANG_PATH'] || exports.libClang
process.env['PATH'] = `${process.env['PATH']};${exports.cmake}`
}
Expand Down
Loading