How to install CUDA 7.0 on Ubuntu 14.04 LTS for nVidia Quadro K4200 & GT 610

It is not an easy task to install nVidia graphic card driver and CUDA toolkit on Ubuntu Linux system. The CUDA package is shipped with its driver, which seems to cause lots of trouble after replacing the default Linux driver. I installed the CUDA toolkit 7.0 by following nVidia’s official website. However, it ended up being an infinite login loop error. I struggled for almost two days to figure out how to do it nicely and properly. There are multiple tutorials and guidelines available on the internet. Still, most of them didn’t work for my case, and it caused me lots of trouble rebooting and reinstalling various packages and kernels. Finally, here is one solution for me. ps: I have a GT 610 for display, Quadro K4200 for CUDA computing.

 

0) Download relevant CUDA.run file: mine was: cuda_7.0.28_linux.run (cuda_7.5.18_linux.run has a hard time finding my kernel source file, I don’t know why)
Also, run:

$sudo apt-get remove --purge nvidia-* && apt-get autoremove
$sudo apt-get install build-essential

1) Start with the regular GUI and Ubuntu working with no login problems.
2) No need to create a xorg.conf file. If you have one, remove it (assuming you have a fresh OS install).

$sudo rm /etc/X11/xorg.conf

3) Create the /etc/modprobe.d/blacklist-nouveau.conf file with :

blacklist nouveau options nouveau modeset=0 

Then

$sudo update-initramfs -u

4) Reboot the computer. Nothing should have changed in the loading-up menu. You should be taken to the login screen. Once there, type: Ctrl + Alt + F1 and log in your user.
5) Go to the directory where you have the CUDA driver, and run

$chmod +x cuda_7.0.28_linux.run

7) Now, run

$sudo service lightdm stop

The top line is a necessary step for installing the driver. It turns off the X window and prevents driver conflicts.
8) Run the CUDA driver run file. Notice to turn OpenGL flags off when install (IMPORTANT):

$sudo bash cuda-7.0.28_linux.run --no-opengl-libs

9) During the install:
Accept EULA conditions
Say YES to installing the NVIDIA driver
Say YES to installing CUDA Toolkit + Driver
Say YES to installing CUDA Samples

10) Installation should be complete. Now check if device nodes are present:
Check if /dev/nvidia* files exist. If they don’t, do :

$sudo modprobe nvidia

11) Set Environment path variables:

$export PATH=/usr/local/cuda-7.0/bin:$PATH
$export LD_LIBRARY_PATH=/usr/local/cuda-7.0/lib64:$LD_LIBRARY_PATH

12) Verify the driver version:

$cat /proc/driver/nvidia/version

13) Check CUDA driver version:

$nvcc -V

[Optional] At this point, you can switch the lightdm back on again by doing:

$sudo service lightdm start

You should be able to log in to your session through the GUI without any problems or login-loops.
14) Create CUDA Samples. Go to your NVIDIA_CUDA-7.0_Samples folder and type

$make

15) Go to NVIDIA_CUDA-7.0_Samples/bin/x86_64/linux/release/ for the demos, and do the two standard checks:

$./deviceQuery

to see your graphics card specs and

$./bandwidthTest

to check if it is operating correctly.

Both tests should ultimately output a ‘PASS’ in your terminal.

16) Reboot. Everything should be ok.

Muscle Fiber Tractography

Diffusion-weighted MRI is a useful and powerful tool to investigate the structure and functions of muscle fibers. Below is an example to demonstrate the diffusion property map (Fractional Anisotropy FA and Mean Diffusivity MD) and the whole muscle volume fiber tractography (often referred to as Diffusion Tensor Tractography DTI) obtained from the upper thigh of a 29 years old healthy subject at 3T GE scanner.

Here is an excellent website introducing basic concepts and analysis methods for diffusion-weighted imaging and DTI (in the brain).

Diffusion-weighted MR images (spin-echo echo-planar imaging) and images of diffusion tensor properties of an axial section through the leg and its calculated muscle volume fiber tractography of 29 years old healthy subject. a, Non-weighted image (b = 0 sec/mm2). b, Fractional anisotropy map. c, Mean diffusivity (10-3 mm2/sec) map. d, muscle volume fiber tractography.