How-To's‎ > ‎IT‎ > ‎Linux‎ > ‎

Fedora 20

Install the NVIDA toolkit, and Obtain vital info on the video cards

I first rebooted the computer to get info from the BIOS:
PCI VGA Configuration
Slot 2 PCIe2 x16 Non-boot device  (Quadro 4000)
Slot 5 PCIe2 x16 Primary VGA device (Quadro FX 380)
Thus I have the Quadro FX 380 in charge of display images in the monitor, and the Quadro 4000 in 'reserve'

Following instructions from
http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html#axzz3KDMQuZZ7.
Only certain elements of the install instructions have been detailed here.

Verify the system has a CUDA-capable GPU:
lspci | grep -i nvidia
0f:00.0 VGA compatible controller: NVIDIA Corporation G96GL [Quadro FX 380] (rev a1)
42:00.0 VGA compatible controller: NVIDIA Corporation GF100GL [Quadro 4000] (rev a3)

According to https://developer.nvidia.com/cuda-gpus, only the Quadro 4000 is CUDA-capable.

Installation Method
A Fedora-20 RPM is provided, and a repository address. This address will be used for subsequent updates of the package.
From https://developer.nvidia.com/cuda-downloads, get package cuda-repo-fedora20-6.5-14.x86_64.rpm. It is a meta-package, so its installation only informs the package manager where to find the actual installation packages, but will not install them.
Before installing the package, be sure requirements specified in http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html#fedora-installation are fulfilled. After this, install the meta-package and then install the cuda package.
sudo rpm --install cuda-repo-fedora20-6.5-14.x86_64.rpm
sudo yum install cuda
The cuda package installs all the available packages for native developments. That includes the compiler, the debugger, the profiler, the math libraries,... For x86_64 patforms, this also include NSight Eclipse Edition and the visual profiler It also includes the NVIDIA driver package. We also install and additional package afterwards:
sudo yum install gpu-deployment-kit
A modules file will set the environment when using CUDA. We put it under /usr/share/Modules/modulefiles/cuda/6.5.

Install and run the samples
cd $HOME/Downloads
sudo yum install cuda-samples-6-5.x86_64

We will run the samples as non-root:
module load cuda/6.5
cd $HOME/Downloads
cuda-install-samples-6.5.sh ./

cd cuda-samples/NVIDIA_CUDA-6.5_Samples
make -j4
Some CUDA samples use third-party libraries which may not be installed by default on your system. These samples attempt to detect any required libraries when building. If a library is not detected, it waives itself and warns you which library is missing. To build and run these samples, you must install the missing libraries.
Before trying the samples, I updated the system and rebooted:
sudo yum update
sudo shutdown -r now
I tested my CUDA installation:
cd $HOME/Downloads/NVIDIA_CUDA-6.5_Samples/bin/x86_64/linux/release
./deviceQuery
./deviceQuery Starting...
 CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 2 CUDA Capable device(s)

Device 0: "Quadro 4000"
  CUDA Driver Version / Runtime Version          6.5 / 6.5
  CUDA Capability Major/Minor version number:    2.0
  Total amount of global memory:                 2047 MBytes (2146631680 bytes)
  ( 8) Multiprocessors, ( 32) CUDA Cores/MP:     256 CUDA Cores
  GPU Clock rate:                                950 MHz (0.95 GHz)
  Memory Clock rate:                             1404 Mhz
  Memory Bus Width:                              256-bit
  L2 Cache Size:                                 524288 bytes
  Maximum Texture Dimension Size (x,y,z)         1D=(65536), 2D=(65536, 65535), 3D=(2048, 2048, 2048)
  Maximum Layered 1D Texture Size, (num) layers  1D=(16384), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(16384, 16384), 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: 32768
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  1536
  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): (65535, 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 PCI Bus ID / PCI location ID:           66 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

Device 1: "Quadro FX 380"
  CUDA Driver Version / Runtime Version          6.5 / 6.5
  CUDA Capability Major/Minor version number:    1.1
  Total amount of global memory:                 256 MBytes (268238848 bytes)
  ( 2) Multiprocessors, (  8) CUDA Cores/MP:     16 CUDA Cores
  GPU Clock rate:                                1100 MHz (1.10 GHz)
  Memory Clock rate:                             700 Mhz
  Memory Bus Width:                              128-bit
  Maximum Texture Dimension Size (x,y,z)         1D=(8192), 2D=(65536, 32768), 3D=(2048, 2048, 2048)
  Maximum Layered 1D Texture Size, (num) layers  1D=(8192), 512 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(8192, 8192), 512 layers
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       16384 bytes
  Total number of registers available per block: 8192
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  768
  Maximum number of threads per block:           512
  Max dimension size of a thread block (x,y,z): (512, 512, 64)
  Max dimension size of a grid size    (x,y,z): (65535, 65535, 1)
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             256 bytes
  Concurrent copy and kernel execution:          Yes with 1 copy engine(s)
  Run time limit on kernels:                     No
  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):      No
  Device PCI Bus ID / PCI location ID:           15 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 6.5, CUDA Runtime Version = 6.5, NumDevs = 2, Device0 = Quadro 4000, Device1 = Quadro FX 380
Result = PASS
It seems that both cards are CUDA capable, contrary to what https://developer.nvidia.com/cuda-gpus said about the Quadro FX-380 card.
Notice that NumDevs = 2 and Device0 = Quadro 4000, Device1 = Quadro FX 380
At this moment, we take other verification steps:
cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module  340.29  Thu Jul 31 20:23:19 PDT 2014
GCC version:  gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC)
Also
lsmod | grep nvidia
nvidia_uvm             35125  0
nvidia              10538110  81 nvidia_uvm
drm                   296901  8 nvidia
Also
ls /dev/nvidia*
/dev/nvidia0  /dev/nvidia1  /dev/nvidiactl  /dev/nvidia-uvm

Running the bandwidthTest program ensures that the system and the CUDA-capable device are able to communicate correctly
cd $HOME/Downloads/NVIDIA_CUDA-6.5_Samples/bin/x86_64/linux/release
[CUDA Bandwidth Test] - Starting...
Running on...
 Device 0: Quadro 4000
 Quick Mode
 Host to Device Bandwidth, 1 Device(s)
 PINNED Memory Transfers
   Transfer Size (Bytes)    Bandwidth(MB/s)
   33554432            3806.3
 Device to Host Bandwidth, 1 Device(s)
 PINNED Memory Transfers
   Transfer Size (Bytes)    Bandwidth(MB/s)
   33554432            1517.5
 Device to Device Bandwidth, 1 Device(s)
 PINNED Memory Transfers
   Transfer Size (Bytes)    Bandwidth(MB/s)
   33554432            73512.0
Result = PASS
There's no info output for the Quadro FX-380, so it seems that it is not a CUDA-capable device. Either this or that program bandwidthTest will test only the first device.

Finally, we can run all the binaries from the samples:
cd $HOME/Downloads/NVIDIA_CUDA-6.5_Samples/bin/x86_64/linux/release
for executable in `find . -type f -executable`;do $executable;done &> /tmp/samples_output.txt
Inspect output file /tmp/samples_output.txt for errors. NOTE: there will be a bunch of pop-ups with images and simulations as the samples run. Many of the samples executables did use the Quadro FX-380, thus this card is also CUDA capable. We check for errors:
grep -i error tmp/samples_output.txt
Error: Condition (allocation_cb == 1) failed at cuHook.cpp:115
0 error(s)
L2norm Error OK
L2norm Error OK
L2norm Error OK
Test Summary: 0 errors
Absolute error: 1.447201e-03
Relative error: 4.606583e-04
Max absolute error: 1.239777E-05
Device assert failed as expected, CUDA error message is: device-side assert triggered
L1 error : 0.044308
Loading extensions: No error
Absolute error: 5.272627e-03
Relative error: 1.678329e-03
Loading extensions: No error
Counted total of 0 errors
Shader compilation error: Fragment info
Shader compilation error: Fragment info
Absolute error: 4.072666e-03
Relative error: 1.296370e-03
Max absolute error: 0.000000E+00
Absolute error: 2.472401e-04
Relative error: 7.869895e-05
Test Summary:  Error amount = 0.000000
DevicecheckCudaErrors Count: 2
L1-Error: 0
L1 error: 2.745062E-08
Only one error pops out, good enough for me!

Static Number of Workspaces

I don't like the dynamic number of workspaces which is the default in Gnome 3. Open the tweak-tool and in 'workspaces' select 'Static' and the desired number of workspaces...voila!

Keyboard Shortcuts when More than Four Workspaces

Silly keyboad shortcuts offered in the Settings do not allow  shortcuts for more than four workspaces. To get around, type in the terminal (not sudo):
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 '["<Primary>F5"]'
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-6 '["<Primary>F6"]'

This will allow one to switch to workspace 5 with the combination Ctrl-F5, for instance

ORNL Fedora repository out of Sync with Fedora Parent: Package not Found

Sometimes the Fedora repository at ORNL may be older than the parent repository. This may lead to such problems as a package not being found. When that happens, we have to manually edit the fedora repo files to have direct access to the parent repository.
  • Open file fedora.repo  in directory /etc/yum.repos.d/ for editing:
    • Comment line baseurl=http://repoman.ornl.gov/fedora/linux/releases/$releasever/Everything/$basearch/os/
    • Uncomment following line metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
  • Open file  fedora-updates.repo and fedora-updates.repo in directory /etc/yum.repos.d/ for editing
    • Comment line baseurl=http://repoman.ornl.gov/fedora/linux/updates/$releasever/$basearch/
    • Uncomment following line metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch
Mind you, these changes are temporary because core IT will reset these files. However, these changes will allow you to update the packages until the reset is performed.


Install XScreeensaver and Configure

Fedora 20 comes with no screen saver. Xscreensaver allows a picture slideshow, much better than gnome-screensaver.
  • Install with sudo yum install xscreensaver-base xscreensaver-extras xscreensaver-extras-base xscreensaver-gl-base xscreensaver-gl-extras.
  • Start typing xscreensaver in the application search field and add the application to favorites.
  • Start the application, select 'Only One Screen Saver' in 'Mode'. Select 'GLSlideshow' from the list of available screensavers.  In the 'Advanced' tab, set the directory containing the images in the 'Image Manipulation' --> 'Choose Random Image'. Back in the 'Display Modes' tab, click in 'Settings' for details of the screen saver, like load images every certain number of seconds, and so on.

Mounting File SystemsI used the 'disks' GUI application. To mount /dev/sdb1 onto /projects2:

  • select /dev/sdb2
  • Click in 'more actions' (small button with dented wheels), then select 'edit mount options'
  • Unclick  'Automatic Mount Options', then select /projects2 as the 'Mount Point' and select /dev/sdb1 in 'Identify As'.

Configuring Sudo

  • To add user 'jbq' to the list of privileged users, write as root: echo 'jbq ALL=(ALL) ALL' >> /etc/sudoers

Installing WSCfengine

  • The WSCfengine download page at the Linux user group contains the link to the RPM package.
  • As root or with sudo yum localinstall wscfengine-3.5.3-3.prod.fedora.fc20.x86_64.rpm.

Installing wsadduser and wspasswd

  • From the Linux user group, follow the links in the page Installing a New Linux Operative system to retrieve RPM's for wsadduser and wspasswd
  • As root or with sudo: yum localinstall wsadduser-2.0-3.ORNL.x86_64.rpm and  yum localinstall wspasswd-3.00-6.ORNL.x86_64.rpm.
  • Then, as root or with sudo: wsadduser. A series of questions will follow and I added 'jbq' as a new user.

Installing Fedora 20 in Workstation

  • Insert Fedora 20 Live DVD in optical drive, then reboot at press F10 for the BIOS setup. Change boot order and place "Optical Drive" as first choice. Then save settings and exit. It will take a few minutes until you are presented with the welcome menu, so patience.
  • Select correct time zone
  • Select sda hard drives for installation, and left sdb untouched.
  • Delete all partitions under sda by clicking in "select all", then click in "reclaim space".
  • In installation options, select "Custom partitioning".  In Partition scheme, select "Standard partition".
  • We will create the following standard partitions and the associated mount points, in this order: (1) /boot 2GB; (2) / 128GB; (3) /home 384GB; (4) swap 32GB; (5) /projects 408GB
  • Create a root password
  • Do not yet create a user since we will be installing "wsadduser" and "wspasswd" in order to add user 'jbq' to the machine later. Note that you will have to choose GNOME as default desktop or you will not be presented with the Graphical interface (KDE and other desktop environments require a user account in addition to a root account)
  • The screen goes blank for a long time during installation, be patient.
  • After 15 minutes I shaked the mouse and was presented with a screenshot including the time. I moved the mouse wheel and was presented with the installation screen, informing the installation had concluded.
  • Press the "Quit" button to close the install application. This leaves me in the desktop environment of the Live CD. In the right upper corner is the reboot buttom, which I press, then click in "Restart".
  • Press F10 to go the the BIOS setup menu, then change the boot order to restore "Hard Drive" as first option. Save settings and reboot.
  • The annoying welcome menu insists on adding a user account. Thus, I created account 'jmborr' and was logged in
  • Fedora 20 does not have a log out button! There's a fix. In a terminal (not as root or with sudo): gsettings set org.gnome.shell always-show-log-out true
  • I logged out from account 'jmborr' and logged in as root, and proceeded  to install wsadduser, wspasswd, and the WSCfengin.. See below for these configurations.
  • Update the system as root or with sudo with yum update, then reboot.

Install a version of a tool not available as RPM package in Fedora 20: Installing scipy 0.14.1

Fedora 20 repositories only have scipy up to 0.12 version, but I need to install scipy 0.14.1.
We need to create an RPM suitable for Fedora 20. For this, we have to build from the source RPM:
sudo rpmbuild --rebuild scipy-0.14.1-1.fc21.src.rpm
Notice that the source RPM was generated for Fedora 21, this is the reason we have to build a package for Fedora 20
The build process will create /root/rpmbuild/RPMS/x86_64/ directory containing the following files:
  • python3-scipy-0.14.1-1.fc20.x86_64.rpm
  • scipy-0.14.1-1.fc20.x86_64.rpm
  • scipy-debuginfo-0.14.1-1.fc20.x86_64.rpm

Upgrading to Fedora 22

Upgrade of the virtual Fedora 20 in the work laptop

A series of steps are required to bypass version 21. We use fedup package for the upgrade
sudo yum install fedup
sudo yum update
sudo shutdown -r now #make sure the update is applied
sudo yum remove rpmfusion-non-free-release # prevents an error when issuing fedup
sudo fedup --network 22 --product=workstation
After fedup finishes, a message prompts to reboot for the upgrade to start. Also, two packages complined of broken dependencies. They listed the required dependencies but it turns out they were already installed. Thus, I did not a thing and proceeded with the reboot:
sudo shutdown -r now
Afte the reboot I am welcomed with a plymouth reboot screen containing a progress bar. The completion time takes about one hour. After that I was prompted to login and everything seemed fine!
Subpages (1): vmware-player