mathjax + gtag

Pages

Showing posts with label OpenSuSE. Show all posts
Showing posts with label OpenSuSE. Show all posts

Monday, October 24, 2016

Why is ssh slow to connect?

Introduction

There are several reasons why ssh may be getting slow to connect. I'll cover here the ones that happened to me.


On the server side

  1. Make sure you have a line "UseDNS no" uncommented.
  2. Make sure you have "good" (i.e., reachable) DNS servers in /etc/resolv.conf.
  3. Make sure you have no reverse DNS lines in /etc/hosts.deny.
The server side configuration is typically in the file /etc/ssh/sshd_config. Every time you make a change to this file, remember to restart the ssh daemon ("# systemctl restart sshd").

    Item number 3 deserves some comments, since it was the hardest to get right. Denyhosts may be adding lines like  "xxx-xxx-xxx-xxx.rev.abxtelex.eu" that will trigger reverse DNS even if you have "UseDNS no" in the configuration file. You have to remove these lines, but if you have Denyhosts installed, maybe you already know how hard it is to remove entries from this file, since they keep reappearing. If you use OpenSUSE, you have a script called "/usr/sbin/dh_reenable" that will do the trick for you. If you are not using OpenSUSE or have installed Denyhosts by hand, then you have to do it manually, take a look at the Denyhosts FAQ here.

    I still don't have a good solution to problem number 3, the best thing would be that Denyhosts did not add reverse DNS entries in /etc/resolv.conf, but I did not find a way to configure it to behave like that.


    On the client side

    The global client side configuration is typically in the file /etc/ssh/ssh_config. But you can configure things on a user level by editing the file ~/.ssh/config.

    I use the local configuration file like this:

    Host *
    Compression yes
    ForwardX11=yes
    ForwardX11Trusted=yes
    GSSAPIAuthentication=no

    Host analise
    HostName 192.168.1.1

    Host home
    Hostname xxxx.noip.me


    That way I can just type "ssh analise" or "ssh home". In the "home" case, it has the advantage of making my dynamic dns name shorter.


    1. Make sure you have the line "GSSAPIAuthentication=no".

    Monday, August 1, 2016

    OpenSUSE Leap 42.1 and nvidia kernel driver

    The symptoms

    Nvidia kernel drivers were not loaded after kernel update.

    The problem

    The package nvidia-gfxG04-kmp-default-367.35_k4.1.12_1-25.1.x86_64 runs a script that regenerates the kernel drivers and creates symlinks in /lib/modules/4.1.27-27-default/weak-updates/updates. After running:

    # zypper in --force $(rpm -qa "nvidia-gfx*kmp*")

    I noticed that the links were not beeing generated:

    # zypper in --force $(rpm -qa "nvidia-gfx*kmp*")
    Retrieving repository 'network:utilities' metadata ..........................................................................................................[done]
    Building repository 'network:utilities' cache ...............................................................................................................[done]
    Loading repository data...
    Reading installed packages...
    Forcing installation of 'nvidia-gfxG04-kmp-default-367.35_k4.1.12_1-25.1.x86_64' from repository 'nVidia Graphics Drivers'.
    Resolving package dependencies...

    The following package is going to be reinstalled:
      nvidia-gfxG04-kmp-default

    1 package to reinstall.
    Overall download size: 5.8 MiB. Already cached: 0 B. No additional space will be used or freed after the operation.
    Continue? [y/n/? shows all options] (y): 
    Retrieving package nvidia-gfxG04-kmp-default-367.35_k4.1.12_1-25.1.x86_64                                                     (1/1),   5.8 MiB ( 64.6 MiB unpacked)
    Retrieving: nvidia-gfxG04-kmp-default-367.35_k4.1.12_1-25.1.x86_64.rpm ..........................................................................[done (2.2 MiB/s)]
    Checking for file conflicts: ................................................................................................................................[done]
    (1/1) Installing: nvidia-gfxG04-kmp-default-367.35_k4.1.12_1-25.1.x86_64 ....................................................................................[done]
    Additional rpm output:
    make: Entering directory '/usr/src/linux-4.1.27-27-obj/x86_64/default'
      Building modules, stage 2.
      MODPOST 0 modules
    make: Leaving directory '/usr/src/linux-4.1.27-27-obj/x86_64/default'
    /usr/src/kernel-modules/nvidia-367.35-default /
    make "CC=cc" KBUILD_OUTPUT=/usr/src/linux-obj/x86_64/default KBUILD_VERBOSE= -C /lib/modules/4.1.27-27-default/source M=/usr/src/kernel-modules/nvidia-367.35-default ARCH=x86_64 NV_KERNEL_SOURCES=/lib/modules/4.1.27-27-default/source NV_KERNEL_OUTPUT=/usr/src/linux-obj/x86_64/default NV_KERNEL_MODULES="nvidia nvidia-uvm nvidia-modeset nvidia-drm" INSTALL_MOD_DIR=kernel/drivers/video modules
    make[1]: Entering directory '/usr/src/linux-4.1.27-27'
    make[2]: Entering directory '/usr/src/linux-4.1.27-27-obj/x86_64/default'
      Building modules, stage 2.
      MODPOST 4 modules
    make[2]: Leaving directory '/usr/src/linux-4.1.27-27-obj/x86_64/default'
    make[1]: Leaving directory '/usr/src/linux-4.1.27-27'
    ld -T /lib/modules/4.1.27-27-default/source/scripts/module-common.lds -r -o nv-linux.o \
      nvidia.mod.o nvidia/nv-interface.o
    /

    Modprobe blacklist files have been created at /etc/modprobe.d to prevent Nouveau from loading. This can be reverted by deleting /etc/modprobe.d/nvidia-*.conf.

    *** Reboot your computer and verify that the NVIDIA graphics driver can be loaded. ***

    depmod: WARNING: //lib/modules/4.1.27-27-default/misc/vboxvideo.ko disagrees about version of symbol VBoxGuest_RTLogBackdoorPrintf
    depmod: WARNING: //lib/modules/4.1.27-27-default/misc/vboxvideo.ko disagrees about version of symbol VBoxGuest_RTErrConvertToErrno
    depmod: WARNING: //lib/modules/4.1.27-27-default/misc/vboxvideo.ko disagrees about version of symbol VBoxGuest_RTAssertShouldPanic
    depmod: WARNING: //lib/modules/4.1.27-27-default/misc/vboxvideo.ko disagrees about version of symbol VBoxGuest_RTAssertMsg1Weak
    depmod: WARNING: //lib/modules/4.1.27-27-default/misc/vboxvideo.ko disagrees about version of symbol VBoxGuest_RTAssertMsg2Weak
    Warning: /lib/modules/4.1.27-27-default is inconsistent
    Warning: weak-updates symlinks might not be created


    Output of nvidia-gfxG04-kmp-default-367.35_k4.1.12_1-25.1.x86_64.rpm %posttrans script:
        Creating initrd: /boot/initrd-4.1.12-1-default
        Executing: /usr/bin/dracut --logfile /var/log/YaST2/mkinitrd.log --force --force-drivers "nvidia   -drm" /boot/initrd-4.1.12-1-default 4.1.12-1-default
        *** Including module: bash ***
        *** Including module: warpclock ***
        *** Including module: i18n ***
        *** Including module: ifcfg ***
        *** Including module: drm ***
        *** Including module: plymouth ***
        *** Including module: kernel-modules ***
        Omitting driver i2o_scsi
        *** Including module: resume ***
        *** Including module: rootfs-block ***
        *** Including module: terminfo ***
        *** Including module: udev-rules ***
        Skipping udev rule: 91-permissions.rules
        Skipping udev rule: 80-drivers-modprobe.rules
        *** Including module: haveged ***
        *** Including module: systemd ***
        *** Including module: usrmount ***
        *** Including module: base ***
        *** Including module: fs-lib ***
        *** Including module: shutdown ***
        *** Including module: suse ***
        *** Including modules done ***
        *** Installing kernel module dependencies and firmware ***
        *** Installing kernel module dependencies and firmware done ***
        *** Resolving executable dependencies ***
        *** Resolving executable dependencies done***
        *** Hardlinking files ***
        *** Hardlinking files done ***
        *** Stripping files ***
        *** Stripping files done ***
        *** Generating early-microcode cpio image ***
        *** Constructing GenuineIntel.bin ****
        *** Store current command line parameters ***
        Stored kernel commandline:
        rd.driver.pre=nvidia
        rd.driver.pre=_drm
         resume=UUID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        root=UUID=xxxxxxxxxxxxxxxxxxxxxx rootflags=rw,relatime,data=ordered rootfstype=ext4
        *** Creating image file ***
        *** Creating image file done ***
        Some kernel modules could not be included
        This is not necessarily an error:
        swap
        _drm
        Update bootloader...
        Creating initrd: /boot/initrd-4.1.27-24-default
        Executing: /usr/bin/dracut --logfile /var/log/YaST2/mkinitrd.log --force --force-drivers "nvidia   -drm" /boot/initrd-4.1.27-24-default 4.1.27-24-default
        *** Including module: bash ***
        *** Including module: warpclock ***
        *** Including module: i18n ***
        *** Including module: ifcfg ***
        *** Including module: drm ***
        *** Including module: plymouth ***
        *** Including module: kernel-modules ***
        Omitting driver i2o_scsi
        *** Including module: resume ***
        *** Including module: rootfs-block ***
        *** Including module: terminfo ***
        *** Including module: udev-rules ***
        Skipping udev rule: 91-permissions.rules
        Skipping udev rule: 80-drivers-modprobe.rules
        *** Including module: haveged ***
        *** Including module: systemd ***
        *** Including module: usrmount ***
        *** Including module: base ***
        *** Including module: fs-lib ***
        *** Including module: shutdown ***
        *** Including module: suse ***
        *** Including modules done ***
        *** Installing kernel module dependencies and firmware ***
        *** Installing kernel module dependencies and firmware done ***
        *** Resolving executable dependencies ***
        *** Resolving executable dependencies done***
        *** Hardlinking files ***
        *** Hardlinking files done ***
        *** Stripping files ***
        *** Stripping files done ***
        *** Generating early-microcode cpio image ***
        *** Constructing GenuineIntel.bin ****
        *** Store current command line parameters ***
        Stored kernel commandline:
        rd.driver.pre=nvidia
        rd.driver.pre=_drm
         resume=UUID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        root=UUID=xxxxxxxxxxxxxxxxxxxxxxx rootflags=rw,relatime,data=ordered rootfstype=ext4
        *** Creating image file ***
        *** Creating image file done ***
        Some kernel modules could not be included
        This is not necessarily an error:
        swap
        _drm
        Update bootloader...

    The solution

    Uninstall the virtualbox guest packages: virtualbox-guest-kmp-default, virtualbox-guest-tools and virtualbox-guest-x11 and rerun # zypper in --force $(rpm -qa "nvidia-gfx*kmp*") as root. After that, the links are created as follows:

    /lib/modules/4.1.27-27-default/weak-updates/updates # l
    total 8
    drwxr-xr-x 2 root root 4096 Aug  1 15:41 ./
    drwxr-xr-x 4 root root 4096 Jul 21 19:03 ../
    lrwxrwxrwx 1 root root   51 Aug  1 15:41 nvidia-drm.ko -> /lib/modules/4.1.12-1-default/updates/nvidia-drm.ko
    lrwxrwxrwx 1 root root   55 Aug  1 15:41 nvidia-modeset.ko -> /lib/modules/4.1.12-1-default/updates/nvidia-modeset.ko
    lrwxrwxrwx 1 root root   51 Aug  1 15:41 nvidia-uvm.ko -> /lib/modules/4.1.12-1-default/updates/nvidia-uvm.ko
    lrwxrwxrwx 1 root root   47 Aug  1 15:41 nvidia.ko -> /lib/modules/4.1.12-1-default/updates/nvidia.ko

    Thursday, October 16, 2014

    Cuda 6.5 on OpenSuSE 12.3

    NVidia Drivers

    Make sure you have the official NVidia drivers installed in your system:
    • Run Yast.
    • Click in "Software Repositories"
    • Click in "Add"
    • Choose "Specify URL", then "Next"
    • Repository Name: "nvidia", URL: http://download.nvidia.com/opensuse/12.3/
    • Confirm
    • Go back to Yast
    • Click in "Software Management"
    • Search for "nvidia"
    • Add the following packages: 
    1. x11-video-nvidiaG03-340.46-30.1.x86_64
    2. nvidia-gfxG03-kmp-desktop-340.46_k3.7.10_1.1-30.1.x86_64
    3. nvidia-computeG03-340.46-30.1.x86_64
    4. nvidia-settings-325.15-1.3.x86_64
    5. nvidia-glG03-340.46-30.1.x86_64
    6. nvidia-texture-tools-2.0.6-36.2.x86_64
    7. nvidia-uvm-gfxG03-kmp-desktop-340.46_k3.7.10_1.1-30.1.x86_64
    Notice that the above assumes your board is supported by the G03 kernel driver and that you are using the "kernel-desktop". Make sure you choose the proper driver for your board and the kernel driver corresponding to your kernel.

    CUDA Installation

    Install the CUDA repository. Although the repository is for OpenSuSE 13.1, it will work perfectly with 12.3.
    • Click in "Add"
    • Choose "Specify URL", then "Next"
    • Repository Name: "cuda", URL: http://developer.download.nvidia.com/compute/cuda/repos/opensuse131/x86_64
    • Confirm
    • Go back to Yast
    • Click in "Software Management"
    • Search for "cuda"
    • Add the following packages (some of them will be automatically added): 
    1. cuda-documentation-6-5-6.5-14.x86_64
    2. cuda-cudart-6-5-6.5-14.x86_64
    3. cuda-cufft-dev-6-5-6.5-14.x86_64
    4. cuda-repo-opensuse131-6.5-14.x86_64
    5. cuda-visual-tools-6-5-6.5-14.x86_64
    6. cuda-cufft-6-5-6.5-14.x86_64
    7. cuda-npp-dev-6-5-6.5-14.x86_64
    8. cuda-curand-dev-6-5-6.5-14.x86_64
    9. cuda-license-6-5-6.5-14.x86_64
    10. cuda-runtime-6-5-6.5-14.x86_64
    11. cuda-misc-headers-6-5-6.5-14.x86_64
    12. cuda-samples-6-5-6.5-14.x86_64
    13. cuda-curand-6-5-6.5-14.x86_64
    14. cuda-toolkit-6-5-6.5-14.x86_64
    15. cuda-cublas-6-5-6.5-14.x86_64
    16. cuda-cusparse-dev-6-5-6.5-14.x86_64
    17. cuda-drivers-340.29-0.x86_64
    18. cuda-cudart-dev-6-5-6.5-14.x86_64
    19. cuda-npp-6-5-6.5-14.x86_64
    20. cuda-command-line-tools-6-5-6.5-14.x86_64
    21. cuda-cusparse-6-5-6.5-14.x86_64
    22. cuda-6.5-14.x86_64
    23. cuda-core-6-5-6.5-14.x86_64
    24. cuda-cublas-dev-6-5-6.5-14.x86_64
    25. cuda-driver-dev-6-5-6.5-14.x86_64
    26. cuda-6-5-6.5-14.x86_64
    • Click "Accept".

    Testing





    Usefull Links