Debian GNU/Linux on a Lenovo Thinkpad P72

Debian GNU/Linux on a ThinkPad P72

Linux storage considerations

  • can use M.2 PCIe NVMe PCIe 3.0 x 4 SSD drive (recommend drive with 3000 MBps speed or higher)
  • consider putting swap partition on mechanical hard drive (with physical disk), not on solid-state drive (to reduce wear on SSD drive)
  • consider what filesystem to use for M.2 such as f2fs, btrfs, or ext4

non-free drivers

  • needed for wifi and possibly other devices
  • make sure non-free sources are used in /etc/apt/soures.list:
    deb https://deb.debian.org/debian/ sid main contrib non-free
  • make sure firmware-linux-nonfree package is installed

Graphics mode (for model with Nvidia GPU)

  • BIOS can be set to discreet or hybrid mode
  • discreet mode: always use Nvidia card. not usually recommended and will cause higher power usage.
  • hybrid mode: use integrated Intel graphics card as default, allow use of Nvidia card for specific tasks

Setup Xorg

  • more info: wiki.debian.org: Nvidia Graphics Drivers
  • run nvidia-detect utility. will recommend to install nvidia-driver package
  • install nvidia-driver package. should take care of everything. no need for further configuration.
  • however if using discreet mode use NVIDIA X Server Settings utility to tweak parameters and create an xorg config file

Sample xorg conf file (for use with discreet mode only)

  • conf file automatically generated by NVIDIA X Server Settings utility
  • save to /etc/X11/xorg.conf.d/20-nividia.conf
  • Xorg will not run if this conf file is used and BIOS is set to hybrid graphics mode
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 450.66

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "ViewSonic VX3211-2K"
    HorizSync       24.0 - 99.0
    VertRefresh     24.0 - 75.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "Quadro P5200 with Max-Q Design"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-4"
    Option         "metamodes" "DP-3: nvidia-auto-select +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Display (Monitor)

  • 17 inches with extremely high 3840×2160 resolution
  • recommend to set “Global scale” in KDE System Settings -> Display and Monitor -> Display Configuration to 2.2

Scaling individual apps

  • scale individual apps to make easier to use
  • normally not necessary when Global scale is set in KDE system settings
  • QT apps can be scaled with (example: scale kpat game to 1.3x):
    QT_SCALE_FACTOR=1.3 kpat
    
  • GTK apps can be scaled with (example: scale gnome-system-monitor to 1.4x):
    GDK_DPI_SCALE=1.4 gnome-system-monitor
    
  • to permanently scale application, copy its XDG desktop menu file to your local config (example for KDE Patience card game):
cp /usr/share/applications/org.kde.kpat.desktop ~/.local/share/applications

edit ~/.local/share/applications/org.kde.kpat.desktop and change the Exec line to include the QT scaling option:

Exec=QT_SCALE_FACTOR=1.6 kpat -qwindowtitle %c %u

then run kbuildsycoca5 to process the updated menu entry

Scale SDDM login screen

  • create /etc/sddm.conf.d/hidpi.conf
    [Wayland]
    EnableHiDPI=true
    
    [X11]
    EnableHiDPI=true
    

Scale GRUB boot menu

  • at GRUB prompt press ‘c’
  • type videoinfo and press enter
  • will list possible resolution values including the preferred mode
  • boot into Linux and edit /etc/default/grub
  • uncomment GRUB_GFXMODE= line and insert appropriate resolution (recommend 1024×768 if that is listed in videoinfo)
    GRUB_GFXMODE=1024x768
    
  • run sudo update-grub to process the change

Scale Firefox

  • go to about:config
  • change layout.css.devPixelsPerPx to high value like 2.2

Scale Thunderbird

  • Preferences -> Advanced -> Config Editor
  • change layout.css.devPixelsPerPx to high value like 2.2

Scale Atom text editor

  • install hidpi package
  • set Operating System Scale Factor to e.g. 1.4
  • set Hidpi Scale Factor to e.g. 1.7
  • resize the window for the settings to take effect

Scale Linux console (non-X)

  • switch to Linux console (Fn-Ctrl-Alt-F2)
  • run dpkg-reconfigure console setup
  • select default for first two options (press enter), for font select TerminusBold and choose 16×32 (framebuffer only)

Gamma and Color

  • internal 17 inch monitor is listed as “AUO LCD Monitor”
  • very high quality, 400 nits brightness
  • native color appears to be slightly red (common issue with many monitors and perfectly normal)
  • if using hybrid graphics mode adjust the color with xrandr, e.g.:
    xrandr --output eDP-1 --brightness 1.06 --gamma .86:1:1.05
    
  • if using discreet graphics mode set the brightness and gamma in the NVIDIA X Server Settings app, then load the settings at login:
    KDE System Settings -> Startup and Shutdown -> Autostart -> Add Program
    use name Apply Nvidia settings
    for command use /usr/bin/nvidia-settings --load-config-only
  • for hybrid graphics mode create your own custom Bash script that runs xrander with your desired color levels and add it to KDE autostart settings

Run app with Nvidia card (when in hybrid mode)

nrun() {
    __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia $@ &
}
  • then run app in Nvidia discreet graphics mode with nrun <app>

Benchmarks and fun

nrun Downloads/Benchmarks/Unigine_Superposition-1.1/Superposition
  • should run flawlessly with 4K Optimized preset
  • enjoy 4K movies (here is site with free 4K movies)

Comments

Leave a Reply