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

error[E0425]: cannot find function cudaImportExternalMemory in module sys #307

Closed
EricLBuehler opened this issue Jan 7, 2025 · 3 comments

Comments

@EricLBuehler
Copy link

Hi @coreylowman!

We are running into a strange error when attempting to compile cudarc 0.12.2 on Windows.

This is the error:

error[E0422]: cannot find struct, variant or union type `cudaExternalMemoryHandleDesc_st__bindgen_ty_1` in module `sys`
    --> C:\Users\ericl\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cudarc-0.12.2\src\runtime\result.rs:988:26
     |
988  |             handle: sys::cudaExternalMemoryHandleDesc_st__bindgen_ty_1 {
     |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a union with a similar name exists: `cudaExternalMemoryHandleDesc__bindgen_ty_1`
     |
    ::: C:\Users\ericl\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cudarc-0.12.2\src\runtime\sys\sys_12060.rs:4388:1
     |
4388 | pub union cudaExternalMemoryHandleDesc__bindgen_ty_1 {
     | ---------------------------------------------------- similarly named union `cudaExternalMemoryHandleDesc__bindgen_ty_1` defined here    

error[E0422]: cannot find struct, variant or union type `cudaExternalMemoryHandleDesc_st__bindgen_ty_1__bindgen_ty_1` in module `sys`
    --> C:\Users\ericl\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cudarc-0.12.2\src\runtime\result.rs:989:29
     |
989  |                 win32: sys::cudaExternalMemoryHandleDesc_st__bindgen_ty_1__bindgen_ty_1 {
     |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `cudaExternalMemoryHandleDesc__bindgen_ty_1__bindgen_ty_1`
     |
    ::: C:\Users\ericl\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cudarc-0.12.2\src\runtime\sys\sys_12060.rs:4395:1
     |
4395 | pub struct cudaExternalMemoryHandleDesc__bindgen_ty_1__bindgen_ty_1 {
     | ------------------------------------------------------------------- similarly named struct `cudaExternalMemoryHandleDesc__bindgen_ty_1__bindgen_ty_1` defined here

error[E0425]: cannot find function `cudaImportExternalMemory` in module `sys`
   --> C:\Users\ericl\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cudarc-0.12.2\src\runtime\result.rs:997:14
    |
997 |         sys::cudaImportExternalMemory(external_memory.as_mut_ptr(), &handle_description)
    |              ^^^^^^^^^^^^^^^^^^^^^^^^ not found in `sys`

And my driver information:

> nvidia-smi                                                                                                 01/07/2025 03:32:33 AM
Tue Jan  7 03:32:53 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 4070 ...  WDDM  |   00000000:01:00.0 Off |                  N/A |
| N/A   43C    P3             13W /   60W |       0MiB /   8188MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Wed_Oct_30_01:18:48_Pacific_Daylight_Time_2024
Cuda compilation tools, release 12.6, V12.6.85
Build cuda_12.6.r12.6/compiler.35059454_0

Is this something which you have run into?

@zlogic
Copy link

zlogic commented Jan 7, 2025

This looks like a Windows-only bug, and is fixed in #305

@EricLBuehler
Copy link
Author

Yes, it appears so. I actually opened a (I realize, duplicate) PR in #308 - I'll close that!

@coreylowman
Copy link
Owner

Fixed in 0.13.0, live on crates.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants