-
Notifications
You must be signed in to change notification settings - Fork 167
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
Linux build fails with GCC 10.3.0 (compiler bug) #138
Comments
That didn't work for me though. CMake Error at CMakeLists.txt:2 (project):
The CMAKE_C_COMPILER:
gcc-9
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:2 (project):
The CMAKE_CXX_COMPILER:
g++-9
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
|
Of course you need to have gcc 9 installed in your system for this to work. |
@TeamRazen you have to have CUDA Toolkit always has specific compiler requirements, which is the whole reason it's a plugin. So you can use the old garbage CUDA requires for the CUDA parts, while also compiling the main miner with a legitimate current compiler. CUDA Toolkits before 11.4.1 did not support newer than gcc-9. You can find the supported maximum gcc version listed in the Installation Guide for Linux within the versioned documentation of each release. That is how I just went back and found where the docs said gcc-9 and then at 11.4.1 it jumps ahead to gcc-11. If you are using an older CUDA due to an older GPU family (Fermi/Kepler) being unsupported in newer toolkits then you are limited by what the maximum compiler was "back then". CUDA 8.0GA2 requires gcc-5 for example. |
Thanks for the help, anyways, I fixed my install with just adding |
That is also pending merge in #120 |
I am running Debian testing (bookworm) and is already gcc 12 although I have gcc 9/10/11 also still installed, so I was able to compile with -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 Never mind I see #include is already added |
For those who have the same problem, there is a solution to install (non-destructive) older versions of tools like GCC. The solution I use is "Spack". # install spack in local directory
mkdir -p ~/.local/share
git clone -c feature.manyFiles=true https://github.com/spack/spack.git ~/.local/share/spack
# type this, you can also add this in your bashrc or bashrc.d
source ~/.local/share/spack/share/spack/setup-env.sh
# now, spack command exists, install gcc@11
# because the build is a bit heavy, change your TMPDIR to not fill your RAM
TMPDIR=/var/tmp spack install gcc@11
# it takes a long time...
# then, when you need to use gcc v11, you can type (session)
spack load gcc@11
# Then build the plugin
git clone [email protected]:xmrig/xmrig-cuda.git
cd xmrig-cuda
mkdir build
cd build
cmake .. && make This works on Fedora 38. |
Due to the Kepler arch's support are dropped in CUDA 12.x (which is compute_35 I believe), just remove these flags in cmake file. Following is what I did to my /cmake/CUDA.cmake file. And it do work.
BTW, I'm using fedora39, and it has gcc13 by default which is not supported by nvcc. I added |
After following all of this, it ended up not working with debian bookworm. Rest is in xmrig/xmrig-nvidia#348 |
Not related to xmrig-cuda per se but it's worth pointing out for people like me that have to go through the error-prone process of building from source.
A workaround is to compile with GCC 9:
Same issue in another repo: kokkos/kokkos#4334
The text was updated successfully, but these errors were encountered: