Tim-Salzmann / l4casadi

Use PyTorch Models with CasADi for data-driven optimization or learning-based optimal control. Supports Acados.
MIT License
379 stars 29 forks source link

Fail to build the project #25

Closed LumenYoung closed 8 months ago

LumenYoung commented 8 months ago

Hi, Tim,

Thanks for this great work. I was about to try this out, I managed to install most of them but fail when I try to install the library itself with pip install . --no-build-isolation

The error message is as follow. It is also very confusing as the error message suggest no cuda found but it also tells me the version of the cuda-toolkit (12.1). I checked the cuda-toolkit, which was installed via micromamba (conda substitution), I also tried out all sorts of possible way to set custom cuda location, but none of them can help me get it complied.

Therefore, I would like to ask if you know how should I get the repo built with custom cuda installation location? Which specific file from the cuda lib does the compilation really need? Thanks!

❯ pip3 install . --no-build-isolation
Processing /export/home/yang/git/l4casadi
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: torch in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from l4casadi==1.3.0) (2.2.1)
Requirement already satisfied: casadi>=3.6 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from l4casadi==1.3.0) (3.6.5)
Requirement already satisfied: jinja2>=3.1 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from l4casadi==1.3.0) (3.1.3)
Requirement already satisfied: numpy in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from casadi>=3.6->l4casadi==1.3.0) (1.26.4)
Requirement already satisfied: MarkupSafe>=2.0 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from jinja2>=3.1->l4casadi==1.3.0) (2.1.5)
Requirement already satisfied: filelock in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (3.13.1)
Requirement already satisfied: typing-extensions>=4.8.0 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (4.10.0)
Requirement already satisfied: sympy in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (1.12)
Requirement already satisfied: networkx in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (3.2.1)
Requirement already satisfied: fsspec in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (2024.2.0)
Requirement already satisfied: nvidia-cuda-nvrtc-cu12==12.1.105 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (12.1.105)
Requirement already satisfied: nvidia-cuda-runtime-cu12==12.1.105 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (12.1.105)
Requirement already satisfied: nvidia-cuda-cupti-cu12==12.1.105 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (12.1.105)
Requirement already satisfied: nvidia-cudnn-cu12==8.9.2.26 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (8.9.2.26)
Requirement already satisfied: nvidia-cublas-cu12==12.1.3.1 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (12.1.3.1)
Requirement already satisfied: nvidia-cufft-cu12==11.0.2.54 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (11.0.2.54)
Requirement already satisfied: nvidia-curand-cu12==10.3.2.106 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (10.3.2.106)
Requirement already satisfied: nvidia-cusolver-cu12==11.4.5.107 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (11.4.5.107)
Requirement already satisfied: nvidia-cusparse-cu12==12.1.0.106 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (12.1.0.106)
Requirement already satisfied: nvidia-nccl-cu12==2.19.3 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (2.19.3)
Requirement already satisfied: nvidia-nvtx-cu12==12.1.105 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (12.1.105)
Requirement already satisfied: triton==2.2.0 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from torch->l4casadi==1.3.0) (2.2.0)
Requirement already satisfied: nvidia-nvjitlink-cu12 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from nvidia-cusolver-cu12==11.4.5.107->torch->l4casadi==1.3.0) (12.3.101)
Requirement already satisfied: mpmath>=0.19 in /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages (from sympy->torch->l4casadi==1.3.0) (1.3.0)
Building wheels for collected packages: l4casadi
  Building wheel for l4casadi (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for l4casadi (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [107 lines of output]

      --------------------------------------------------------------------------------
      -- Trying 'Ninja' generator
      --------------------------------
      ---------------------------
      ----------------------
      -----------------
      ------------
      -------
      --
      CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
        Compatibility with CMake < 3.5 will be removed from a future version of
        CMake.

        Update the VERSION argument <min> value or use a ...<max> suffix to tell
        CMake that the project does not need compatibility with older versions.

      Not searching for unused variables given on the command line.

      -- The C compiler identification is GNU 12.3.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- The CXX compiler identification is GNU 12.3.0
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Configuring done (0.6s)
      -- Generating done (0.0s)
      -- Build files have been written to: /export/home/yang/git/l4casadi/_cmake_test_compile/build
      --
      -------
      ------------
      -----------------
      ----------------------
      ---------------------------
      --------------------------------
      -- Trying 'Ninja' generator - success
      --------------------------------------------------------------------------------

      Configuring Project
        Working directory:
          /export/home/yang/git/l4casadi/_skbuild/linux-x86_64-3.9/cmake-build
        Command:
          /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/cmake/data/bin/cmake /export/home/yang/git/l4casadi/libl4casadi -G Ninja -DCMAKE_MAKE_PROGRAM:FILEPATH=/home/yang/micromamba/envs/jepa/lib/python3.9/s
ite-packages/ninja/data/bin/ninja --no-warn-unused-cli -DCMAKE_INSTALL_PREFIX:PATH=/export/home/yang/git/l4casadi/_skbuild/linux-x86_64-3.9/cmake-install -DPYTHON_VERSION_STRING:STRING=3.9.18 -DSKBUILD:INTERNAL=TRUE -DCM
AKE_MODULE_PATH:PATH=/home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/home/yang/micromamba/envs/jepa/bin/python3.9 -DPYTHON_INCLUDE_DIR:PATH=/home/yang/microma
mba/envs/jepa/include/python3.9 -DPYTHON_LIBRARY:PATH=/home/yang/micromamba/envs/jepa/lib/libpython3.9.so -DPython_EXECUTABLE:PATH=/home/yang/micromamba/envs/jepa/bin/python3.9 -DPython_ROOT_DIR:PATH=/home/yang/micromamb
a/envs/jepa -DPython_FIND_REGISTRY:STRING=NEVER -DPython_INCLUDE_DIR:PATH=/home/yang/micromamba/envs/jepa/include/python3.9 -DPython_NumPy_INCLUDE_DIRS:PATH=/home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/num
py/core/include -DPython3_EXECUTABLE:PATH=/home/yang/micromamba/envs/jepa/bin/python3.9 -DPython3_ROOT_DIR:PATH=/home/yang/micromamba/envs/jepa -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_INCLUDE_DIR:PATH=/home/yang/m
icromamba/envs/jepa/include/python3.9 -DPython3_NumPy_INCLUDE_DIRS:PATH=/home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/numpy/core/include -DCMAKE_MAKE_PROGRAM:FILEPATH=/home/yang/micromamba/envs/jepa/lib/pyt
hon3.9/site-packages/ninja/data/bin/ninja -DCMAKE_AR=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-ar -DCMAKE_CXX_COMPILER_AR=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-gcc-ar -DCMAKE_C_COMPI
LER_AR=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-gcc-ar -DCMAKE_RANLIB=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/home/yang/micromamba/envs/jepa/bin/x8
6_64-conda-linux-gnu-gcc-ranlib -DCMAKE_C_COMPILER_RANLIB=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-gcc-ranlib -DCMAKE_LINKER=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-ld -DCMAKE_STRIP=/
home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-strip -DCMAKE_BUILD_TYPE=Release -DCMAKE_TORCH_PATH=/home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/torch -DCMAKE_AR=/home/yang/micromamba/envs/jepa/b
in/x86_64-conda-linux-gnu-ar -DCMAKE_CXX_COMPILER_AR=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-gcc-ar -DCMAKE_C_COMPILER_AR=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-gcc-ar -DCMAKE_RANLI
B=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-gcc-ranlib -DCMAKE_C_COMPILER_RANLIB=/home/yang/micromamba/envs/j
epa/bin/x86_64-conda-linux-gnu-gcc-ranlib -DCMAKE_LINKER=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-ld -DCMAKE_STRIP=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-strip -DCMAKE_BUILD_TYPE=Rel
ease

      CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
        Compatibility with CMake < 3.5 will be removed from a future version of
        CMake.

        Update the VERSION argument <min> value or use a ...<max> suffix to tell
        CMake that the project does not need compatibility with older versions.

      Not searching for unused variables given on the command line.

      -- The C compiler identification is GNU 12.3.0
      -- The CXX compiler identification is GNU 12.3.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS) (found version "12.1")
      CMake Warning at /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/torch/share/cmake/Caffe2/public/cuda.cmake:31 (message):
        Caffe2: CUDA cannot be found.  Depending on whether you are building Caffe2
        or a Caffe2 dependent library, the next warning / error will give you more
        info.
      Call Stack (most recent call first):
        /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Caffe2Config.cmake:87 (include)
        /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:68 (find_package)
        CMakeLists.txt:12 (find_package)

      CMake Error at /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Caffe2Config.cmake:91 (message):
        Your installed Caffe2 version uses CUDA but I cannot find the CUDA
        libraries.  Please set the proper CUDA prefixes and / or install CUDA.
      Call Stack (most recent call first):
        /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:68 (find_package)
        CMakeLists.txt:12 (find_package)

      -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "/home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 666, in setup
          env = cmkr.configure(
        File "/home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/skbuild/cmaker.py", line 357, in configure
          raise SKBuildError(msg)

      An error occurred while configuring with CMake.
        Command:
          /home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/cmake/data/bin/cmake /export/home/yang/git/l4casadi/libl4casadi -G Ninja -DCMAKE_MAKE_PROGRAM:FILEPATH=/home/yang/micromamba/envs/jepa/lib/python3.9/s
ite-packages/ninja/data/bin/ninja --no-warn-unused-cli -DCMAKE_INSTALL_PREFIX:PATH=/export/home/yang/git/l4casadi/_skbuild/linux-x86_64-3.9/cmake-install -DPYTHON_VERSION_STRING:STRING=3.9.18 -DSKBUILD:INTERNAL=TRUE -DCM
AKE_MODULE_PATH:PATH=/home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/home/yang/micromamba/envs/jepa/bin/python3.9 -DPYTHON_INCLUDE_DIR:PATH=/home/yang/microma
mba/envs/jepa/include/python3.9 -DPYTHON_LIBRARY:PATH=/home/yang/micromamba/envs/jepa/lib/libpython3.9.so -DPython_EXECUTABLE:PATH=/home/yang/micromamba/envs/jepa/bin/python3.9 -DPython_ROOT_DIR:PATH=/home/yang/micromamb
a/envs/jepa -DPython_FIND_REGISTRY:STRING=NEVER -DPython_INCLUDE_DIR:PATH=/home/yang/micromamba/envs/jepa/include/python3.9 -DPython_NumPy_INCLUDE_DIRS:PATH=/home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/num
py/core/include -DPython3_EXECUTABLE:PATH=/home/yang/micromamba/envs/jepa/bin/python3.9 -DPython3_ROOT_DIR:PATH=/home/yang/micromamba/envs/jepa -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_INCLUDE_DIR:PATH=/home/yang/m
icromamba/envs/jepa/include/python3.9 -DPython3_NumPy_INCLUDE_DIRS:PATH=/home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/numpy/core/include -DCMAKE_MAKE_PROGRAM:FILEPATH=/home/yang/micromamba/envs/jepa/lib/pyt
hon3.9/site-packages/ninja/data/bin/ninja -DCMAKE_AR=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-ar -DCMAKE_CXX_COMPILER_AR=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-gcc-ar -DCMAKE_C_COMPI
LER_AR=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-gcc-ar -DCMAKE_RANLIB=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/home/yang/micromamba/envs/jepa/bin/x8
6_64-conda-linux-gnu-gcc-ranlib -DCMAKE_C_COMPILER_RANLIB=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-gcc-ranlib -DCMAKE_LINKER=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-ld -DCMAKE_STRIP=/
home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-strip -DCMAKE_BUILD_TYPE=Release -DCMAKE_TORCH_PATH=/home/yang/micromamba/envs/jepa/lib/python3.9/site-packages/torch -DCMAKE_AR=/home/yang/micromamba/envs/jepa/b
in/x86_64-conda-linux-gnu-ar -DCMAKE_CXX_COMPILER_AR=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-gcc-ar -DCMAKE_C_COMPILER_AR=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-gcc-ar -DCMAKE_RANLI
B=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-gcc-ranlib -DCMAKE_C_COMPILER_RANLIB=/home/yang/micromamba/envs/j
epa/bin/x86_64-conda-linux-gnu-gcc-ranlib -DCMAKE_LINKER=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-ld -DCMAKE_STRIP=/home/yang/micromamba/envs/jepa/bin/x86_64-conda-linux-gnu-strip -DCMAKE_BUILD_TYPE=Rel
ease
        Source directory:
          /export/home/yang/git/l4casadi/libl4casadi
        Working directory:
          /export/home/yang/git/l4casadi/_skbuild/linux-x86_64-3.9/cmake-build
      Please see CMake's output for more information.

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for l4casadi
Failed to build l4casadi
ERROR: Could not build wheels for l4casadi, which is required to install pyproject.toml-based projects
Tim-Salzmann commented 8 months ago

Hi,

Did you follow the installation instructions for installing L4CasADi with CUDA as described in [1]?

Crucially, the command CUDACXX=<PATH_TO_NVCC> pip install l4casadi --no-build-isolation.

Best Tim

[1] https://github.com/Tim-Salzmann/l4casadi?tab=readme-ov-file#gpu-cuda

LumenYoung commented 8 months ago

Hi, Thanks for the prompt reply.

Yes, I tries this out (CUDACXX=/home/yang/micromamba/envs/jepa/bin/nvcc pip3 install . --no-build-isolation), and several other variables like:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/yang/micromamba/envs/jepa/lib
export PATH=$PATH:/home/yang/micromamba/envs/jepa/bin
export CUDA_HOME=$CUDA_HOME:/home/yang/micromamba/envs/jepa/lib
export CUDNN_INCLUDE_DIR=/home/yang/micromamba/envs/jepa/include
export CUDNN_LIB_DIR=/home/yang/micromamba/envs/jepa/lib
export CUDNN_PATH=/home/yang/micromamba/envs/jepa/bin
export CUDNN_LIBRARY=/home/yang/micromamba/envs/jepa/lib

None of them helped me out, I was also trying to modify the CMakeLists.txt but I don't think I made it correctly. I wonder if you can provide some hint on which direction to tryout?

Best, Jiaye.

LumenYoung commented 8 months ago

Both install from source with

CUDACXX=/home/yang/micromamba/envs/jepa/bin/nvcc pip3 install . --no-build-isolation and CUDACXX=/home/yang/micromamba/envs/jepa/bin/nvcc pip3 install l4casadi --no-build-isolation doesn't work in my setup, but the nvcc is ensured to be there and is functioning ( using nvcc -V), it matches the driver version. I've been fighting with this dependency issue the whole afternoon and I get no clue on what to try next to solve it.

Tim-Salzmann commented 8 months ago

Hi,

the path you referring to /home/yang/micromamba/envs/jepa/bin does not sound like a normal install path for CUDA (rather like a python env). Normally CUDA is somewhere in /usr/local/cuda-12.1/.... Can you please post the output of

ls /home/yang/micromamba/envs/jepa/bin

Edit

Crucially /home/yang/micromamba/envs/jepa/bin/nvcc -V should work.

LumenYoung commented 8 months ago

It is a large output so I paste it here at the pastebin: https://bin.lumeny.io/p/bat-otter-jaguar

If you want to check if nvcc is presented:

❯ ls /home/yang/micromamba/envs/jepa/bin | grep nvcc
nvcc
__nvcc_device_query
nvcc.profile

Yes, this is not a normal cuda install since I don't have admin privilege on server. And the nvcc is actually working with nvcc -V

❯ which nvcc
/home/yang/micromamba/envs/jepa/bin/nvcc
❯ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Aug_15_22:02:13_PDT_2023
Cuda compilation tools, release 12.2, V12.2.140
Build cuda_12.2.r12.2/compiler.33191640_0

The version is selected to match the cuda version installed on the system as shown below:

❯ which nvidia-smi
/usr/bin/nvidia-smi
❯ nvidia-smi
Mon Mar 11 18:08:27 2024       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.161.07             Driver Version: 535.161.07   CUDA Version: 12.2     |
Tim-Salzmann commented 8 months ago

Can you elaborate how you installed nvcc and coda-toolkit there. Further are you sure that the respective cuda libraries and headers (which would normally be under /usr/local/cuda-12.1/include and /usr/local/cuda-12.1/lib64) are installed "correctly"?


Edit

Another thought: Given that CUDA is already installed on your machine nvcc and related cuda toolkit libraries and headers (might/should - not sure here) be already installed in some root directory too. locate nvcc or similar could work.

LumenYoung commented 8 months ago

Yes, I installed it with micromamba command, which you can think of as just conda command: micromamba install -c "nvidia/label/cuda-12.2" cuda-toolkit="12.2". I do struggle to find the corresponding file in the /usr/local/cuda-12.1/lib64. I do find many of the so file from cuda exists in /home/yang/micromamba/envs/jepa/lib. But not sure if it is a 100 % replicate, the file list can be found here, briefly it contains following cuda related libs.

❯ ls | grep cuda
libcudadevrt.a
libcudart.so
libcudart.so.12
libcudart.so.12.2.140
libcudart_static.a
libicudata.so
libicudata.so.73
libicudata.so.73.2

The /usr/local/cuda-12.1/include I can only find something similar at /home/yang/micromamba/envs/jepa/include/cuda. file inside can be found here.

Tim-Salzmann commented 8 months ago

I will try to find the time tomorrow to replicate your setup. In the meantime - if GPU support is not essential for you to get started, you could just install the PyTorch CPU version in your local env and install L4CasADi without CUDA support, too.

Tim-Salzmann commented 8 months ago

Hi,

I was able to reproduce your setup and error. I made some small changes to the build process. Please clone the latest code version to a fresh folder (or make sure you remove the temp _skbuild folder). You should then be able to install with CUDA support simply via pip install . --no-build-isolation.

Best Tim

LumenYoung commented 8 months ago

Hi, Tim, really nice of you to pay attention to custom cuda install.

Meanwhile, I get my supervisor to install a system-wide cuda. But that doesn't straightly give me a successful build until I insert the set(CMAKE_CUDA_COMPILER "/usr/local/cuda/bin/nvcc") to the CMakeLists.txt at libcasadi folder. Therefore I would report this here and maybe someone else would try my way out.

Thanks a lot for the help!