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 issue, erroring on Linux #291

Closed
BUTTER-BEAR opened this issue May 17, 2024 · 19 comments
Closed

HVM Install issue, erroring on Linux #291

BUTTER-BEAR opened this issue May 17, 2024 · 19 comments

Comments

@BUTTER-BEAR
Copy link

BUTTER-BEAR commented May 17, 2024

Describe the bug
I get an Error when install hvm using cargo +nightly, im unsure of much else or the reason as to why, i have everything i know of to install it, but i might have missed something obvious.
logs.txt
logs.txt

To Reproduce
Steps to reproduce the behavior:

  1. Run the hvm install command
  2. cargo +nightly install hvm
    ``3. error occurred: Command "nvcc" "-ccbin=c++" "-Xcompiler" "-O3" "-Xcompiler" "-ffunction-sections" "-Xcompiler" "-fdata-sections" "-Xcompiler" "-fPIC" "-m64" "-Xcompiler" "-Wall" "-Xcompiler" "-Wextra" "-o" "/tmp/cargo-installLGALqh/release/build/hvm-d9bb437251039338/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.8, intermediate artifacts can be found at /tmp/cargo-installLGALqh.
To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.``

Expected behavior
Installation of hvm.

Desktop (please complete the following information):

  • OS: Linux (Arch)
  • CPU: AMD Ryzen 9 3900XT 12-Core Processor
  • GPU: NVIDIA P102-100, NVIDIA GeForce RTX 3080, NVIDIA GeForce RTX 2060
  • Cuda Version

Additional context
i have no clue what im doing, first time messing with rust and cargo, im sorry if this is a bit of a hassle
(i accidently sent two of the same logs, idk how to remove one sorry)

@developedby
Copy link
Member

What version of nvcc do you have installed? You can check with nvcc --version

@BUTTER-BEAR
Copy link
Author

oops i forgot those sorry
NVCC: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Thu_Mar_28_02:18:24_PDT_2024
Cuda compilation tools, release 12.4, V12.4.131
Build cuda_12.4.r12.4/compiler.34097967_0

@BUTTER-BEAR
Copy link
Author

you may close this issue, i compiled from source and then compiled normally and it worked, i still have no clue what was up but its there now... i hope at least

@Putnug1122
Copy link

you may close this issue, i compiled from source and then compiled normally and it worked, i still have no clue what was up but its there now... i hope at least

This might be because of the unsupported GNU version! GCC versions later than 12 are not supported!. I faced the exact problem, and then downgraded the GCC version to GCC 12 (from GCC 13), ran cargo +nightly install hvm again, and it worked like a charm

@BUTTER-BEAR
Copy link
Author

ahh ok, ill try that again if needed like if they do an update

@alexbalandi
Copy link

you may close this issue, i compiled from source and then compiled normally and it worked, i still have no clue what was up but its there now... i hope at least

Could you describe your exact steps please :D

@ethanbarry
Copy link

I'm experiencing this as well. To install gcc v12.x.x, you can use the AUR Package; it doesn't conflict with gcc v14.x.x, which is what Arch ships by default.

Unfortunately, this is a git package - I have to compile gcc locally. Once it's done, I'll let you know how it went...

@BUTTER-BEAR
Copy link
Author

the fix seems to be sudo ln -sf /path/to/g++ /usr/bin/c++ for the people who have this issue try this

@alexbalandi
Copy link

alexbalandi commented May 18, 2024

the solution for us was to make sure c++ and gcc point to the same compiler
So on my Arch/KDE setup I:

  1. Installed cuda with pacman -S cuda
  2. Made sure that my .bashrc ends like this:
export CUDA_HOME=/opt/cuda
export PATH=$CUDA_HOME/bin:$PATH
export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH

so that nvcc and gcc from this folder are used by default.
3. Made sure that c++ is a symlink to compiler in cuda folder
(ATTENTION : as mentioned by @developedby , it is actually a potentially breaking and hacky solution, if you choose to proceed with it, use sudo pacman -S gcc to get your c++ back to normal, but preferably just read the thread to the end)

sudo ln -sf /opt/cuda/bin/gcc /usr/bin/c++

This resolves the issue for me
The gcc version is

gcc --version
gcc (GCC) 13.2.1 20240417

@developedby
Copy link
Member

developedby commented May 18, 2024

the solution for us was to make sure c++ and gcc point to the same compiler So on my Arch/KDE setup I:

1. Installed cuda with `pacman -S cuda`

2. Made sure that my `.bashrc` ends like this:
export CUDA_HOME=/opt/cuda
export PATH=$CUDA_HOME/bin:$PATH
export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH

so that nvcc and gcc from this folder are used by default. 3. Made sure that c++ is a symlink to compiler in cuda folder

sudo ln -sf /opt/cuda/bin/gcc /usr/bin/c++

This resolves the issue for me The gcc version is

gcc --version
gcc (GCC) 13.2.1 20240417

Please be very careful about this. It will delete whatever file you have at /usr/bin/c++ because you gave it sudo and -f. This might not be ok and may break things depending on how your system is setup.

@alexbalandi
Copy link

alexbalandi commented May 18, 2024

@developedby

Judging from my outputs, it was a symlink to /usr/bin/gcc anyway 😅 But ty!

@developedby
Copy link
Member

I think it should work if you set the environment variable CXX to whatever is the path to gcc

export CXX=/path/to/the/right/gcc
cargo install hvm

or

CXX=/path/ cargo install hvm

but I don't have cuda to try it out

@ethanbarry
Copy link

Judging from my outputs, it was a symlink to /usr/bin/gcc anyway 😅 But ty!

On my fresh Arch install, it is not; I recommend users check before trying this...

@ethanbarry
Copy link

I think it should work if you set the environment variable CXX to whatever is the path to gcc...

This worked! Thank you, sir!

@alexbalandi
Copy link

Judging from my outputs, it was a symlink to /usr/bin/gcc anyway 😅 But ty!

On my fresh Arch install, it is not; I recommend users check before trying this...

Oh oh 💦 But ye, I updated my comment with a warning. Thank you and @developedby for pointing this out.

@alexbalandi
Copy link

alexbalandi commented May 18, 2024

I think it should work if you set the environment variable CXX to whatever is the path to gcc

export CXX=/path/to/the/right/gcc
cargo install hvm

or

CXX=/path/ cargo install hvm

but I don't have cuda to try it out

It does work for my case if I do the export in .bashrc, thank you!
The CXX= thing doesn't.

@aldum
Copy link

aldum commented May 18, 2024

If you don't want to bork your gcc 14:
CC=$(which cc-13) CXX=$(which g++-13) cargo +nightly install hvm works

@kings177
Copy link
Member

Closing this issue since it was solved.

Basically, changing your host compiler to gcc with either export CXX=gcc or some variant of that command

@cosmir17
Copy link

For me, 'cargo install hvm' installation required gcc 12 version rather than v.13 on my ubuntu version 24.04.
thus, I inserted the following lines in my .bachrc file
export CC=$(which cc-12)
export CXX=$(which g++-12)

then, it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants