Linux and nvidia problems

Linux and nvidia problems

У вас ноутбук с Nvidia Optimus (Intel + NVIDIA) ? Сильно греется аппарат? Шумит? Тогда это для вас.

Мы будем устанавливать Bumblebee в Arch-based дистрибутив:

— Для начала удалим пакет, который конфликтует с проприетарным драйвером версии 352 (драйвер из AUR, если он у вас не «подключен», то сделайте это перед установкой драйвера)
$ pacman -Rdd mesa-libgl
— Затем Установим драйвер и необходимые ему компоненты. (При этом установится nvidia-libgl) :
$ yaourt -S libvdpau nvidia-352 nvidia-utils-352 opencl-nvidia-352
— Теперь установим сам Bumblebee (при установке будет удален nvidia-libgl и заново установлен mesa-libgl, не пугайтесь, так надо) :
$ pacman -S bumblebee lib32-primus primus bbswitch mesa-libgl
— Далее добавим демон Bumblebee в автостарт:
$ systemctl enable bumblebeed.service
— Создадим группу:
$ groupadd bumblebee
— Добавим Bumblebee в группу пользовательского запуска:
$ usermod -a -G bumblebee username
— Перезагрузим ноутбук:
$ systemctl reboot

Протестируем. Если появилось окошко с двигающимися шестернями — все в порядке, если нет, то у вас конфликт драйверов.
$ optirun glxgears -info

Удаление тиринга на Intel карточке. Работает только на конфигурации: проприетарные Nvidia + Prime. Этот способ только для ноутбуков с Optimus (intel + Nvidia). Все нижеизложенное делается на примере Linux Mint.

1) Для знающих:
sudo mkdir /etc/X11/xorg.conf.d
И раскоментить файл как в пункте 3

2)Для чайников:
— Зайти в папку /etc/X11/
— Создать папку xorg.conf.d (или зайти в нее, если она уже имеется)
— Создать в этой папке файл xorg.conf (или открыть, если файл уже есть)
— Прописать в файле текст из пункта 3

3) Section «Device»
Identifier «intel»
Driver «intel»
BusID «PCI:0:2:0»
Option «AccelMethod» «SNA»
Option «DRI» «true»
Option «TearFree» «true»
EndSection

PS: может кому пригодится
PSS: документом прикрепил готовую папку, которую просто нужно скопировать в нужную директорию. (Для ленивых).

Источник

s41m0n / linuxNvidia_guide.md

Linux — Nvidia switchable setup guide

The aim of this guide is to provide a working strategy to make your dedicated graphic card turn on/off correctly in a Linux environment (with xorg).

The following scripts have been created by tyrells and this guide is a remake of Graff’s one.

The following two packages are stricly required:

  • nvidia
  • bumblebee (to use optirun)

In addition, this guide covers even the scenario in which also these packages are installed:

  • tlp
  • powertop (mostly used for verification)

First of all, if you have tlp installed you need to teach him not to manage the Nvidia power consumption, since we would not be able to turn it on/off. To find out the pci of your Nvidia graphic card:

Let’s insert the value 01:00.0 in the blacklist of tlp :

Once done, we need to modify the bumblebee configuration file to specify the used method for saving power by disabling the nvidia card:

And in the Nvidia section:

Then, we need to create the following file in order to allow GPU to poweroff on boot. Before, be sure to retrieve the correct value to insert by typing:

And now create the file:

The following two configurations are supposed to configure your xorg environment to not automatically add a GPU when detected. Moreover, you have to specify your integrated card driver (in my case Intel):

Now that the general configuration has been correctly made, let’s focus on blacklisting some modules. It is required to prevent some modules to be loaded, and since we want to manually turn on/off the gpu we have to add this file:

Moreover, there are many modules which are automatically loaded together with nvidia and block its unloading. Since we do not want to find ourself in this scenario, we disable them by creating:

And the same thing for the nvidia module:

Читайте также:  Основные понятия windows тест

GPU management scripts

The following two scripts are used to switch on/off the GPU by just calling them in a terminal. They not only are responsible of switching the state of the correct pci , but they also unload/reload all the needed modules.

Please note: to make them work correctly set the execute permission. chmod +x /bin/enableGpu.sh /bin/disableGpu.sh

Service to lock GPU on shutdown

The unit we are going to create represent a service which locks the GPU on shutdown/restart in case it is not disable yet. This is necessary, otherwise on the next boot both nvidia and ipmi modules will be loaded and it would not be possible to unload them anymore, even though we have created the blacklist file.

Reload systemd daemons and enable the new service:

To make the system work:

  1. Reboot and verity that nvidia module is not loaded lsmod | grep nvidia
  2. Verify with powertop under Device stats that the Nvidia card has 0% of Power supply
  3. Enable your GPU by using the script enableGpu.sh
  4. Verify again that this time the power supply is 100%
  5. Check if GPU is loaded by using nvidia-smi
  6. Try to run a program with optirun optirun glxsphere64 no matter what
  7. Disable the Nvidia card disableGpu.sh
  8. Check once again the power consumption to be sure

IMPORTANT: if you have a dual boot installation of Windows which uses the Nvidia card and of course manage it differently, I noticed that on the next boot of Linux it would be possible that Nvidia card is loaded. In this case, since we would not be able to manually unload the nvidia module, we have to simulate the opposite action performed by the created service disable-nvidia-on-shutdown.service which is in particular mv /etc/modprobe.d/disable-nvidia.conf.disable /etc/modprobe.d/disable-nvidia.conf . So all we have to do is to open a terminal and perform the opposite renaming:

Restart the computer and notice if effectively the Nvidia card is loaded or not; if not, try to disable it by using the script and hopefully it will work! I did not dig deeper this scenario, so every tips are welcome 😀

Источник

Graphics and resolution problems (Nvidia) in Ubuntu 18.04 after update

I recently updated from Ubuntu 14.04 to 16.04 to 18.04 (i.e. I am now on 18.04 bionic, and started on 14). In 16.04 everything worked ok, but now I have some severe graphics problems:

Problem(s) description:

First I got the log in screen in correct resolution, but it froze with a black screen showing the mouse cursor (frozen) directly after logging in. I fixed this by installing new Nvidia drivers, following answers here.

After rebooting I got the log in screen with low resolution (640×480). Logging in works fine, but the resolution is still low, and as a result I cannot see the whole screen. Changing resolution does not work: When entering display settings, it says ‘Unknown Display’, and the Resolution field is just empty and grey (literally no text or figures at all apart from the word ‘Resolution’), and clicking it results in a small grey empty speech bubble appearing, but nothing happens.

I tried looking for solutions in several places, such as:

and here, but it is for older versions, and perhaps does not seem to apply that well to my situation anyway.

What I have tried:

  • I have checked the zoom feature: It is off.
  • I looked for ‘nomodeset’ in /etc/default/grub ,but nothing.
  • I have run apt-get purge xserver-xorg-video-intel , and installed the recommended nvidia drivers via ubuntu-drivers autoinstall , these happens to be nvidia-driver-440
  • EDIT1: I have checked the current drivers in use via Software&Updated/Additional Drivers. The drivers I have tried are: nvidia-driver-440 (recommended), nvidia-driver-435, nvidia-driver-390, and xserver-xorg-video-nouveau. I have applied the changes, I have rebooted after each change, and I have checked that the drivers I’ve changed to are in use (via ‘Software & Updates’).
  • EDIT2: I have sucessfully run sudo apt-get purge nvidia-* ; add-apt-repository ppa:graphics-drivers/ppa ; sudo apt-get update ; sudo apt-get install nvidia-driver-440 .
  • EDIT2.1: Also, After purging nvidia-*, (not reinstalling anything) and rebooting (with xorg drivers) Ubuntu actually gives me a higher res login screen (at least 1920×1080), but it is now back to freezing on a black screen with frozen mouse pointer after login. Choosing ‘recovery mode’ in GRUB, and the option ‘resume’ then weirdly gives me a 1024×768 login screen with working login. Still no higher resolution though, but I can at least pick one (1024×768), xrandr still says the same except added highest resolution 1024×768.
  • EDIT3: About Secure Boot: My Bios says: Secure Boot State: Disabled; Platform Key State: Unloaded; OS Type: Other OS . This was described as the best setting for non Secure Boot compatible operating systems, so I understand it as being disabled.

EDIT4: lsmod | grep -i i915 returns the empty string (while running either nvidia-440 or xorg). nvidia-smi returns (running nvidia-440):

NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

I still have the same problem, and get the same outputs below.

Outputs:

Here’s the output of ‘lspci | grep -i vga’:

Hardinfo shows me: Graphics: 640×480 (Unknown) The X.Org Foundation

And lshw -c -video gives me:

The xrandr output stays the same, no matter which of the above listed drivers I try.

Specs, Conclusion and Question:

Obviously there seems to be some problem reported by xrandr, but my knowledge here is very slim, and I don’t really know what the problem means, or how to fix it. I’m guessing this is driver related, but I just don’t know how to proceed.

Otherwise I’m on a Intel i7-3770 PC with a Samsung monitor connected via a Display Port connection to a Nvidia GTX 660. And, again, everything worked in both 14.04 and 16.04, and works fine in Windows 7.

Question: Do anyone have any further suggestions on how to resolve this problem? It would be highly appreciated. I’ve had other graphics related problems with Nvidia and Ubuntu 18.04 on other computers, but not like this.

Источник

Arch Nvidia проблемы после каждого обновления

Помогите пожалуйста. У меня Arch на ноутбуке на котором встроеная графика и давно все работает отлинчо.

Но на десктопе с Nvidia 1080 TI постоянные проблемы после того как вижу обновления linux и nvidia.

После обновления X не стартует

Приходится загружаться с флешки, делать arch-chroot и после этого делать

И после этого все загружается отлично.

Пробовал ставить nvidia-dkms, но не помогло.

Сделал все как написано в разделе Pacman Hook https://wiki.archlinux.org/index.php/NVIDIA создал файл /etc/pacman.d/hooks/nvidia.hook

С таким содержимым:

Но это не помогло

не выдает ничего

не выдает ничего

Не могу понять, что делать, прочитал https://wiki.archlinux.org/index.php/NVIDIA/Troubleshooting там говорят о том, что надо удалить nouveau, но у меня его и так нет.

Подскажите пожалуйста если кто сталкивался.

Проверь что есть /usr/lib/nvidia/xorg/libglxserver_nvidia.so и какому пакету он принадлежит

И покажи xorg.conf

В выводе dmesg присутствуют такие сообщения ядра, указывающие на то, что загружен модуль nouveau.

Возможно, он у тебя грузится на этапе inittamfs.

Удостоверься, что в Initramfs нет модуля nouveau.

Если есть — разберись чтобы не было.

Если его там нет, то значит модуль загружается уже после монтирования корня, тогда разбирайся что бы модуль nouveau был заблокирован к загрузке.

Точнее он всё равно должен быть заблокирован.

Но у меня всё же подозрение, что модуль nouveau грузится ещё в Initramfs.

Возможно, тебе хватит просто пересобрать initramfs ещё раз и его там не будет.

Читай wiki ArchLinux, как заблокировать добавление и загрузку модуля nouveau из initramfs, если он там действительно есть.

распаковка Initramfs делается примерно так:

Пути естественно подправь и метод сжатия может быть другой.

После выполнения команд в /tmp/initramfs будут файлы из initramfs.

Вот что выводит

sudo vim /etc/X11/xorg.conf

По dmesg у тебя грузится модуль nouveau, а не nvidia.

должен быть blacklist nouveau ставится вместе с nvidia

У тебя boot не отдельным разделом случайно?

И что? Ты видишь, что у него в dmesg есть сообщения об nouveau?

Должен, но сообщения есть, а их не должно быть, если модуль nouveau Не грузится и заблокирован.

Он всегда смонтирован?

Эммм, ну вроде всегда. А как это проверяется и как это зависит от boot ?

Проверить что есть блеклист, но мне кажется у него бут не смонтирован при обновлении ядра или дров

Возможна ситуация, что на этапе установки пакета с ядром /boot не смонтирован и как следствие файл с новым ядром ставится не в раздел с загрузчиком, а просто в директорию /boot.

И далее у тебя система загружается со старым ядром.

А новый модуль nvidia собирается под новое ядро.

Монтирование файловых систем прописывается в /etc/fstab, ну либо юнитом systemd.

Ты проверил то, что тебе написали проверить?

В общем, удостоверься, что /boot при установке пакета с ядром и драйвера nvidia у тебя смонтирован.

Я тоже так думаю.

Инит и ядро не заменятся на новые. Обновись и выложи вывод [code]sudo pacman -S nvidia #хуки должны без ошибок отработать и Creating gzip-compressed initcpio image: /boot/initramfs-linux.img ==> Image generation successful

Да, у меня был путой /etc/fstab

Так что, наверное проблема в этом

Зачем ты новую тему сделал?

Ты и в старой на несколько вопросов не ответил. Ну не умеешь логи выкладывать, спроси, больно не убьют.

One of the better ways to post this information is to use an online pastebin. You can install the pbpst or gist package to automatically upload information. For example, to upload the content of your systemd journal from this boot you would do:

# journalctl -xb | pbpst -S

Возможна ситуация, что на этапе установки пакета с ядром /boot не смонтирован и как следствие файл с новым ядром ставится не в раздел с загрузчиком, а просто в директорию /boot.

Ну у меня так. systemd монтирует раздел во время обновления автоматом. При gpt разметке и правильном Partition type (GUID) /boot раздела.

Получается, что у ТС live система подхватывает нужный /boot, загрузчик подхватывает, а pacman нет.

Гугль-траслейт вполне прилично переводит:

Один из лучших способов опубликовать эту информацию — использовать онлайн-наклейку. Вы можете установить пакет pbpst или gist для автоматической загрузки информации. Например, чтобы загрузить содержимое вашего системного журнала из этой загрузки, вы должны сделать:

# journalctl -xb | pbpst -S

Затем будет выведена ссылка, которую вы можете вставить на форум или IRC.

Ты и в старой на несколько вопросов не ответил

А я его в старой теме уже спрашивал вывод dmesg и лог xorg-server`а, но ТС, видимо страуса изображает, ничего не ответил.

Вот как раз коментарий мой:

Ну у меня так. systemd монтирует раздел во время обновления автоматом.

Я HZ, у него /etc/fstab пустой, может поэтому. Я скептический отношусь к автомонтированию systemd без /etc/fstab.

ТС, кстати тоже просил посмотреть что у него в initramfs, ну и сам он мог бы догадаться, что нужно посмотреть что находится в /boot и на файловой системе, которая должна быть смонтирована в /boot и вообще монтируется она всё же или нет. Ну и версию ядра проверить какая загружается, а какая ставится пакетом, просто посмотрев вывод uname -a .

При gpt разметке и правильном Partition type (GUID) /boot раздела.

Видимо у него неправильный.

Ну не умеет он читать документацию.

Где, кстати на wiki ArchLinux написано про специализированный partuuid раздела для /boot, / и /home ?

Где, кстати на wiki ArchLinux написано про специализированный partuuid раздела для /boot, / и /home ?

Источник

Читайте также:  Переустановка windows с жесткого диска с файлами
Оцените статью