Skip to content

[Bug(CMake 3.17)] CUDA::cublasLt not found but can be specified absolutely #1078

Closed

Description

@fumiama

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest code. Development is very rapid so there are no tagged versions as of now.
  • I carefully followed the README.md.
  • I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
  • I reviewed the Discussions, and have a new bug or useful enhancement to share.

Expected Behavior

When I run

cmake3 .. -DLLAMA_CUBLAS=ON

It will success normally.

Current Behavior

It got errors (see details at below). But when I replace CUDA::cublasLt in CMakeLists.txt with the absolute path, the bug fixed. But I think it is not a good solution.

$ vi ../CMakeLists.txt # replace CUDA::cublasLt with /usr/local/cuda/lib64/libcublas.so
$ cmake3 .. -DLLAMA_CUBLAS=ON
-- cuBLAS found at /usr/local/cuda/lib64
-- CMAKE_SYSTEM_PROCESSOR: x86_64
-- x86 detected
-- GGML CUDA sources found, configuring CUDA architecture
-- Configuring done
-- Generating done
-- Build files have been written to: /users/fumiama/src/llama.cpp/build

Environment and Context

  • Physical (or virtual) hardware you are using: Centos7.6

  • Operating System, e.g. for Linux:

$ uname -a
Linux localhost.localdomain 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  • SDK version, e.g. for Linux:
$ cmake3 --version
cmake3 version 3.17.5

CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ gcc --version
gcc (GCC) 6.3.1 20170216 (Red Hat 6.3.1-3)
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Fri_Jan__6_16:45:21_PST_2023
Cuda compilation tools, release 12.0, V12.0.140
Build cuda_12.0.r12.0/compiler.32267302_0

Failure Information (for bugs)

-- cuBLAS found
-- CMAKE_SYSTEM_PROCESSOR: x86_64
-- x86 detected
-- GGML CUDA sources found, configuring CUDA architecture
-- Configuring done
CMake Error at CMakeLists.txt:317 (add_library):
  Target "llama" links to target "FindCUDA::cublasLt" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at CMakeLists.txt:317 (add_library):
  Target "llama" links to target "FindCUDA::cublasLt" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at tests/CMakeLists.txt:3 (add_executable):
  Target "test-tokenizer-0" links to target "FindCUDA::cublasLt" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  tests/CMakeLists.txt:10 (llama_add_test)


CMake Error at tests/CMakeLists.txt:3 (add_executable):
  Target "test-tokenizer-0" links to target "FindCUDA::cublasLt" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  tests/CMakeLists.txt:10 (llama_add_test)


CMake Error at tests/CMakeLists.txt:3 (add_executable):
  Target "test-quantize" links to target "FindCUDA::cublasLt" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  tests/CMakeLists.txt:9 (llama_add_test)


CMake Error at tests/CMakeLists.txt:3 (add_executable):
  Target "test-quantize" links to target "FindCUDA::cublasLt" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  tests/CMakeLists.txt:9 (llama_add_test)


CMake Error at examples/main/CMakeLists.txt:2 (add_executable):
  Target "main" links to target "FindCUDA::cublasLt" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at examples/main/CMakeLists.txt:2 (add_executable):
  Target "main" links to target "FindCUDA::cublasLt" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at examples/quantize/CMakeLists.txt:2 (add_executable):
  Target "quantize" links to target "FindCUDA::cublasLt" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at examples/quantize/CMakeLists.txt:2 (add_executable):
  Target "quantize" links to target "FindCUDA::cublasLt" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at examples/quantize-stats/CMakeLists.txt:2 (add_executable):
  Target "quantize-stats" links to target "FindCUDA::cublasLt" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at examples/quantize-stats/CMakeLists.txt:2 (add_executable):
  Target "quantize-stats" links to target "FindCUDA::cublasLt" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at examples/perplexity/CMakeLists.txt:2 (add_executable):
  Target "perplexity" links to target "FindCUDA::cublasLt" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at examples/perplexity/CMakeLists.txt:2 (add_executable):
  Target "perplexity" links to target "FindCUDA::cublasLt" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at examples/embedding/CMakeLists.txt:2 (add_executable):
  Target "embedding" links to target "FindCUDA::cublasLt" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at examples/embedding/CMakeLists.txt:2 (add_executable):
  Target "embedding" links to target "FindCUDA::cublasLt" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at pocs/vdot/CMakeLists.txt:2 (add_executable):
  Target "vdot" links to target "FindCUDA::cublasLt" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at pocs/vdot/CMakeLists.txt:2 (add_executable):
  Target "vdot" links to target "FindCUDA::cublasLt" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at CMakeLists.txt:305 (add_library):
  Target "ggml" links to target "FindCUDA::cublasLt" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at examples/CMakeLists.txt:13 (add_library):
  Target "common" links to target "FindCUDA::cublasLt" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at examples/CMakeLists.txt:13 (add_library):
  Target "common" links to target "FindCUDA::cublasLt" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

Activity

  1. slaren commented on Apr 20, 2023

    @slaren
    Member

    I cannot reproduce this issue with cmake 3.22.1, gcc 11.3 and nvcc 12.1

  2. fumiama commented on Apr 20, 2023

    @fumiama
    ContributorAuthor

    I cannot reproduce this issue with cmake 3.22.1, gcc 11.3 and nvcc 12.1

    Sorry, I got a mistake. The version of cmake I'm using is

    $ cmake3 --version
    cmake3 version 3.17.5
    
    CMake suite maintained and supported by Kitware (kitware.com/cmake).
    
  3. changed the title [-][Bug(CMake)] CUDA::cublasLt not found but can be specified absolutely[/-] [+][Bug(CMake 3.17)] CUDA::cublasLt not found but can be specified absolutely[/+] on Apr 20, 2023
  4. fumiama commented on Apr 20, 2023

    @fumiama
    ContributorAuthor

    And I tested again under cmake 3.26.3, no problem this time. Maybe it's also a cmake 3.17.x issue.

  5. Rubiel1 commented on Feb 14, 2024

    @Rubiel1

    I have the same problem, with CMake 3.17

  6. martin2384798 commented on Mar 20, 2024

    @martin2384798

    I have the same problem, with CMake 3.22.2, 3.23.2, 3.24.2.
    Other version info: gcc 9.4.0 nvcc V11.8.89
    cmake .. -DLLAMA_CUBLAS could succeed if I replace CUDA::cublasLt with absolute path of libcublas.so

  7. youcanyouupsb commented on Apr 21, 2024

    @youcanyouupsb

    I have the same problem, with CMake 3.17 too!!!!
    I specified the following path directly as an absolute path:
    set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} CUDA::cudart CUDA::cublas CUDA::cublasLt)
    ====>
    set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} CUDA::cudart CUDA::cublas "/usr/local/cuda-12.4/lib64/libcublasLt.so")
    The CMake configuration succeeded.

  8. github-actions commented on Jun 6, 2024

    @github-actions
    Contributor

    This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions