사용자 도구

사이트 도구


linux:nvidia

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
linux:nvidia [2021/12/29 11:20]
kwon37xi
linux:nvidia [2023/07/19 17:01] (현재)
kwon37xi [nvidia/intel switch]
줄 5: 줄 5:
   * [[linux:ubuntu:xorg|Ubuntu x.org]] 참조하여 설치   * [[linux:ubuntu:xorg|Ubuntu x.org]] 참조하여 설치
   * [[linux:ubuntu:ubuntu_drivers|Ubuntu Drivers]]   * [[linux:ubuntu:ubuntu_drivers|Ubuntu Drivers]]
 +
 +
 +==== nvidia-settings 에서 xorg.conf 저장 안 될 때 ====
 +  * ''/usr/share/screen-resolution-extra/nvidia-polkit'' 파일에 실행 권한이 없어서 ''/etc/X11/xorg.conf'' 파일  생성을 못하기도 한다.
 +<code>
 +Error executing /usr/share/screen-resolution-extra/nvidia-polkit: Permission denied
 +ERROR: Unable to open X config file '/etc/X11/xorg.conf' for writing.
 +</code>
 +  * 다음과 같이 실행권한을 추가하면 된다.
 +<code sh>
 +sudo chmod +x /usr/share/screen-resolution-extra/nvidia-polkit
 +</code>
  
 ===== Screen tearing ===== ===== Screen tearing =====
-  * [[https://www.youtube.com/watch?v=MfL_JkcEFbE|Screen tearing test]] +  * [[https://www.youtube.com/watch?v=MfL_JkcEFbE|Screen tearing test]]  
-  * [[https://www.youtube.com/watch?v=rg_0D96ZGSY|Screen Tearing Example]] +  * [[https://www.youtube.com/watch?v=rg_0D96ZGSY|Screen Tearing Example]] 실제 Screen Tearing 이 발생할 때 어떤 모습인지 보여줌. 
-  * [[https://www.cmscritic.com/how-to-fix-nvidia-screen-tearing-in-xfce-mate-kde-lxde-and-others/|How to Fix NVIDIA Screen Tearing in XFCE, MATE, KDE, LXDE and others]]+ 
 +{{:linux:screentearing.png?600|Screen Tearing 이 발생할 때의 동영상에 나타나는 느낌}} 
 +  * nvidia 사용시에 화면 갱신시 찦어지는 듯한 현상이 나타나서 눈을 아프게 할 수 있다. 
 +  * 단, Screen Tearing 을 방지할 경우에는 Video 성능이 떨어질 수 있다. 안 좋은 비디오 카드에서는 성능 저하를 경험할 수 있다. 
 +  * [[linux:wayland|Wayland]] 에서는 이 현상이 해결 됐다고 한다. 
 +  * Xorg 사용시에 저 현상이 발생한다면 nvidia ''xorg.conf''에 ''Option "ForceFullCompositionPipeline" "true"'' 혹은 ''Option "ForceCompositionPipeline" "true"''가 필요하다. 
 +  * 이는 ''nvidia-settings''에서 해당 옵션을 선택하고 ''xorg.conf''를 저장하는 것만으로도 해결 가능하다. 
 + 
 +{{:linux:nvidia-settings-xorgconf.png|nvidia-settings save xorg.conf}} 
 +  * 단, 이 때 **Laptop 등에 PRIME Display 가 있을 경우 PRIME display 에 대해서는 ''nvidia-settings''가 저장을 안 해줘서 사용할 수 없는 문제가 발생**했다. 
 +  * 가장 좋은 해결책은 화면 자체를 저장하는게 아니라 ''nvidia'' 드라이버에 대한 설정만 저장하는 것이었다. 
 + 
 +==== 부팅/로그인 후 자동 명령 실행으로 해결 ==== 
 +  * 아래 명령을 ''~/.config/autostart''로 등록한다. 
 +<code sh> 
 +nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On}" 
 +</code> 
 + 
 +==== X11 설정 파일 변경으로 해결 ==== 
 +  * ''/etc/X11/xorg.conf.d/99-nvidia-myoptions.conf'' 파일을 생성하고서 아래 내용으로 저장하고 재부팅한다. 
 +  * 이제 다시 Screen Tearing 테스트를 해본다. ''ForceFullCompositionPipeline'' 대신 ''ForceCompositionPipeline''로도 충분하면 이를 사용해도 된다. 
 +<code> 
 +Section "OutputClass" 
 +    Identifier "nvidia" 
 +    MatchDriver "nvidia-drm" 
 +    Driver "nvidia" 
 +    Option "ForceCompositionPipeline" "true" 
 +    #Option "ForceFullCompositionPipeline" "true" 
 +EndSection 
 +</code> 
 +==== 참조 ==== 
 +  * [[https://www.cmscritic.com/how-to-fix-nvidia-screen-tearing-in-xfce-mate-kde-lxde-and-others/|How to Fix NVIDIA Screen Tearing in XFCE, MATE, KDE, LXDE and others]] 보편적 해결책 - 단, Laptop 모니터 인식 못했음.
   * [[https://www.youtube.com/watch?v=j8YDUveazWY|How To Eliminate All Screen Tearing On Linux - YouTube]]   * [[https://www.youtube.com/watch?v=j8YDUveazWY|How To Eliminate All Screen Tearing On Linux - YouTube]]
-    * ''Tear Free'' option+    * ''TearFree'' option
   * https://wiki.archlinux.org/title/NVIDIA/Troubleshooting#Avoid_screen_tearing   * https://wiki.archlinux.org/title/NVIDIA/Troubleshooting#Avoid_screen_tearing
 +  * [[https://forums.developer.nvidia.com/u/rockingcat|PRIME display is not detected after generating xorg.conf file - Graphics / Linux / Linux - NVIDIA Developer Forums]] : 가장 핵심 답변
 +
  
 ===== nvidia/intel dual 에서 intel 로만 강제하기 ===== ===== nvidia/intel dual 에서 intel 로만 강제하기 =====
   * [[https://gist.github.com/wangruohui/bc7b9f424e3d5deb0c0b8bba990b1bc5|Intel for display, Nvidia for computing]]   * [[https://gist.github.com/wangruohui/bc7b9f424e3d5deb0c0b8bba990b1bc5|Intel for display, Nvidia for computing]]
  
 +===== GPU Monitoring =====
 +  * [[https://unix.stackexchange.com/questions/38560/gpu-usage-monitoring-cuda|GPU usage monitoring (CUDA) - Unix & Linux Stack Exchange]]
 +  * [[https://www.youtube.com/channel/UCrinGwmzp-LNcfvDeoBLAYQ|Linux GPU Monitoring and Diagnostic Commands Line Tools - nixCraft]]
 +  * [[https://github.com/mountassir/gmonitor|mountassir/gmonitor: gmonitor is a GPU monitor (Nvidia only at the moment)]]
 +  * [[https://github.com/wookayin/gpustat/search?l=python|wookayin/gpustat: 📊 A simple command-line utility for querying and monitoring GPU status]]
 +  * [[https://github.com/Syllo/nvtop|Syllo/nvtop: NVIDIA GPUs htop like monitoring tool]]
 +  * [[https://github.com/XuehaiPan/nvitop|XuehaiPan/nvitop: An interactive NVIDIA-GPU process viewer, the one-stop solution for GPU process management.]]
 +
 +==== ''nvidia-smi'' ====
 +<code sh>
 +# 잘 정리된 현 상황을 지속적으로 보여줌.
 +nvidia-smi -q -g 0 -d UTILIZATION -l 1
 +
 +nvidia-smi -l 1
 +</code>
  
 ===== Multi/Dual Graphic Card ===== ===== Multi/Dual Graphic Card =====
줄 28: 줄 88:
   * 참조   * 참조
     * [[http://unix.stackexchange.com/questions/48266/dual-graphics-cards-in-mint-ubuntu|Dual graphics cards in Mint & Ubuntu - Unix & Linux Stack Exchange]]     * [[http://unix.stackexchange.com/questions/48266/dual-graphics-cards-in-mint-ubuntu|Dual graphics cards in Mint & Ubuntu - Unix & Linux Stack Exchange]]
 +
 +===== nvidia/intel switch =====
   * [[https://www.linuxbabe.com/desktop-linux/switch-intel-nvidia-graphics-card-ubuntu|How To Switch Between Intel and Nvidia Graphics Card on Ubuntu]]   * [[https://www.linuxbabe.com/desktop-linux/switch-intel-nvidia-graphics-card-ubuntu|How To Switch Between Intel and Nvidia Graphics Card on Ubuntu]]
 +
 +<code sh>
 +# Ubuntu 22.10 에서는 별도 패키지 설치 필요.
 +sudo apt install nvidia-prime 
 +</code>
  
 <code sh> <code sh>
 # 현재 사용중인 그래픽 카드 프로필 확인 # 현재 사용중인 그래픽 카드 프로필 확인
 prime-select query prime-select query
 +
 +# intel 로 전환
 +sudo prime-select on-demand
  
 # intel 로 전환 # intel 로 전환
줄 46: 줄 116:
   * 또한 ''on-demand'', ''intel'' 일 경우 4k Dual Monitor 로 사용할 때 성능저하가 너무 심했음(60Hz로 해도). ''nvidia'' 모드로 했더니 4K Dual 도 잘작동했음.   * 또한 ''on-demand'', ''intel'' 일 경우 4k Dual Monitor 로 사용할 때 성능저하가 너무 심했음(60Hz로 해도). ''nvidia'' 모드로 했더니 4K Dual 도 잘작동했음.
   * [[https://github.com/hertg/egpu-switcher|GitHub - hertg/egpu-switcher: 🖥🐧 Setup script for eGPUs in Linux (Xorg)]]   * [[https://github.com/hertg/egpu-switcher|GitHub - hertg/egpu-switcher: 🖥🐧 Setup script for eGPUs in Linux (Xorg)]]
 +  * ''on-demand'' 일 경우에 ''vaapi'' 가 작동했음.
  
 ==== Xinerama ==== ==== Xinerama ====
줄 60: 줄 130:
     * Google Chrome의 경우 ''<nowiki>--</nowiki>disable-cpu''명령으로 실행하거나, ''<nowiki>chrome://flags</nowiki>''에서 ''GPU composition on all pages''로 설정할 수 있다.     * Google Chrome의 경우 ''<nowiki>--</nowiki>disable-cpu''명령으로 실행하거나, ''<nowiki>chrome://flags</nowiki>''에서 ''GPU composition on all pages''로 설정할 수 있다.
     * Flash Player에서도 하드웨어 가속을 꺼야 한다. [[linux:flash|Linux Flash]] 참조.     * Flash Player에서도 하드웨어 가속을 꺼야 한다. [[linux:flash|Linux Flash]] 참조.
 +
 +===== envycontrol =====
 +  * https://bayas.dev/projects/envycontrol/
 +  * EnvyControl is a program aimed to provide an easy way to switch GPU modes on Nvidia Optimus systems (i.e laptops with Intel + Nvidia or AMD + Nvidia configurations) under Linux.
 +
  
 ===== 부팅 후 화면이 안나오거나 성능이 저하될 때 ===== ===== 부팅 후 화면이 안나오거나 성능이 저하될 때 =====
-  * NVIDIA 그래픽 카드가 작동하지 않거나 성능이 안나면 linux kernel 파라미터에 ''nomodeset''을 넣어야 .+<note warning>래된 보. 최근에 발생적 없었음.</note>
  
 +  * NVIDIA 그래픽 카드가 작동하지 않거나 성능이 안나오면 linux kernel 파라미터에 ''nomodeset'' 설정을 넣어야 한다.
 ==== Grub 설정에서 ==== ==== Grub 설정에서 ====
   * ''/etc/default/grub'' 파일<code>   * ''/etc/default/grub'' 파일<code>
linux/nvidia.1640744403.txt.gz · 마지막으로 수정됨: 2021/12/29 11:20 저자 kwon37xi