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

Link failure on Windows when compiling with Tauri #1138

Open
dvx opened this issue Feb 13, 2025 · 0 comments
Open

Link failure on Windows when compiling with Tauri #1138

dvx opened this issue Feb 13, 2025 · 0 comments
Labels
bug Something isn't working build Issues relating to building mistral.rs

Comments

@dvx
Copy link

dvx commented Feb 13, 2025

I'm trying to use the mistral.rs Rust API in a Tauri project, and can't seem to figure out how to solve these linking issues on Windows.

Minimum reproducible example

Initialize a basic Tauri v2 boilerplate project and add mistralrs = { git = "https://github.com/EricLBuehler/mistral.rs.git", tag = "v0.4.0", features= ["cuda"] } to [dependencies]. Note that compiling without cuda works. cudnn without cuda links, but fails at runtime when allocating memory with Error: Cannot get memory available for CUDA device (persumably, using cudnn without cuda makes no sense).

This is using cargo build --release but we get the same error with yarn tauri dev --release or similar wrappers. My hunch is that the problem is caused by the fact that Tauri uses dynamic linking, but something deep in mistral.rs' dependencies uses static linking.

Error

  = note: mistralrscuda.lib(nonzero_bitwise-b50867152df76f01.o) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in libort_sys-ec47b9c63efbfefc.rlib(onnxruntime_c_api.obj)␍
          mistralrsquant.lib(hqq-65c761548d7d80ee.o) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in libort_sys-ec47b9c63efbfefc.rlib(onnxruntime_c_api.obj)␍
          mistralrsquant.lib(q_gemm-345bd0534e99ab2c.o) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in libort_sys-ec47b9c63efbfefc.rlib(onnxruntime_c_api.obj)␍
          mistralrsquant.lib(marlin_kernel-732a0a250e9ce762.o) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in libort_sys-ec47b9c63efbfefc.rlib(onnxruntime_c_api.obj)␍
          mistralrsquant.lib(ops-bb2b0be21ca2c8a0.o) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in libort_sys-ec47b9c63efbfefc.rlib(onnxruntime_c_api.obj)␍
          mistralrsquant.lib(dequant-a0365c5f007be6d0.o) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in libort_sys-ec47b9c63efbfefc.rlib(onnxruntime_c_api.obj)␍

Other information

Please specify:

  • Operating system: Windows
λ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Fri_Jun_14_16:44:19_Pacific_Daylight_Time_2024
Cuda compilation tools, release 12.6, V12.6.20
Build cuda_12.6.r12.6/compiler.34431801_0
λ nvidia-smi
Thu Feb 13 14:44:32 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 566.36                 Driver Version: 566.36         CUDA Version: 12.7     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                  Driver-Model | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3090 Ti   WDDM  |   00000000:01:00.0  On |                  Off |
|  0%   51C    P8             28W /  450W |    1173MiB /  24564MiB |     16%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

Latest commit or version

f1a56f6 (v0.4.0)

@dvx dvx added bug Something isn't working build Issues relating to building mistral.rs labels Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build Issues relating to building mistral.rs
Projects
None yet
Development

No branches or pull requests

1 participant