Nvidia LogoThis is guide, howto install nVidia CUDA Toolkit 10.0 on Fedora 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. This is initial version of this guide and as always remember backup important files before doing anything!

1. Install NVIDIA CUDA Toolkit 10.0 on Fedora 28/27

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 cuda_10.0.130_410.48_linux.run and when you use browser files are normally downloaded /home/<username>/Downloads/cuda_10.0.xxx_linux.run 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:

reboot

1.5 Install needed dependencies

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

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.

./cuda_10.0.130_410.48_linux.run --override ## OR full path / full file name ## /path/to/cuda_10.0.130_410.48_linux.run --override /home/<username>/Downdloads/cuda_10.0.130_410.48_linux.run --override

Output:

Logging to /tmp/cuda_install_23154.log
Using more to view the EULA.
End User License Agreement
-------------------------- Preface
-------
...
...
...
############ Read/Move forward pressing space ############
...
...
...
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN TH
E SOFTWARE. -----------------
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/ld.so.conf 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/cuda.sh file:

cat << EOF > pathmunge /usr/local/cuda-10.0/bin before if [ -z "${LD_LIBRARY_PATH}" ]; then LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64
else LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH
fi export PATH LD_LIBRARY_PATH
EOF

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
/usr/local/cuda-10.0/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/user/.local/bin:/home/user/bin
[[email protected] ~]$ echo $LD_LIBRARY_PATH
/usr/local/cuda-10.0/lib64
[[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/ make "/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 ./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: < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) > 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.

Please let me know if you have problems!

Similar Posts