Install NVIDIA CUDA Toolkit 10.0 on Fedora 29/28 - Comment Page: 1

This is guide, howto install nVidia CUDA Toolkit 10.0 on Fedora 29/28/27. I assume here that you have installed nVidia drivers successfully using my earlier Fedora nVidia Drivers Install Guide. You will need nVidia 384.00 or later version (looks like you really need 410.xx). This is initial version of this guide and as always remember backup important files before doing anything! Table of Contents 1. Install NVIDIA CUDA Toolkit 10.0 on Fedora 29/28/27 2. Uninstall NVIDIA CUDA Toolkit 10.0 on Fedora 29/28/27 1. Install NVIDIA CUDA Toolkit 10.0 on Fedora 29/28/27 [inttf_post_ad1] 1.1 Download NVIDIA CUDA Toolkit 10.0 and Patch 1 Download NVIDIA CUDA Toolkit 10.0 runfile...

14 comments on “Install NVIDIA CUDA Toolkit 10.0 on Fedora 29/28 - Comment Page: 1

    1. 1.1 Download NVIDIA CUDA Toolkit 10.0 and Patch 1

      Download NVIDIA CUDA Toolkit 10.0 runfile (local) from official CUDA Toolkit download page. Only Fedora 27 version available, but works on Fedora 28 too.

      File is currently and when you use browser files are normally downloaded /home//Downloads/ location.
      1.2 Make CUDA installers executable

      chmod +x /path/to/cuda_10.0*.run

      1.3 Change root user

      su –
      ## OR ##
      sudo -i

      1.4 Make sure that you system is up-to-date and you are running latest kernel

      dnf update

      After update reboot your system and boot using latest kernel:


      [[email protected] Nvidia]$ chmod +x
      [[email protected] Nvidia]$
      [[email protected] Nvidia]$ sudo dnf update
      [sudo] password for ross:
      Last metadata expiration check: 0:56:28 ago on Sat 13 Oct 2018 08:24:44 PM PDT.
      Dependencies resolved.
      Nothing to do.
      [[email protected] Nvidia]$

      1.5 Install needed dependencies

      dnf install gcc-c++ mesa-libGLU-devel libX11-devel libXi-devel libXmu-devel

      libXi-devel.x86_64 1.7.9-6.fc28 libXmu-devel.x86_64 1.1.2-8.fc28 mesa-libGLU-devel.x86_64 9.0.0-14.fc28
      gl-manpages.noarch 1.1-15.20161227.fc28 libICE-devel.x86_64 1.0.9-12.fc28 libSM-devel.x86_64 1.2.2-8.fc28
      libXdamage-devel.x86_64 1.1.4-12.fc28 libXfixes-devel.x86_64 5.0.3-5.fc28 libXt-devel.x86_64 1.1.5-7.fc28
      libXxf86vm-devel.x86_64 1.1.4-7.fc28 libdrm-devel.x86_64 2.4.93-1.fc28 mesa-libGL-devel.x86_64 18.0.5-4.fc28

      1.6 Run NVIDIA CUDA Binary

      You will need nVidia Drivers > 410.xx (BETA) here, installer still says 384.00, but I can’t get CUDA working with 390.xx or 396.xx, so install nVidia 410.xx BETA Drivers first.

      You have to use –override parameter, so you can run installer with newer GCC.

      ./ –override

      ## OR full path / full file name ##

      /path/to/ –override

      /home//Downdloads/ –override


      Logging to /tmp/cuda_install_23154.log
      Using more to view the EULA.
      End User License Agreement


      ############ Read/Move forward pressing space ############


      Do you accept the previously read EULA?
      accept/decline/quit: accept

      You are attempting to install on an unsupported configuration. Do you wish to continue?
      (y)es/(n)o [ default is no ]: y

      Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 410.48?
      (y)es/(n)o/(q)uit: n

      Install the CUDA 10.0 Toolkit?
      (y)es/(n)o/(q)uit: y

      Enter Toolkit Location
      [ default is /usr/local/cuda-10.0 ]:

      Do you want to install a symbolic link at /usr/local/cuda?
      (y)es/(n)o/(q)uit: y

      Install the CUDA 10.0 Samples?
      (y)es/(n)o/(q)uit: y

      Enter CUDA Samples Location
      [ default is /root ]:

      Installing the CUDA Toolkit in /usr/local/cuda-10.0 …
      Installing the CUDA Samples in /root …
      Copying samples to /root/NVIDIA_CUDA-10.0_Samples now…
      Finished copying samples.

      = Summary =

      Driver: Not Selected
      Toolkit: Installed in /usr/local/cuda-10.0
      Samples: Installed in /root

      Please make sure that
      – PATH includes /usr/local/cuda-10.0/bin
      – LD_LIBRARY_PATH includes /usr/local/cuda-10.0/lib64, or, add /usr/local/cuda-10.0/lib64 to /etc/ and run ldconfig as root

      To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-10.0/bin

      Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-10.0/doc/pdf for detailed information on setting up CUDA.

      ***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 384.00 is required for CUDA 10.0 functionality to work.
      To install the driver using this installer, run the following command, replacing with the name of this run file:
      sudo .run -silent -driver

      Logfile is /tmp/cuda_install_23154.log

      1.7 Post Installation Tasks

      Make sure that PATH includes /usr/local/cuda-10.0/bin and LD_LIBRARY_PATH includes /usr/local/cuda-10.0/lib64. You can of course do this per user or use some other method, but here is one method to do this. Run following command (copy & paste all lines to console) to create /etc/profile.d/ file:

      cat <
      pathmunge /usr/local/cuda-10.0/bin before

      if [ -z “${LD_LIBRARY_PATH}” ]; then


      Then logout/login (simply close terminal and open it again). Now as normal user and root you should see something like (depends on your system):

      [[email protected] ~]$ echo $PATH
      [[email protected] ~]$ echo $LD_LIBRARY_PATH
      [[email protected] ~]$

      1.8 Test Your Installation, Compile and Run deviceQuery

      As a root user:

      cd /root/NVIDIA_CUDA-10.0_Samples/1_Utilities/deviceQuery/

      “/usr/local/cuda-10.0″/bin/nvcc -ccbin g++ -I../../common/inc -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_70,code=compute_70 -o deviceQuery.o -c deviceQuery.cpp
      “/usr/local/cuda-10.0″/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_70,code=compute_70 -o deviceQuery deviceQuery.o
      mkdir -p ../../bin/x86_64/linux/release
      cp deviceQuery ../../bin/x86_64/linux/release

      ./deviceQuery Starting…

      CUDA Device Query (Runtime API) version (CUDART static linking)

      Detected 1 CUDA Capable device(s)

      Device 0: “GeForce GT 1030”
      CUDA Driver Version / Runtime Version 10.0 / 10.0
      CUDA Capability Major/Minor version number: 6.1
      Total amount of global memory: 2001 MBytes (2098135040 bytes)
      ( 3) Multiprocessors, (128) CUDA Cores/MP: 384 CUDA Cores
      GPU Max Clock rate: 1519 MHz (1.52 GHz)
      Memory Clock rate: 3004 Mhz
      Memory Bus Width: 64-bit
      L2 Cache Size: 524288 bytes
      Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
      Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers
      Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers
      Total amount of constant memory: 65536 bytes
      Total amount of shared memory per block: 49152 bytes
      Total number of registers available per block: 65536
      Warp size: 32
      Maximum number of threads per multiprocessor: 2048
      Maximum number of threads per block: 1024
      Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
      Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
      Maximum memory pitch: 2147483647 bytes
      Texture alignment: 512 bytes
      Concurrent copy and kernel execution: Yes with 2 copy engine(s)
      Run time limit on kernels: Yes
      Integrated GPU sharing Host Memory: No
      Support host page-locked memory mapping: Yes
      Alignment requirement for Surfaces: Yes
      Device has ECC support: Disabled
      Device supports Unified Addressing (UVA): Yes
      Device supports Compute Preemption: Yes
      Supports Cooperative Kernel Launch: Yes
      Supports MultiDevice Co-op Kernel Launch: Yes
      Device PCI Domain ID / Bus ID / location ID: 0 / 1 / 0
      Compute Mode:

      deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.0, CUDA Runtime Version = 10.0, NumDevs = 1
      Result = PASS

      Thats all, but you might see problems with other examples, because you have too fresh GCC.

      ====> Yes!

      First I want to compile the sample programs included in the CUDA Toolkit. To do that I used the edits suggested by Carter Turn:


      which are:

      Modify host_config.h
      As usual, we need to comment out the section of NVIDIA’s host_config.h that prevents us from using newer GCC versions. In a slight twist from last time, we need to modify /usr/local/cuda/include/crt/host_config.h (Note that the /usr/local/cuda part depends on where you chose to install during the installation). Comment out the line

      #error — unsupported GNU version! gcc versions later than 6 are not supported!

      For me, that was line 121.

      Modify floatn.h
      For some reason, nvcc does not like 128 bit floats, so we need to modify /usr/include/bits/floatn.h. The easiest way to do this (e.g. the way that involves opening as few files as possible) is to add

      #ifdef __CUDACC__
      #define __HAVE_FLOAT128 0

      just after the section of floatn.h that defines __HAVE_FLOAT128. In my copy, this was line 37.

      So far, the only error I am getting is related to having an outdated driver, so I think


      I can’t figure outwhere I got the next edit but it is to add:

      CCFLAGS := -ansi

      to all Makefiles. This and removing some c++ style comments (// …) allows me to compile all of the examples except c++11_cuda. Unfortunately, that won’t compile because the C++ compiler I have is:

      gcc version 8.2.1 20181011 (Red Hat 8.2.1-4) (GCC)

      which when set to -ansi removes the C++11 ability. This in turn means I can’t install OpenCV with CUDA support since that requires at least C++11.

      So I’m at a dead end for now. Do you have any suggestions? How long do you think it will be before the CUDA Toolkit catches up to Fedora 28 and gcc 8.

      • Hi Ross,

        Unfortunately I don’t have any idea when CUDA toolkit catch up to Fedora 28 and gcc 8. I guess that nVidia CUDA is more targeted to RHEL and CentOS than Fedora, because Fedora use always latest packages.

    2. Why the step 1.7 (updating the PATH and LD_LIBRARY_PATH) with the in /etc/profile.d/ does not work?
      I tried logout and system restart both doesn’t update the PATH. I can update through ~/.bashrc.

      • Hi Yoki,

        Sorry, there was one critical piece missing on step 1.7. You could try it again, it should work now.

    3. Hi, how can I install older version of gcc or how can I handle it, so it works fine?

    4. I have a GTX 750 running on Fedora 29. I have installed (410.78 and 415.13 fail in gnome-display-manager). fails on driver incompatablity. installs and precompiled binaries work, but the Nvidia compiler, nvcc fails because my gcc version in greater than 6. I would like to install cuda 10.0 and run it with nvidia 410 or 415. Do you have a patched version of one of these or instruct how to create one? thanks

      • Hi Kim,

        Fully update your system and try nVidia 415.22, GDM should work then?

    5. Hi,

      I got Blender CUDA rendering to work on Fedora 29 by using clang to compile the cuda kernels instead of gcc. Simply running nvcc with parameter “-ccbin clang-7”. I actually replaced nvcc with a shell script: “/usr/local/cuda/bin/nvcc-old -ccbin clang-7 [email protected]”. Probably just a stupid hack, but I did not like the idea of downgrading gcc :P

      • Thanks mrahikai for this tip!

    6. It seems that GCC-8.2 is still not compatible with CUDA-10.0 on Fedora-29.
      The “deviceQuery” example works fine. However, building any other CUDA-10 examples available in the NVIDIA_CUDA-10.0_Samples leads to an error.

      “error — unsupported GNU version! gcc versions later than 7 are not supported!”

      After modifying the
      /opt/cuda-10.0/include/crt/host_config.h to elliminate the GNUC version check (line 127), the compilation error with “nvcc” is:

      I used the “p2pBandwidthLatencyTest” for the test.

      Please help me to deal with this issue.

      Best regards,

      /usr/include/c++/8/type_traits(1049): error: type name is not allowed

      /usr/include/c++/8/type_traits(1049): error: type name is not allowed

      /usr/include/c++/8/type_traits(1049): error: identifier “__is_assignable” is undefined

      /usr/include/c++/8/type_traits(2436): error: class “std::enable_if<, void>” has no member “type”
      detected during instantiation of “std::swap” based on template argument
      /usr/include/c++/8/x86_64-redhat-linux/bits/basic_file.h(79): here

      /usr/include/c++/8/x86_64-redhat-linux/bits/basic_file.h(80): error: no instance of overloaded function “std::swap” matches the argument list
      argument types are: (__nv_bool, __nv_bool)

      5 errors detected in the compilation of “/tmp/tmpxft_00000f0b_00000000-14_p2pBandwidthLatencyTest.compute_75.cpp1.ii”.
      make: *** [Makefile:288: p2pBandwidthLatencyTest.o] Error 1


      • @Liviu Ungur

        Use “–override” functionality.

    7. I see that a new CUDA library is available for Fedora 29:

      I’ll try to install it soon and see if I can now compile with the g++ that comes with Fedora 29.

      • Looking at the documentation for this release, I see that it is built on LLVM and clang so maybe it would be a good idea to transition to that c++ compiler system.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.