#cuda #gpgpu #ffi

build cuda-config

Helper crate for finding CUDA libraries

1 unstable release

0.1.0 Dec 30, 2019

#97 in Windows APIs

Download history 1507/week @ 2024-03-14 1400/week @ 2024-03-21 2142/week @ 2024-03-28 1915/week @ 2024-04-04 2208/week @ 2024-04-11 2118/week @ 2024-04-18 1856/week @ 2024-04-25 1934/week @ 2024-05-02 1859/week @ 2024-05-09 1871/week @ 2024-05-16 1491/week @ 2024-05-23 1554/week @ 2024-05-30 1309/week @ 2024-06-06 1583/week @ 2024-06-13 1260/week @ 2024-06-20 869/week @ 2024-06-27

5,263 downloads per month
Used in 42 crates (3 directly)

MIT/Apache

6KB
75 lines

cuda-sys

docs.rs

Rust binding to CUDA Driver (libcuda.so) and Runtime (libcudart.so) APIs

This crate does NOT include CUDA itself. You need to install on your own.

CUDA Installation

  • You should install CUDA from the official installer.
  • or use nvidia/cuda container
    • This container does not add libcuda.so to dynamic link path. You need to add it to your ld path LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs or using ldconfig.

CUDA_LIBRARY_PATH environment variable

  • If you use system installer (e.g. apt, yum, pacman, and so on), the install path may be different.
  • $CUDA_LIBRARY_PATH (e.g. /opt/cuda/lib64) environment value adds paths to the list of library searching.
  • To verify that cuda-sys can find your CUDA installation, you can check that the CUDA_PATH environment variable has been set.

Q & A

Q. Program does not start (can be compiled) with following error message:

error while loading shared libraries: libcuda.so.1: cannot open shared object file: No such file or directory

A. Driver API (libcuda.so) is sometimes installed in a separate directory. You need to find it, and add to LD_LIBRARY_PATH:

LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs

License

Dual-licensed to be compatible with the Rust project. Licensed under the Apache License, Version 2.0 or the MIT license, at your option. This file may not be copied, modified, or distributed except according to those terms.

You should check the End User License Agreement, which describes NVIDIA Software License Agreement and CUDA Supplement to Software License Agreement.

Dependencies

~48KB