Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HVM install failing when compiling the Cuda runtime #507

Closed
Azer0s opened this issue May 26, 2024 · 4 comments
Closed

HVM install failing when compiling the Cuda runtime #507

Azer0s opened this issue May 26, 2024 · 4 comments
Labels
HVM About the HVM question Further information is requested

Comments

@Azer0s
Copy link

Azer0s commented May 26, 2024

Reproducing the behavior

When installing HVM2 with cargo I get this output:

error: failed to run custom build command for `hvm v2.0.17`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installZF1wmb/release/build/hvm-86794233c4678d8c/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=src/hvm.c
  cargo:rerun-if-changed=src/hvm.cu
  TARGET = Some("x86_64-unknown-linux-gnu")
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
  CC_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
  CC_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
  CFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
  CFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=AR_x86_64-unknown-linux-gnu
  AR_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=AR_x86_64_unknown_linux_gnu
  AR_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_AR
  HOST_AR = None
  cargo:rerun-if-env-changed=AR
  AR = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64-unknown-linux-gnu
  ARFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64_unknown_linux_gnu
  ARFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_ARFLAGS
  HOST_ARFLAGS = None
  cargo:rerun-if-env-changed=ARFLAGS
  ARFLAGS = None
  cargo:rustc-link-lib=static=hvm-c
  cargo:rustc-link-search=native=/tmp/cargo-installZF1wmb/release/build/hvm-026143d474abc59a/out
  cargo:rustc-cfg=feature="c"
  cargo:rustc-link-search=native=/usr/local/cuda/lib64
  TARGET = Some("x86_64-unknown-linux-gnu")
  OPT_LEVEL = Some("3")
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CXX_x86_64-unknown-linux-gnu
  CXX_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CXX_x86_64_unknown_linux_gnu
  CXX_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CXX
  HOST_CXX = None
  cargo:rerun-if-env-changed=CXX
  CXX = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=NVCC_x86_64-unknown-linux-gnu
  NVCC_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=NVCC_x86_64_unknown_linux_gnu
  NVCC_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_NVCC
  HOST_NVCC = None
  cargo:rerun-if-env-changed=NVCC
  NVCC = None
  cargo:warning=Compiler family detection failed due to error: ToolExecError: Command "nvcc" "-E" "/tmp/cargo-installZF1wmb/release/build/hvm-026143d474abc59a/out/2942679597282887165detect_compiler_family.c" with args nvcc did not execute successfully (status code exit status: 1).
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-unknown-linux-gnu
  CXXFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_unknown_linux_gnu
  CXXFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CXXFLAGS
  HOST_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  cargo:warning=nvcc warning : incompatible redefinition for option 'compiler-bindir', the last value of this option was used
  cargo:warning=/usr/include/c++/14.1.1/x86_64-pc-linux-gnu/bits/c++config.h(827): error: user-defined literal operator not found
  cargo:warning=    typedef __decltype(0.0bf16) __bfloat16_t;
  cargo:warning=                       ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(529): error: type name is not allowed
  cargo:warning=      : public __bool_constant<__is_array(_Tp)>
  cargo:warning=                                          ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(529): error: identifier "__is_array" is undefined
  cargo:warning=      : public __bool_constant<__is_array(_Tp)>
  cargo:warning=                               ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(581): error: type name is not allowed
  cargo:warning=      : public __bool_constant<__is_member_object_pointer(_Tp)>
  cargo:warning=                                                          ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(581): error: identifier "__is_member_object_pointer" is undefined
  cargo:warning=      : public __bool_constant<__is_member_object_pointer(_Tp)>
  cargo:warning=                               ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(603): error: type name is not allowed
  cargo:warning=      : public __bool_constant<__is_member_function_pointer(_Tp)>
  cargo:warning=                                                            ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(603): error: identifier "__is_member_function_pointer" is undefined
  cargo:warning=      : public __bool_constant<__is_member_function_pointer(_Tp)>
  cargo:warning=                               ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(695): error: type name is not allowed
  cargo:warning=      : public __bool_constant<__is_reference(_Tp)>
  cargo:warning=                                              ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(695): error: identifier "__is_reference" is undefined
  cargo:warning=      : public __bool_constant<__is_reference(_Tp)>
  cargo:warning=                               ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(731): error: type name is not allowed
  cargo:warning=      : public __bool_constant<__is_object(_Tp)>
  cargo:warning=                                           ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(731): error: identifier "__is_object" is undefined
  cargo:warning=      : public __bool_constant<__is_object(_Tp)>
  cargo:warning=                               ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(760): error: type name is not allowed
  cargo:warning=      : public __bool_constant<__is_member_pointer(_Tp)>
  cargo:warning=                                                   ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(760): error: identifier "__is_member_pointer" is undefined
  cargo:warning=      : public __bool_constant<__is_member_pointer(_Tp)>
  cargo:warning=                               ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(3247): error: type name is not allowed
  cargo:warning=    inline constexpr bool is_array_v = __is_array(_Tp);
  cargo:warning=                                                  ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(3271): error: type name is not allowed
  cargo:warning=      __is_member_object_pointer(_Tp);
  cargo:warning=                                 ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(3281): error: type name is not allowed
  cargo:warning=      __is_member_function_pointer(_Tp);
  cargo:warning=                                   ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(3298): error: type name is not allowed
  cargo:warning=    inline constexpr bool is_reference_v = __is_reference(_Tp);
  cargo:warning=                                                          ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(3315): error: type name is not allowed
  cargo:warning=    inline constexpr bool is_object_v = __is_object(_Tp);
  cargo:warning=                                                    ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/type_traits(3328): error: type name is not allowed
  cargo:warning=    inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);
  cargo:warning=                                                                    ^
  cargo:warning=
  cargo:warning=/usr/include/c++/14.1.1/bits/utility.h(237): error: __type_pack_element is not a template
  cargo:warning=      { using type = __type_pack_element<_Np, _Types...>; };
  cargo:warning=                     ^
  cargo:warning=
  cargo:warning=20 errors detected in the compilation of "src/hvm.cu".

  --- stderr


  error occurred: Command "nvcc" "-ccbin=c++" "-Xcompiler" "-O3" "-Xcompiler" "-ffunction-sections" "-Xcompiler" "-fdata-sections" "-Xcompiler" "-fPIC" "-m64" "-Xcompiler" "-Wall" "-Xcompiler" "-Wextra" "-diag-suppress=177" "-diag-suppress=550" "-diag-suppress=20039" "-o" "/tmp/cargo-installZF1wmb/release/build/hvm-026143d474abc59a/out/2e40c9e35e9506f4-hvm.o" "-c" "src/hvm.cu" with args nvcc did not execute successfully (status code exit status: 2).


warning: build failed, waiting for other jobs to finish...
error: failed to compile `hvm v2.0.17`, intermediate artifacts can be found at `/tmp/cargo-installZF1wmb`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

System Settings

nvidia-smi output

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.78                 Driver Version: 550.78         CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 2080        On  |   00000000:01:00.0  On |                  N/A |
|  0%   57C    P8             26W /  245W |    1181MiB /   8192MiB |     20%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

neofetch output

                   -`                    ariel@homelab 
                  .o+`                   ------------- 
                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Host: Z390 I AORUS PRO WIFI 
               `+oooooo:                 Kernel: 6.8.9-arch1-2 
               -+oooooo+:                Uptime: 16 hours, 32 mins 
             `/:-:++oooo+:               Packages: 1704 (pacman) 
            `/++++/+++++++:              Shell: fish 3.7.1 
           `/++++++++++++++:             Resolution: 1080x1920, 2560x1440 
          `/+++ooooooooooooo/`           DE: GNOME 46.1 
         ./ooosssso++osssssso+`          WM: Mutter 
        .oossssso-````/ossssss+`         WM Theme: Adwaita 
       -osssssso.      :ssssssso.        Theme: Adwaita [GTK2/3] 
      :osssssss/        osssso+++.       Icons: Adwaita [GTK2/3] 
     /ossssssss/        +ssssooo/-       Terminal: kitty 
   `/ossssso+/:-        -:/+osssso+-     CPU: Intel i7-9700K (8) @ 4.900GHz 
  `+sso+:-`                 `.-/+oso:    GPU: NVIDIA GeForce RTX 2080 Rev. A 
 `++:.                           `-/+/   Memory: 10881MiB / 32013MiB 
 .`                                 `/
                                                                 
                                                                                                                         

Additional context

No response

@developedby
Copy link
Member

Can you check what version of nvcc and gcc you're using?

nvcc --version
c++ --version

@developedby
Copy link
Member

Nevermind, I see that you're using gcc 14.1.1 from the log. Unfortunately nvcc doesn't work with gcc 14, only up to 13. https://forums.developer.nvidia.com/t/cuda-12-4-nvcc-and-gcc-14-1-incompatibility/293295

It looks like the arch package for the cuda toolkit is bringing in the wrong version of gcc, you're not the first person to find this.

@developedby
Copy link
Member

It should work if you install gcc-13 and do CXX=g++-13 cargo install hvm. Or whatever the binary is called in the arch package

@developedby developedby added question Further information is requested HVM About the HVM labels May 27, 2024
@developedby developedby changed the title Can't install HVM HVM install failing when compiling the Cuda runtime May 27, 2024
@developedby
Copy link
Member

Duplicate of HigherOrderCO/HVM#291

@developedby developedby marked this as a duplicate of HigherOrderCO/HVM#291 May 27, 2024
@developedby developedby closed this as not planned Won't fix, can't repro, duplicate, stale May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HVM About the HVM question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants