From 21600491b8ad36d82da1b18e084ae1d7282e75a1 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Tue, 23 May 2017 23:11:37 +0200 Subject: [PATCH] update instructions for fedora 25 its a shame this distrib doesnt provide older gcc toolchains.. :/ --- INSTALL | 36 +++++++++++++++++++++++++----------- nvml.cpp | 2 +- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/INSTALL b/INSTALL index b27ba4b..57740d6 100644 --- a/INSTALL +++ b/INSTALL @@ -9,20 +9,24 @@ where your CUDA 6.5 toolkit is installed (usually /usr/local/cuda, but some distros may have a different default location) -** How to compile on Fedora 22 (2015) ** +** How to compile on Fedora 25 ** # Step 1: gcc and dependencies -dnf install gcc gcc-c++ automake -dnf install jansson-devel openssl-devel libcurl-devel zlib-devel pciutils-devel +dnf install gcc gcc-c++ autoconf automake +dnf install jansson-devel openssl-devel libcurl-devel zlib-devel # Step 2: nvidia drivers (Download common linux drivers from nvidia site) dnf install kernel-devel -modprobe -r nouveau -./NVIDIA-Linux-x86_64-346.72.run +dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm +dnf check-update +dnf install xorg-x11-drv-nvidia-cuda kmod-nvidia +ln -s libnvidia-ml.so.1 /usr/lib64/libnvidia-ml.so -# Step 3: CUDA SDK (Download from nvidia archive) -dnf install cuda-repo-fedora20-6-5-prod-6.5-19.x86_64.rpm -dnf install cuda-minimal-build-6-5.x86_64 +# Step 3: CUDA SDK (Download from nvidia the generic ".run" archive) +# --override is required to ignore "too recent" gcc 6.3 +# --silent is required to install only the toolkit (no kmod) +./cuda_8.0.61_375.26_linux.run --toolkit --silent --override +nvcc --version # add the nvcc binary path to the system ln -s /usr/local/cuda-6.5 /usr/local/cuda @@ -32,9 +36,19 @@ echo 'export PATH=$PATH:/usr/local/cuda/bin' > /etc/profile.d/cuda.sh echo /usr/local/cuda/lib64 > /etc/ld.so.conf.d/cuda.conf ldconfig -# Step 4: Fix the toolkit warning with gcc 5.1 -edit the file /usr/local/cuda/include/host_config.h -and comment/delete the line 82 : #error -- unsupported GNU version! gcc 4.9 +# Step 4: Fix the toolkit incompatibility with gcc 6 + +# You need to build yourself an older GCC/G++ version, i recommend the 5.4 +# see https://gcc.gnu.org/mirrors.html + +wget ftp://ftp.lip6.fr/pub/gcc/releases/gcc-5.4.0/gcc-5.4.0.tar.bz2 +dnf install libmpc-devel mpfr-devel gmp-devel +./configure --prefix=/usr/local --enable-languages=c,c++,lto --disable-multilib +make -j 8 && make install +(while this step, you have the time to cook something :p) + +# or, for previous fedora versions, edit the file /usr/local/cuda/include/host_config.h +# and comment/delete the line 121 : #error -- unsupported GNU version! gcc versions later than 5 are not supported! ./build.sh diff --git a/nvml.cpp b/nvml.cpp index b1dce5d..8063d29 100644 --- a/nvml.cpp +++ b/nvml.cpp @@ -582,7 +582,7 @@ void nvml_print_device_info(int dev_id) if (hnvml->nvmlDeviceGetClock) { uint32_t gpu_clk = 0, mem_clk = 0; - fprintf(stderr, "------- Clocks -------\n"); + // fprintf(stderr, "------- Clocks -------\n"); hnvml->nvmlDeviceGetClock(hnvml->devs[n], NVML_CLOCK_GRAPHICS, NVML_CLOCK_ID_APP_CLOCK_DEFAULT, &gpu_clk); rc = hnvml->nvmlDeviceGetClock(hnvml->devs[n], NVML_CLOCK_MEM, NVML_CLOCK_ID_APP_CLOCK_DEFAULT, &mem_clk);