HVM icon indicating copy to clipboard operation
HVM copied to clipboard

HVM Install issue, erroring on Linux

Open BUTTER-BEAR opened this issue 1 year ago • 17 comments

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)

BUTTER-BEAR avatar May 17 '24 23:05 BUTTER-BEAR

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

developedby avatar May 17 '24 23:05 developedby

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 avatar May 17 '24 23:05 BUTTER-BEAR

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

BUTTER-BEAR avatar May 18 '24 02:05 BUTTER-BEAR

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

Putnug1122 avatar May 18 '24 04:05 Putnug1122

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

BUTTER-BEAR avatar May 18 '24 04:05 BUTTER-BEAR

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

alexbalandi avatar May 18 '24 12:05 alexbalandi

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...

ethanbarry avatar May 18 '24 12:05 ethanbarry

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

BUTTER-BEAR avatar May 18 '24 12:05 BUTTER-BEAR

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

alexbalandi avatar May 18 '24 12:05 alexbalandi

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.

developedby avatar May 18 '24 12:05 developedby

@developedby

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

alexbalandi avatar May 18 '24 12:05 alexbalandi

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

developedby avatar May 18 '24 12:05 developedby

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 avatar May 18 '24 12:05 ethanbarry

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

This worked! Thank you, sir!

ethanbarry avatar May 18 '24 12:05 ethanbarry

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 :sweat_drops: But ye, I updated my comment with a warning. Thank you and @developedby for pointing this out.

alexbalandi avatar May 18 '24 12:05 alexbalandi

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.

alexbalandi avatar May 18 '24 13:05 alexbalandi

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

aldum avatar May 18 '24 13:05 aldum

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

kings177 avatar May 18 '24 16:05 kings177

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.

cosmir17 avatar May 31 '24 14:05 cosmir17