화면 찢어짐 Nvidia/Intel

화면 찢어짐 Nvidia/Intel

방금 노트북(GTX 960M / I7-6700HQ - Intel HD530)에 Ubuntu를 설치했는데 nvidia 드라이버를 다시 설치할 때까지 잠금 화면을 통과할 수 없었습니다(드라이버 370이 설치되었고 방금 ubuntu-drivers 자동 설치를 사용했습니다).

nvidia 드라이버를 설치한 후 내 시스템은 이제 작동하지만 창을 이리저리 움직일 때에도 화면이 찢어지는 현상이 심하고 웹 페이지를 스크롤할 때 상황이 더욱 악화됩니다.

지금까지 시도한 것:

  • NVidia XServer 설정에서 사용할 GPU 변경
  • xorg.confIntel 장치에 대해 "TearFree" "true" 추가

또 무엇을 시도할 수 있나요?

답변1

Intel과 NVIDIA의 비디오 카드 사이를 전환하는 스크립트를 코딩했습니다. 이들 사이를 전환하는 것 외에도 INTEL 비디오 카드를 사용할 때 비디오/화면 잘림 현상을 수정합니다. NVIDIA 비디오 카드에 아직까지 해결책을 찾지 못한 비디오/화면 찢어짐 문제가 계속 표시됩니다.
GitHub의 스크립트는 다음과 같습니다.

#!/bin/bash
# -------------------------------------------------------
# A shell script that fixes screen tearing on intel video cards and switches between nvidia and intel graphic cards
# Written by: Bruno Assis
# Created on: 25/03/2017
# -------------------------------------------------------

#asks for sudo if the user uid != 0 then calls the script again with the current user name
(( EUID != 0 )) && exec sudo -- "$0" "$@$USER"

#-----------------
#----Settings-----
#-----------------

PREVIOUS_USER=$1
SCRIPT_NAME="20-intel.conf"
CONF_BASE_PATH="/etc/X11/"
CONF_BASE_DIR="xorg.conf.d"
CONF_PATH="/etc/X11/$CONF_BASE_DIR/"
CONF_FILE_PATH="$CONF_PATH$SCRIPT_NAME"
CURRENT_VIDEO_CARD=""

#-----------------
#----Functions----
#-----------------

#creates the config file.
function CreateTearingFreeFile {
    echo 'Section "Device"' >> $1
    echo '   Identifier  "Intel Graphics"' >> $1
    echo '   Driver      "intel"' >> $1
    echo '   Option      "TearFree"    "true"' >> $1
    echo "EndSection" >> $1
}

#switches the environment to use nvidia graphics card
function SwitchToNvdia {
    echo -e "\n Switching to nvidia."
    rm $CONF_FILE_PATH
    prime-select nvidia
}

#switches the environment to use intel's graphics card
function SwitchToIntel {
    echo -e "\n Switching to Intel."
    cd $CONF_PATH
    CreateTearingFreeFile $SCRIPT_NAME
    prime-select intel
}

function LogoutFromCurrentSession {
    echo -e "\n You'll need to logout in order to changes take effect."
    echo -e "\n Do you wish to logout now? (y | n)" 
    read -n 1 option
    if [[ "$option" = "y" || "$option" = "Y" ]]; then
        #log out from the current session for the current user
        su -c "kill -9 -1" "$PREVIOUS_USER"
    fi
}

function SetupEnvironment {

    if [ ! -d "$CONF_BASE_PATH" ]; then 
        echo -e "\n error: could not find $CONF_BASE_PATH."
        exit 1
    else
        if [ ! -d "$CONF_PATH" ]; then 
            echo -e "\n could not find $CONF_BASE_DIR."
            echo -e "\n trying to create it."
            cd $CONF_BASE_PATH
            mkdir $CONF_BASE_DIR
            if [ ! -d "$CONF_PATH" ]; then
                echo -e "\n could not create $CONF_BASE_DIR folder."
                exit 1
            else
                echo -e "\n $CONF_BASE_DIR folder created successfully."
            fi
        fi
    fi
}

function CheckForCurrentVideoCardInUse {
    local _VIDEO_CARD=`glxinfo|egrep "OpenGL vendor|OpenGL renderer*"`
    if [[ $_VIDEO_CARD == *"NVIDIA"* && $_VIDEO_CARD == *"GeForce"* ]]; then
        CURRENT_VIDEO_CARD="NVIDIA"
    elif [[ $_VIDEO_CARD == *"Intel"* && $_VIDEO_CARD == *"Intel"* ]]; then
        CURRENT_VIDEO_CARD="INTEL"
    else
        ErrorHandler
    fi
}

function ErrorHandler {
        echo -e "\n Could not find your video card"
        echo -e "\n Please use glxinfo to check if the name is correct or if you are using NVIDIA's or Intel's card"
        exit 1
}

#------------------
#--Program Flow ---
#------------------

#Setups the environment if it hasn't already been set.

CheckForCurrentVideoCardInUse
SetupEnvironment

echo -e " current video card in use: $CURRENT_VIDEO_CARD"

#If the file exists then we should delete it and start nvidia

if [ $CURRENT_VIDEO_CARD == "INTEL" ]; then
    echo -e "\n Switch graphics card to NVIDIA? (y | n)"
    read -n 1 option
    if [[ "$option" == "y" || "$option" == "Y" ]]; then
        SwitchToNvdia
        LogoutFromCurrentSession
    fi
elif [ $CURRENT_VIDEO_CARD == "NVIDIA" ]; then
    echo -e "\n Switch graphics card to INTEL? (y | n)"
    read -n 1 option
    if [[ "$option" == "y" || "$option" == "Y" ]]; then
        SwitchToIntel
        LogoutFromCurrentSession
    fi
else
    ErrorHandler
fi

관련 정보