HVM Install issue, erroring on Linux
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:
- Run the hvm install command
-
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)
What version of nvcc do you have installed? You can check with nvcc --version
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
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
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
ahh ok, ill try that again if needed like if they do an update
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
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...
the fix seems to be sudo ln -sf /path/to/g++ /usr/bin/c++ for the people who have this issue try this
the solution for us was to make sure c++ and gcc point to the same compiler
So on my Arch/KDE setup I:
- Installed cuda with
pacman -S cuda - Made sure that my
.bashrcends 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
the solution for us was to make sure
c++andgccpoint 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_PATHso that nvcc and gcc from this folder are used by default. 3. Made sure that
c++is a symlink to compiler in cuda foldersudo 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
Judging from my outputs, it was a symlink to /usr/bin/gcc anyway :sweat_smile: But ty!
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
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...
I think it should work if you set the environment variable CXX to whatever is the path to gcc...
This worked! Thank you, sir!
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.
I think it should work if you set the environment variable
CXXto whatever is the path to gccexport CXX=/path/to/the/right/gcc cargo install hvmor
CXX=/path/ cargo install hvmbut 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.
If you don't want to bork your gcc 14:
CC=$(which cc-13) CXX=$(which g++-13) cargo +nightly install hvm works
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
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.