/images/avatar.png

Ubuntu配置VNCServer,一定能用,不白屏灰屏

  • 安装基础软件

    1
    2
    3
    4
    5
    6
    7
    8
    
    sudo apt update
    sudo apt-get upgrade
    sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
    sudo apt install tightvncserver
    vncserver
    
    注: 在防火墙上打开 VNC Server 的监听端口
    VNC Server 用到了三个端口:5801(*)、5901(*)、6001
    
  • 修改~/.vnc/xstartup

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    
    #!/bin/bash
    export $(dbus-launch)
    export XKL_XMODMAP_DISABLE=1
    export XDG_CURRENT_DESKTOP="GNOME-Flashback:Unity"
    export XDG_MENU_PREFIX="gnome-flashback-"
    unset SESSION_MANAGER
    
    gnome-panel &
    gnome-settings-daemon &
    metacity &
    nautilus &
    gnome-terminal &
    
    # [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    # [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    
    autocutsel -fork
    xrdb $HOME/.Xresources
    xsetroot -solid grey
    vncconfig -iconic &
    x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    gnome-session --session=gnome-flashback-metacity --disable-acceleration-check --debug &
    
  • 启动

CUDA unknown error - this may be due to an incorrectly set up environment

Problem description

1
2
3
4
5
6
>>> torch.cuda.is_available()                                                     
/home/python3.8/site-packages/torch/cuda/__init__.py:141: UserWarning: CUDA initialization: CUDA unknown error - this may be due to an
 incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES after program start. Setting the available devices to be zero. (Triggered internally at /opt/con
da/conda-bld/pytorch_1708025845899/work/c10/cuda/CUDAFunctions.cpp:108.)   return torch._C._cuda_getDeviceCount() > 0                        

False         

But both nvcc - V and nvidia-smi still work

Solution

1
2
sudo rmmod nvidia_uvm
sudo modprobe nvidia_uvm

ubuntu 18.04 升级至 glibc_2.28

近期在ubuntu 18.04上开发PyQt6前段时发现问题:

ubuntu 18.04.6 默认的 glibc 版本位 2.27, 在运行最新的 Qt Creator 6.0.2 时会报错

1
$ /opt/Qt/Tools/QtCreator/bin/qtcreator

报错

1
/opt/Qt/Tools/QtCreator/bin/qtcreator: /lib/x86_64-linux-gnu/libc.so.6: version `glibc_2.28' not found

此时最佳方法是升级到 ubuntu 20.04 或 ubuntu 22.04, 还有一种"比较省心"的方法, 保留系统仅升级 glibc

下载 https://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.xz

准备编译环境

1
$ sudo apt install build-essential gawk bison

然后解压和编译

1
2
3
4
5
6
$ tar -xJf glibc-2.28.tar.xz
$ cd glibc-2.28/
$ mkdir build
$ cd build
$ ../configure --prefix=/usr
$ make

到这一步后不要 sudo make install 立刻安装到 /usr

How to Install and Configure VNC on Ubuntu 20.04

Introduction

Virtual Network Computing, or VNC, is a connection system that allows you to use your keyboard and mouse to interact with a graphical desktop environment on a remote server. It makes managing files, software, and settings on a remote server easier for users who are not yet comfortable with the command line.

In this guide, you’ll set up a VNC server with TightVNC on an Ubuntu 20.04 server and connect to it securely through an SSH tunnel. Then, you’ll use a VNC client program on your local machine to interact with your server through a graphical desktop environment.

生物信息领域牛刊修仙版

在知乎上看到生物信息学领域的牛刊投稿顺序,发现一个很有趣的回答,于是转载一下作为参考:

凡人期:这是修仙之路的起点,指的是还未开始修炼或刚刚接触修炼之道的普通研究生。

arXiv,bioRxiv

练气期:这是修仙的基础阶段,研究生修行者开始吸收天地灵气,将其转化为体内的元力。

BMC genomics,BMC bioinformatics,BMC biology,BMC medical genomics

筑基期:这是研究生修仙之路的起点,修行者开始修炼内功,累积内力,打下坚实的基础。

Bioinformatics,PLoS computational biology,PLoS genetics,Briefings in bioinformatics,BMC medicine

金丹期:修行者的内力能够凝聚成金丹,这个金丹象征着高级别的修为和力量。

Nucleic Acids Research,eBiomedicine,Advanced Science,PLoS Biology

元婴期:修行者的金丹形成元婴,元婴是修行者灵魂和修为的化身,跨入更高的境界。

Genome Biology,Genome Medicine,Genome Research,Molecular Systems Biology,Cell systems

化神期:修行者的元婴进一步成长,开始向神灵的境界转变。

Nature Communications,PNAS,Science Advances,Cell Reports

合体期:修行者的身体和灵魂开始与周围的世界融合,接近于自然(Nature)的本源。

Nature Machine Intelligence,Nature Computational Sciences

大乘期:修行者几乎达到了仙道的巅峰,具备了创造或改变世界的能力。

Nature Genetics,Nature Biotechnology,Nature Methods,Nature Medicine,Cell Genomics

飞升期:修行者完成了修仙之路,失去凡体,飞升仙界,无相无形,成为自然(Nature)。

Nature,Science,Cell

Acknowledgement:

作者:浪矢Ryan 链接:https://www.zhihu.com/question/21660698/answer/3310893434 来源:知乎

docker拉取镜像修改打包教程

近期因为工作需求和提高用户友好度的考量需要对软件进行Docker打包,于是总结以下简易流程。

  1. 拉取镜像,如果需要预先配置好CUDA等,可以搜索对应镜像:

    1
    
    docker pull nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04
    
  2. 进入镜像,修改软件配置环境等:

    1
    2
    
    docker run --gpus all -it nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04 /bin/bash
    apt-get update && apt-get install -y wget nano vim curl less
    
  3. 安装Conda环境以及其它需要的软件

    1
    2
    
    curl -O https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh
    bash Anaconda3-2023.09-0-Linux-x86_64.sh
    
  4. 新建repository

    https://hub.docker.com/repository/

  5. 用docker commit从容器打包镜像
    1
    2
    
    sudo docker ps -a
    sudo docker commit -m "AutoBA" -a "juexiao_zhou (www.joshuachou.ink)" 12748b01449a joshuachou666/autoba:cuda12.2.2-cudnn8-devel-ubuntu22.04-autoba0.0.3
    

    然后docker images就能在本地找到打包好的镜像

  6. 上传镜像

    1
    2
    3
    4
    5
    
    # sudo docker login --username=用户名
    sudo docker login --username=admin
    
    # sudo docker push 镜像tag
    sudo docker push joshuachou666/autoba:cuda12.2.2-cudnn8-devel-ubuntu22.04-autoba0.0.3
    
  7. 重新拉取镜像测试