conda-forge / cupy-feedstock

A conda-smithy repository for cupy.
BSD 3-Clause "New" or "Revised" License
5 stars 23 forks source link

unable to install cupy using source code getting error given below and I am using conda forge to do it #257

Closed yashveeeeer closed 6 months ago

yashveeeeer commented 7 months ago

Comment:

pip install . Defaulting to user installation because normal site-packages is not writeable Processing /home/yahsveer/Desktop/cupy-first Preparing metadata (setup.py) ... done Requirement already satisfied: fastrlock>=0.5 in /home/yahsveer/.local/lib/python3.10/site-packages (from cupy==13.0.0rc1) (0.8.2) Requirement already satisfied: numpy<1.29,>=1.22 in /home/yahsveer/.local/lib/python3.10/site-packages (from cupy==13.0.0rc1) (1.26.4) Building wheels for collected packages: cupy Building wheel for cupy (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [63 lines of output] Generating cache key from header files... Cache key (1545 files matching /home/yahsveer/Desktop/cupy-first/cupy/_core/include/**): 9bfdc8f113d90f22d2e93be7222cd267d0b50fef Clearing directory: /home/yahsveer/Desktop/cupy-first/cupy/.data

  -------- Configuring Module: cuda --------
  /tmp/tmpjb073_7t/a.cpp:1:10: fatal error: cublas_v2.h: No such file or directory
      1 | #include <cublas_v2.h>
        |          ^~~~~~~~~~~~~
  compilation terminated.
  command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  /tmp/tmps4anezhk/a.cpp:2:18: fatal error: cuda_runtime_api.h: No such file or directory
      2 |         #include <cuda_runtime_api.h>
        |                  ^~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  **************************************************
  *** WARNING: Cannot check compute capability
  command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  **************************************************

  ************************************************************
  * CuPy Configuration Summary                               *
  ************************************************************

  Build Environment:
    Include directories: ['/home/yahsveer/Desktop/cupy-first/cupy/_core/include/cupy/_cccl/libcudacxx', '/home/yahsveer/Desktop/cupy-first/cupy/_core/include/cupy/_cccl/thrust', '/home/yahsveer/Desktop/cupy-first/cupy/_core/include/cupy/_cccl/cub', '/home/yahsveer/Desktop/cupy-first/cupy/_core/include']
    Library directories: []
    nvcc command       : (not found)
    hipcc command      : (not found)

  Environment Variables:
    CFLAGS          : (none)
    LDFLAGS         : (none)
    LIBRARY_PATH    : (none)
    CUDA_PATH       : (none)
    NVCC            : (none)
    HIPCC           : (none)
    ROCM_HOME       : (none)

  Modules:
    cuda      : No
      -> Include files not found: ['cublas_v2.h', 'cuda.h', 'cuda_profiler_api.h', 'cuda_runtime.h', 'cufft.h', 'curand.h', 'cusparse.h']
      -> Check your CFLAGS environment variable.

  ERROR: CUDA could not be found on your system.

  HINT: You are trying to build CuPy from source, which is NOT recommended for general use.
        Please consider using binary packages instead.

  Please refer to the Installation Guide for details:
  https://docs.cupy.dev/en/stable/install.html

  ************************************************************

  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/home/yahsveer/Desktop/cupy-first/setup.py", line 93, in <module>
      ext_modules = cupy_setup_build.get_ext_modules(True, ctx)
    File "/home/yahsveer/Desktop/cupy-first/install/cupy_builder/cupy_setup_build.py", line 473, in get_ext_modules
      extensions = make_extensions(ctx, compiler, use_cython)
    File "/home/yahsveer/Desktop/cupy-first/install/cupy_builder/cupy_setup_build.py", line 328, in make_extensions
      raise Exception('Your CUDA environment is invalid. '
  Exception: Your CUDA environment is invalid. Please check above error log.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for cupy Running setup.py clean for cupy error: subprocess-exited-with-error

× python setup.py clean did not run successfully. │ exit code: 1 ╰─> [63 lines of output] Generating cache key from header files... Cache key (1545 files matching /home/yahsveer/Desktop/cupy-first/cupy/_core/include/**): 9bfdc8f113d90f22d2e93be7222cd267d0b50fef Clearing directory: /home/yahsveer/Desktop/cupy-first/cupy/.data

  -------- Configuring Module: cuda --------
  /tmp/tmpv3jd9oi6/a.cpp:1:10: fatal error: cublas_v2.h: No such file or directory
      1 | #include <cublas_v2.h>
        |          ^~~~~~~~~~~~~
  compilation terminated.
  command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  /tmp/tmpojmu8t9r/a.cpp:2:18: fatal error: cuda_runtime_api.h: No such file or directory
      2 |         #include <cuda_runtime_api.h>
        |                  ^~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  **************************************************
  *** WARNING: Cannot check compute capability
  command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  **************************************************

  ************************************************************
  * CuPy Configuration Summary                               *
  ************************************************************

  Build Environment:
    Include directories: ['/home/yahsveer/Desktop/cupy-first/cupy/_core/include/cupy/_cccl/libcudacxx', '/home/yahsveer/Desktop/cupy-first/cupy/_core/include/cupy/_cccl/thrust', '/home/yahsveer/Desktop/cupy-first/cupy/_core/include/cupy/_cccl/cub', '/home/yahsveer/Desktop/cupy-first/cupy/_core/include']
    Library directories: []
    nvcc command       : (not found)
    hipcc command      : (not found)

  Environment Variables:
    CFLAGS          : (none)
    LDFLAGS         : (none)
    LIBRARY_PATH    : (none)
    CUDA_PATH       : (none)
    NVCC            : (none)
    HIPCC           : (none)
    ROCM_HOME       : (none)

  Modules:
    cuda      : No
      -> Include files not found: ['cublas_v2.h', 'cuda.h', 'cuda_profiler_api.h', 'cuda_runtime.h', 'cufft.h', 'curand.h', 'cusparse.h']
      -> Check your CFLAGS environment variable.

  ERROR: CUDA could not be found on your system.

  HINT: You are trying to build CuPy from source, which is NOT recommended for general use.
        Please consider using binary packages instead.

  Please refer to the Installation Guide for details:
  https://docs.cupy.dev/en/stable/install.html

  ************************************************************

  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/home/yahsveer/Desktop/cupy-first/setup.py", line 93, in <module>
      ext_modules = cupy_setup_build.get_ext_modules(True, ctx)
    File "/home/yahsveer/Desktop/cupy-first/install/cupy_builder/cupy_setup_build.py", line 473, in get_ext_modules
      extensions = make_extensions(ctx, compiler, use_cython)
    File "/home/yahsveer/Desktop/cupy-first/install/cupy_builder/cupy_setup_build.py", line 328, in make_extensions
      raise Exception('Your CUDA environment is invalid. '
  Exception: Your CUDA environment is invalid. Please check above error log.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed cleaning build dir for cupy Failed to build cupy Installing collected packages: cupy Running setup.py install for cupy ... error error: subprocess-exited-with-error

× Running setup.py install for cupy did not run successfully. │ exit code: 1 ╰─> [63 lines of output] Generating cache key from header files... Cache key (1545 files matching /home/yahsveer/Desktop/cupy-first/cupy/_core/include/**): 9bfdc8f113d90f22d2e93be7222cd267d0b50fef Clearing directory: /home/yahsveer/Desktop/cupy-first/cupy/.data

  -------- Configuring Module: cuda --------
  /tmp/tmp9e2_hc80/a.cpp:1:10: fatal error: cublas_v2.h: No such file or directory
      1 | #include <cublas_v2.h>
        |          ^~~~~~~~~~~~~
  compilation terminated.
  command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  /tmp/tmpxez_bxd5/a.cpp:2:18: fatal error: cuda_runtime_api.h: No such file or directory
      2 |         #include <cuda_runtime_api.h>
        |                  ^~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  **************************************************
  *** WARNING: Cannot check compute capability
  command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  **************************************************

  ************************************************************
  * CuPy Configuration Summary                               *
  ************************************************************

  Build Environment:
    Include directories: ['/home/yahsveer/Desktop/cupy-first/cupy/_core/include/cupy/_cccl/libcudacxx', '/home/yahsveer/Desktop/cupy-first/cupy/_core/include/cupy/_cccl/thrust', '/home/yahsveer/Desktop/cupy-first/cupy/_core/include/cupy/_cccl/cub', '/home/yahsveer/Desktop/cupy-first/cupy/_core/include']
    Library directories: []
    nvcc command       : (not found)
    hipcc command      : (not found)

  Environment Variables:
    CFLAGS          : (none)
    LDFLAGS         : (none)
    LIBRARY_PATH    : (none)
    CUDA_PATH       : (none)
    NVCC            : (none)
    HIPCC           : (none)
    ROCM_HOME       : (none)

  Modules:
    cuda      : No
      -> Include files not found: ['cublas_v2.h', 'cuda.h', 'cuda_profiler_api.h', 'cuda_runtime.h', 'cufft.h', 'curand.h', 'cusparse.h']
      -> Check your CFLAGS environment variable.

  ERROR: CUDA could not be found on your system.

  HINT: You are trying to build CuPy from source, which is NOT recommended for general use.
        Please consider using binary packages instead.

  Please refer to the Installation Guide for details:
  https://docs.cupy.dev/en/stable/install.html

  ************************************************************

  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/home/yahsveer/Desktop/cupy-first/setup.py", line 93, in <module>
      ext_modules = cupy_setup_build.get_ext_modules(True, ctx)
    File "/home/yahsveer/Desktop/cupy-first/install/cupy_builder/cupy_setup_build.py", line 473, in get_ext_modules
      extensions = make_extensions(ctx, compiler, use_cython)
    File "/home/yahsveer/Desktop/cupy-first/install/cupy_builder/cupy_setup_build.py", line 328, in make_extensions
      raise Exception('Your CUDA environment is invalid. '
  Exception: Your CUDA environment is invalid. Please check above error log.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> cupy

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

jakirkham commented 7 months ago

It's unclear how conda or conda-forge are involved here

As it is a source build and not using the recipe in this feedstock, it isn't an issue with this feedstock

Should this be raised upstream with CuPy?

Would add they likely want to know how the CUDA Toolkit and compilers were installed (and which versions). These are unclear from the information provided