2018年11月20日星期二

Fix slow desktop (Debian)

Debian buster
GTX1070

Situation:
Desktop becomes very slow, especially open GUI software, like Chrome, LibreOffice, or even open gnome-terminal.

Info:
1. OpenGL renderer is llvmpipe

ping@Workstation:~$ glxinfo|grep render
direct rendering: Yes
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
    GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, GLX_MESA_query_renderer,
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: llvmpipe (LLVM 6.0, 256 bits)
    GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth,
    GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_packed_depth_stencil,
    GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth,
    GL_NV_blend_square, GL_NV_conditional_render, GL_NV_depth_clamp,
    GL_OES_element_index_uint, GL_OES_fbo_render_mipmap,

2. gnome-shell didn't use GPU

ping@Workstation:~$ nvidia-smi
Tue Nov 20 15:46:17 2018     
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.87                 Driver Version: 390.87                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|==================+=============+==============|
|   0  GeForce GTX 1070    Off  | 00000000:04:00.0  On |                  N/A |
|  4%   53C    P5    13W / 151W |    212MiB /  8119MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                             
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|==============================================|
|    0       973      G   /usr/lib/xorg/Xorg                           210MiB |
+-----------------------------------------------------------------------------+

3. glx module failure

ping@Workstation:/var/log$ grep GLX Xorg.0.log
[    23.121] (EE) NVIDIA(0): Failed to initialize the GLX module; please check in your X
[    23.121] (EE) NVIDIA(0):     log file that the GLX module has been loaded in your X
[    23.121] (EE) NVIDIA(0):     server, and that the module is the NVIDIA GLX module.  If
[    24.457] (II) Initializing extension GLX
[    24.458] (II) AIGLX: Screen 0 is not DRI2 capable
[    28.654] (II) IGLX: Loaded and initialized swrast
[    28.654] (II) GLX: Initialized DRISWRAST GL provider for screen 0
[    28.654] (II) Initializing extension NV-GLX

Fix:

sudo mv /usr/lib/xorg/modules/extensions/libglx.so /usr/lib/xorg/modules/extensions/libglx.so.bak
sudo cp /usr/lib/nvidia/current/libglx.so /usr/lib/xorg/modules/extensions/libglx.so

Then reboot or not (sometimes).
Everything works fine.

ping@Workstation:/usr/lib/nvidia/current$ nvidia-smi
Tue Nov 20 15:56:18 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.87                 Driver Version: 390.87                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|==================+=============+==============|
|   0  GeForce GTX 1070    Off  | 00000000:04:00.0  On |                  N/A |
|  9%   55C    P0    37W / 151W |    610MiB /  8119MiB |      2%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|===============================================|
|    0     20557      G   /usr/lib/xorg/Xorg                           321MiB |
|    0     20826      G   /usr/bin/gnome-shell                         194MiB |
|    0     21626      G   ...-token=D1DF891562F13F5619FAC52DC5AEB5AE    90MiB |
+-----------------------------------------------------------------------------+



Reference:
https://wiki.debian.org/Mesa
https://devtalk.nvidia.com/default/topic/830711/linux/failed-to-initialize-the-glx-module-please-check-in-your-x-log-file-that-the-glx-module-has-been-lo/

2017年6月28日星期三

Build iqtree 1.6.4 on sccas

1. Upload Eigen3 and iqtree 1.6.4 source code to sccas

2. module load cmake 3.0, icc 2015, gcc 4.9.2. 

3. Compile Eigen3

3.1 Unzip compressed file, then 

cd Eigen3
mkdir build
cd build
cmake -DCMAKE_C_COMPILER=/soft/compiler/intel/parallel_studio_xe_2015/composer_xe_2015.0.090/bin/intel64/icc -DCMAKE_CXX_COMPILER=/soft/compiler/intel/parallel_studio_xe_2015/composer_xe_2015.0.090/bin/intel64/icpc -DCMAKE_INSTALL_PREFIX=/home/user/lib .. 
Note that here cmake could not recognize icc so I have to write absolute path in here, and make sure you set correct PREFIX which you have permission to write. It is recommended to use clang instead of gcc/g++ because of higher performance.

3.2 

make install

4. Compile iqtree

4.1 Unzip compressed file, then

cd iqtree;
mkdir build
cd build
cmake -DIQTREE_FLAGS=omp -DCMAKE_C_COMPILER=/soft/compiler/gnu/4.9.2/bin/gcc -DCMAKE_CXX_COMPILER=/soft/compiler/gnu/4.9.2/bin/g++ -DEIGEN3_INCLUDE_DIR=/home/usr/lib/include/eigen3 ..
Here "omp" meas use openMP to utilize multiple CPU cores. Use absolute path of compiler if necessary. Then, you must write correct eigen3 path.
4.2
make
 Add "-j10" if you have multiple cores. 

4.3 You will get target file "iqtree" in present folder.

5. If you found error like

iqtree: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by iqtree)
iqtree: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by iqtree)
iqtree: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by iqtree)
    Then you need to edit LD_LIBRARY_PATH to include newer libstdc++.so. For this example, I edit ~/.bashrc like this
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/usr/.local/lib:/soft/compiler/gnu/4.9.2/lib64

2017年5月5日星期五

Build phylobayes-mpi

1. Clone

> git clone https://github.com/bayesiancook/pbmpi

2. Install dependence. For Debian stretch:

> sudo apt install openmpi-bin openmpi-commin libopenmpi-dev libopenmpi2

3. Edit LD_LIBRARY_PATH if needed to contain openmpi lib path

4. cd sources;make

Then it shows

In file included from AACodonMutSelProfileProcess.h:20:0,
                 from AACodonMutSelSBDPProfileProcess.h:21,
                 from AACodonMutSelSBDPSubstitutionProcess.h:20,
                 from AACodonMutSelSBDPPhyloProcess.h:20,
                 from Model.h:23,
                 from PB.cpp:17:
CodonSubMatrix.h:70:33: error: 'constexpr' needed for in-class initialization of static data member 'const double AAMutSelProfileSubMatrix::TOOSMALL' of non-integral type [-fpermissive]
  static const double TOOSMALL = 1e-30;
                                 ^~~~~
CodonSubMatrix.h:71:33: error: 'constexpr' needed for in-class initialization of static data member 'const double AAMutSelProfileSubMatrix::TOOLARGE' of non-integral type [-fpermissive]
  static const double TOOLARGE = 500;
                                 ^~~
CodonSubMatrix.h:72:42: error: 'constexpr' needed for in-class initialization of static data member 'const double AAMutSelProfileSubMatrix::TOOLARGENEGATIVE' of non-integral type [-fpermissive]
  static const double TOOLARGENEGATIVE = -500;
                                          ^~~
CodonSubMatrix.h:99:33: error: 'constexpr' needed for in-class initialization of static data member 'const double AACodonMutSelProfileSubMatrix::TOOSMALL' of non-integral type [-fpermissive]
  static const double TOOSMALL = 1e-30;
                                 ^~~~~
CodonSubMatrix.h:100:33: error: 'constexpr' needed for in-class initialization of static data member 'const double AACodonMutSelProfileSubMatrix::TOOLARGE' of non-integral type [-fpermissive]
  static const double TOOLARGE = 500;
                                 ^~~
CodonSubMatrix.h:101:42: error: 'constexpr' needed for in-class initialization of static data member 'const double AACodonMutSelProfileSubMatrix::TOOLARGENEGATIVE' of non-integral type [-fpermissive]
  static const double TOOLARGENEGATIVE = -50;
                                          ^~
CodonSubMatrix.h:122:33: error: 'constexpr' needed for in-class initialization of static data member 'const double CodonMutSelProfileSubMatrix::TOOSMALL' of non-integral type [-fpermissive]
  static const double TOOSMALL = 1e-30;
                                 ^~~~~
CodonSubMatrix.h:123:33: error: 'constexpr' needed for in-class initialization of static data member 'const double CodonMutSelProfileSubMatrix::TOOLARGE' of non-integral type [-fpermissive]
  static const double TOOLARGE = 500;
                                 ^~~
CodonSubMatrix.h:124:42: error: 'constexpr' needed for in-class initialization of static data member 'const double CodonMutSelProfileSubMatrix::TOOLARGENEGATIVE' of non-integral type [-fpermissive]
  static const double TOOLARGENEGATIVE = -50;
                                          ^~
Makefile:55: recipe for target 'PB.o' failed
make: *** [PB.o] Error 1

Edit Makefile:

add "-fpermissive" into CPPFLAGS.

Rebuild.

Finished.


2017年4月6日星期四

build beagle-lib

Debian stretch x86_64, nvidia-driver was already installed.

When build beagle-lib, says g++ version was not correct, and nvcc also said something wrong.

Fix:

Install cuda-toolkit-8.0, see https://devtalk.nvidia.com/default/topic/983777/can-t-locate-installutils-pm-in-inc/

Use -override to ignore different version of gcc

Now,

./autogen.sh

./configure --with-cuda=/usr/local/cuda-8.0

cd beagle-lib/libhmsbeagle/GPU/kernels

Edit Makefile, replace

NVCC = /usr/local/cuda-8.0/bin/nvcc

by

NVCC = /usr/local/cuda-8.0/bin/nvcc -ccbin clang-3.8

Now you can build and succesfully install.

beagle-lib

After fixed beast2-mcmc problem, now beagle was installed correctly, but when I use
> beast2-mcmc -beagle_GPU -instances 10 -threads 10 data.xml
It used CPU instead of GPU and shows:
> Failed to load BEAGLE library: no hmsbeagle-jni in java.library.path
Fix:
> sudo ln -s /usr/lib/x86_64-linux-gnu/jni/libhmsbeagle-jni.so /usr/share/beast-mcmc2/libhmsbeagle-jni.so