Skip to content

Commit

Permalink
Load CUDA in CMake if it can be found.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-Salzmann committed Mar 12, 2024
1 parent dc22c77 commit 9c9f29f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ CUDA installation requires nvcc to be installed which is part of the CUDA toolki
`sudo apt-get -y install cuda-toolkit-XX-X` (where `XX-X` is your installed Cuda version - e.g. `12-3`).
Once the CUDA toolkit is installed nvcc is commonly found at `/usr/local/cuda/bin/nvcc`.

Install L4CasADi via `CUDACXX=<PATH_TO_NVCC> pip install l4casadi --no-build-isolation` or `CUDACXX=<PATH_TO_NVCC> pip install . --no-build-isolation` to build from source.
Make sure `nvcc -V` can be executed and run `pip install l4casadi --no-build-isolation` or `CUDACXX=<PATH_TO_NVCC> pip install . --no-build-isolation` to build from source.

If `nvcc` is not automatically part of your path you can specify the `nvcc` path for L4CasADi.
E.g. `CUDACXX=<PATH_TO_NVCC> pip install l4casadi --no-build-isolation`.

---

Expand Down
4 changes: 4 additions & 0 deletions libl4casadi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(L4CasADi)

# Load CUDA if it is installed
find_package(CUDAToolkit)
find_package(CUDA)

if (WIN32)
set (CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
set (BUILD_SHARED_LIBS TRUE)
Expand Down

0 comments on commit 9c9f29f

Please sign in to comment.