Skip to content

Commit

Permalink
update instructions for fedora 25
Browse files Browse the repository at this point in the history
its a shame this distrib doesnt provide older gcc toolchains.. :/
  • Loading branch information
tpruvot committed May 23, 2017
1 parent 8cf2159 commit 2160049
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
36 changes: 25 additions & 11 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion nvml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

2 comments on commit 2160049

@scaronni
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello!

I'm running my custom repository with all the multimedia packages that I require, and that includes custom built Nvidia and CUDA packages to better comply with Fedora packaging guidelines.

Here you can browse the repository:

https://negativo17.org/repos/multimedia/

It contains support for RHEL 7+ and Fedora 24+.

I have a ccminer rpm in my repository with compiled CUDA support, you just need to add the repository and do an install of the package to have everything that is required. I've been shipping this since a few years now. SPEC file is here, as you can see it's pretty simple as GCC 5.3, CUDA and Nvidia drivers are all packaged and inside the same repository:

https://github.com/negativo17/ccminer/blob/master/ccminer.spec

For information on the repository, you can look here:

https://negativo17.org/nvidia-driver/
https://negativo17.org/handbrake/

The Nvidia repository is currently under evaluation by the desktop SIG for enablement by default on Fedora 26. The multimedia repository is NOT compatible with RPMFusion.

Regards,
--Simone

@tpruvot
Copy link
Owner Author

@tpruvot tpruvot commented on 2160049 Jun 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, i updated the notes as alternative method... but didnt try (a rpm for ccminer is not the goal)

Please sign in to comment.