Установите последние версии драйверов NVIDIA на серверы Debian 11

Более старая версия официальных драйверов NVIDIA (версия 470.161.03 для Debian 11 на момент написания этой статьи) доступна в официальном репозитории пакетов Debian 11. Если вам нужно установить последнюю версию официальных драйверов NVIDIA (версия 525.89 .02 на момент написания этой статьи) в Debian 11 вам необходимо загрузить его с официального сайта NVIDIA и установить на свой компьютер с Debian 11.

В этой статье мы покажем вам, как загрузить последнюю версию официальных драйверов NVIDIA для Debian 11 и установить ее на безголовый (без установленного графического интерфейса пользователя) сервер Debian 11.

Подключение к серверу Debian 11 через SSH

Подключение к вашему серверу Debian 11 через SSH необязательно, если у вас есть доступ к серверному оборудованию (где вы установили Debian 11). Вы можете просто подключить к серверу мышь, клавиатуру и монитор, загрузить и установить на него последнюю версию официальных драйверов NVIDIA.

Если у вас нет доступа к серверному оборудованию Debian 11, вам необходимо подключиться к нему по SSH, чтобы установить последнюю версию официальных драйверов NVIDIA.

Чтобы подключиться по SSH к вашему серверу Debian 11, вы можете запустить следующую команду из терминального приложения вашего рабочего стола/ноутбука, с которого вы хотите получить к нему доступ:

$ ssh <username>@<hostname/ip-address>

Обязательно замените <username> и <hostname/ip-address> на имя пользователя для входа и доменное имя или IP-адрес вашего сервера Debian 11 соответственно.

Если вы используете Windows 10 или Windows 11 и вам нужна помощь в подключении к вашему серверу Debian 11 через SSH, прочитайте статью о том, как подключиться по SSH к серверам Linux из Windows 10/11 .

Удаление старых драйверов NVIDIA с сервера Debian 11

Прежде чем пытаться установить последнюю версию официальных драйверов NVIDIA на свой сервер Debian 11, вы должны удалить драйверы NVIDIA, которые вы уже установили, из официального репозитория пакетов Debian 11. Если вам нужна помощь в этом, прочитайте статью на Как выполнить чистую установку драйверов NVIDIA в Debian 11 .

Отключение драйверов Nouveau на сервере Debian 11

После удаления драйверов NVIDIA с сервера Debian 11 драйверы nouveau должны быть активированы, как показано на следующем снимке экрана:

$ lsmod | grep nouveau

Чтобы установить последнюю версию официальных драйверов NVIDIA, вам необходимо отключить драйверы nouveau на вашем сервере Debian 11.

Чтобы отключить драйверы nouveau на сервере Debian 11, создайте новый файл «nvidia-installer-disable-nouveau.conf» в каталоге /etc/modprobe.d/ следующим образом:

$ sudo nano /etc/modprobe.d/nvidia-installer-disable-nouveau.conf

Введите следующие строки в файл «nvidia-installer-disable-nouveau.conf»:

blacklist nouveau
options nouveau modeset=0

Когда вы закончите, нажмите <Ctrl> + X , затем Y и <Enter>, чтобы сохранить файл «nvidia-installer-disable-nouveau.conf».

Чтобы изменения вступили в силу, перезапустите сервер Debian 11 с помощью следующей команды:

$ sudo reboot

После загрузки сервера Debian 11 вы должны увидеть, что драйверы nouveau больше не используются.

$ lsmod | grep nouveau

Способ 1: загрузка последней версии официальных драйверов NVIDIA для Linux и перенос ее на сервер Debian 11 через SFTP

В этом разделе мы покажем вам, как загрузить последнюю версию официальных драйверов NVIDIA для Linux и передать установочный файл на сервер Debian 11 через SFTP.

Чтобы загрузить последнюю версию официальных драйверов NVIDIA для Linux, посетите https://nvidia.com/en-us/drivers/unix в своем любимом веб-браузере.

После загрузки страницы вы должны найти последнюю версию официальных драйверов NVIDIA в разделе «Последняя версия производственной ветви». На момент написания этой статьи последняя версия официальных драйверов NVIDIA — 525.89.02. Чтобы загрузить его, щелкните номер версии, как показано на следующем снимке экрана:

На вкладке «Поддерживаемые продукты» вы найдете все видеокарты NVIDIA, которые поддерживает этот драйвер.

Если ваш графический процессор NVIDIA находится в списке «Поддерживаемые продукты», нажмите «Загрузить».

Нажмите «Согласиться и скачать».

Ваш браузер должен попросить вас выбрать папку/каталог, в котором вы хотите сохранить установочный файл драйверов графического процессора NVIDIA. Выберите папку/каталог по вашему выбору и нажмите «Сохранить».

Выполняется загрузка последней версии официального установочного файла драйверов NVIDIA. Это займет некоторое время.

На этом этапе загружается последняя версия официального установочного файла драйверов NVIDIA.

Мы сохранили официальный установочный файл драйверов NVIDIA в папке «Загрузки», как вы можете видеть на следующем снимке экрана:

Теперь, когда загружена последняя версия официального установочного файла драйверов NVIDIA, вы должны перенести этот файл на свой сервер Debian 11. Один из самых простых способов передать файл на ваш сервер Debian 11 — через SFTP. Чтобы узнать, как передать файл на сервер Debian 11 через SFTP, прочитайте статью Как включить SFTP на Synology NAS?

Способ 2: использование CURL для загрузки последней версии официальных драйверов NVIDIA на сервер Debian 11

В этом разделе мы покажем вам, как загрузить последнюю версию официальных драйверов NVIDIA на ваш сервер Debian 11 через CURL. Это еще один способ загрузки последней версии официальных драйверов NVIDIA для Debian 11.

Чтобы этот метод работал, вам нужно знать номер версии последних официальных драйверов NVIDIA. Вы найдете эту информацию на официальной странице загрузки драйверов NVIDIA для Linux . На момент написания этой статьи последняя версия официальных драйверов NVIDIA — 525.89.02. К моменту прочтения этой статьи номер версии может измениться. Поэтому обязательно замените этот номер версии на номер доступной последней версии драйверов NVIDIA, когда будете читать эту статью.

Теперь вам нужно установить CURL, если он еще не установлен.

Сначала обновите кэш репозитория пакетов APT с помощью следующей команды:

$ sudo apt update

Чтобы установить CURL на ваш сервер Debian 11, выполните следующую команду:

$ sudo apt install curl

Чтобы подтвердить установку, нажмите Y , а затем нажмите <Enter> .

CURL должен быть установлен.

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

Сначала установите переменную среды BASE_URL следующим образом:

$ export BASE_URL=https://us.download.nvidia.com/XFree86/Linux-x86_64

Затем установите переменную среды DRIVER_VERSION. Значение этой переменной среды должно быть номером версии официальных драйверов NVIDIA, которые вы хотите загрузить.

$ export DRIVER_VERSION=525.89.02

Наконец, чтобы загрузить последнюю версию официальных драйверов NVIDIA на свой сервер Debian 11 с помощью CURL, выполните следующую команду:

$ curl -fSl -O $BASE_URL/$DRIVER_VERSION/NVIDIA-Linux-x86_64-$DRIVER_VERSION.run

CURL должен начать загрузку официального установочного файла драйверов NVIDIA. Это займет некоторое время.

На этом этапе CURL должен завершить загрузку официального установочного файла драйверов NVIDIA.

Официальный установочный файл драйверов NVIDIA должен быть сохранен в текущем рабочем каталоге, как показано на следующем снимке экрана:

$ ls -lh

Установка необходимых пакетов зависимостей для последней версии официальных драйверов NVIDIA

For the latest version of the official NVIDIA drivers to work on your Debian 11 server, you have to install the required dependency packages on your Debian 11 server.

Чтобы установить все необходимые пакеты зависимостей на ваш сервер Debian 11 для работы последней версии официальных драйверов NVIDIA, выполните следующую команду:

$ sudo apt install linux-headers-$(uname -r) build-essential xorg pkg-config libvulkan1 libglvnd0 libglvnd-dev libvdpau1

Чтобы подтвердить установку, нажмите Y . Затем нажмите <Enter> .

Все необходимые пакеты зависимостей загружаются. Это займет некоторое время.

Все необходимые пакеты зависимостей устанавливаются. Это займет некоторое время.

На этом этапе все пакеты зависимостей должны быть установлены.

Установка последней версии официальных драйверов NVIDIA на сервер Debian 11

Официальный установочный файл драйверов NVIDIA должен быть сохранен в текущем рабочем каталоге. Но по умолчанию он не является исполняемым, как вы можете видеть на следующем снимке экрана:

$ ls -lh

Чтобы сделать исполняемый файл установщика драйверов NVIDIA, выполните следующую команду:

$ chmod +x NVIDIA-Linux-x86_64-525.89.02.run

ПРИМЕЧАНИЕ . Замените 525.89.02 номером версии загруженных вами драйверов NVIDIA.

Официальный файл установки драйверов NVIDIA должен быть исполняемым.

$ ls -lh

Чтобы установить последнюю версию официальных драйверов NVIDIA, запустите установочный файл следующим образом:

$ sudo ./NVIDIA-Linux-x86_64-525.89.02.run

ПРИМЕЧАНИЕ . Замените 525.89.02 номером версии загруженных вами драйверов NVIDIA.

Установщик драйверов NVIDIA инициализируется. Для завершения требуется несколько секунд.

Официальный установщик драйверов NVIDIA устанавливает последнюю версию официальных драйверов NVIDIA на ваш сервер Debian 11. Для завершения требуется несколько секунд.

Когда вы увидите следующее окно, выберите Да и нажмите <Enter> .

Установка должна продолжиться.

Когда вы увидите следующее окно, выберите Да и нажмите <Enter> .

Должна быть установлена ​​последняя версия официальных драйверов NVIDIA.

Нажмите < Ввод> .

Чтобы изменения вступили в силу, перезагрузите сервер Debian 11 с помощью следующей команды:

$ sudo reboot

Проверка правильности установки последней версии официальных драйверов NVIDIA на сервере Debian 11

После загрузки вашего сервера Debian 11 вы можете проверить, используются ли модули ядра nvidia, с помощью следующей команды. Если команда выводит похожие результаты (как показано на следующем снимке экрана), последняя версия официальных драйверов графического процессора NVIDIA должна работать нормально:

$ lsmod | grep nvidia

Вы также можете найти информацию об использовании вашего графического процессора NVIDIA с помощью команды «nvidia-smi». Вывод этой команды также подтверждает правильность установки последней версии официальных драйверов графического процессора NVIDIA.

$ nvidia-smi

Удаление последней версии официальных драйверов NVIDIA с сервера Debian 11

Чтобы удалить последнюю версию официальных драйверов NVIDIA с вашего сервера Debian 11, вам понадобится файл установщика драйверов NVIDIA, который вы использовали для установки последней версии официальных драйверов NVIDIA.

$ ls -lh

Чтобы удалить последнюю версию официальных драйверов NVIDIA с вашего сервера Debian 11, выполните следующую команду:

$ sudo ./NVIDIA-Linux-x86_64-525.89.02.run --uninstall

ПРИМЕЧАНИЕ . Замените 525.89.02 номером версии загруженных вами драйверов NVIDIA.

Установщик драйверов NVIDIA инициализируется. Это займет некоторое время.

Когда вы увидите следующее окно, выберите Да и нажмите <Enter> .

Последняя версия официальных драйверов NVIDIA удаляется. Для завершения требуется несколько секунд.

На этом этапе последняя версия официальных драйверов NVIDIA должна быть удалена с вашего сервера Debian 11.

Выберите OK и нажмите <Enter> .

Чтобы изменения вступили в силу, перезапустите сервер Debian 11 с помощью следующей команды:

$ sudo reboot

После загрузки вашего сервера Debian 11 модуль ядра nvidia не должен загружаться, как показано на следующем снимке экрана. Это означает, что последняя версия официальных драйверов NVIDIA удалена:

$ lsmod | grep nvidia

Заключение

Мы показали вам, как загрузить последнюю версию официальных драйверов NVIDIA для серверов Debian 11. Мы также показали вам, как установить последнюю версию официальных драйверов NVIDIA на серверы Debian 11 и как удалить последнюю версию официальных драйверов NVIDIA с серверов Debian 11.

Оригинальный источник статьи: https://linuxhint.com/

#debian #servers #nvidia #drivers 

Установите последние версии драйверов NVIDIA на серверы Debian 11
佐藤  桃子

佐藤 桃子

1682181360

在 Debian 11 服务器上安装最新的 NVIDIA 驱动程序

Debian 11 的官方软件包存储库中提供了官方 NVIDIA 驱动程序的旧版本(在撰写本文时 Debian 11 上的版本为 470.161.03)。如果您需要安装最新版本的官方 NVIDIA 驱动程序(版本 525.89 .02 在撰写本文时)在 Debian 11 上,您必须从NVIDIA 的官方网站下载它并将其安装在您的 Debian 11 机器上。

在本文中,我们将向您展示如何为 Debian 11 下载最新版本的官方 NVIDIA 驱动程序并将其安装在无头(未安装图形用户界面)Debian 11 服务器上。

通过 SSH 连接到 Debian 11 服务器

如果您有权访问服务器硬件(安装 Debian 11 的地方),则可以选择通过 SSH 连接到您的 Debian 11 服务器计算机。您只需将鼠标、键盘和显示器连接到服务器,并在其上下载并安装最新版本的官方 NVIDIA 驱动程序。

如果您无法访问 Debian 11 服务器硬件,则需要通过 SSH 连接到它以安装最新版本的官方 NVIDIA 驱动程序。

要通过 SSH 连接到您的 Debian 11 服务器计算机,您可以从要访问它的台式机/笔记本电脑的终端应用程序运行以下命令:

$ ssh <username>@<hostname/ip-address>

确保将<username><hostname/ip-address>分别替换为您的 Debian 11 服务器计算机的登录用户名和域名或 IP 地址。

如果您使用的是 Windows 10 或 Windows 11,并且在通过 SSH 连接到 Debian 11 服务器机器时需要任何帮助,请阅读有关如何从 Windows 10/11 SSH 进入 Linux 服务器的文章。

从 Debian 11 服务器中删除旧的 NVIDIA 驱动程序

在您尝试在您的 Debian 11 服务器上安装最新版本的官方 NVIDIA 驱动程序之前,您必须从 Debian 11 的官方软件包存储库中卸载您已经安装的 NVIDIA 驱动程序。如果您需要任何帮助,请阅读文章如何在 Debian 11 上全新安装 NVIDIA 驱动程序

在 Debian 11 服务器上禁用 Nouveau 驱动程序

从 Debian 11 服务器卸载 NVIDIA 驱动程序后,应激活 nouveau 驱动程序,如以下屏幕截图所示:

$ lsmod | grep nouveau

要安装最新版本的官方 NVIDIA 驱动程序,您必须在 Debian 11 服务器上禁用 nouveau 驱动程序。

要在 Debian 11 服务器上禁用 nouveau 驱动程序,请在/etc/modprobe.d/目录中创建一个新的“nvidia-installer-disable-nouveau.conf”文件,如下所示:

$ sudo nano /etc/modprobe.d/nvidia-installer-disable-nouveau.conf

在“nvidia-installer-disable-nouveau.conf”文件中输入以下行:

blacklist nouveau
options nouveau modeset=0

完成后,按<Ctrl> + X,然后按Y<Enter>以保存“nvidia-installer-disable-nouveau.conf”文件。

要使更改生效,请使用以下命令重新启动 Debian 11 服务器:

$ sudo reboot

Debian 11 服务器机器启动后,您应该会看到不再使用 nouveau 驱动程序。

$ lsmod | grep nouveau

方法一:下载最新版 NVIDIA Linux 官方驱动,通过 SFTP 传输至 Debian 11 服务器

在本节中,我们将向您展示如何下载适用于 Linux 的最新版 NVIDIA 官方驱动程序,以及如何通过 SFTP 将安装程序文件传输到 Debian 11 服务器。

要下载适用于 Linux 的最新版 NVIDIA 官方驱动程序,请从您喜欢的网络浏览器访问https://nvidia.com/en-us/drivers/unix 。

页面加载后,您应该会在“最新生产分支版本”部分找到最新版本的官方 NVIDIA 驱动程序。在撰写本文时,官方 NVIDIA 驱动程序的最新版本是 525.89.02。要下载它,请单击以下屏幕截图中标记的版本号:

在“支持的产品”选项卡中,您会找到该驱动程序支持的所有 NVIDIA 显卡。

如果您的 NVIDIA GPU 在“支持的产品”列表中,请单击“下载”。

单击“同意并下载”。

您的浏览器应该会要求您选择要保存 NVIDIA GPU 驱动程序安装程序文件的文件夹/目录。选择您选择的文件夹/目录,然后单击“保存”。

正在下载最新版本的官方 NVIDIA 驱动程序安装程序文件。需要一段时间才能完成。

此时,下载了最新版本的 NVIDIA 官方驱动程序安装程序文件。

我们将官方 NVIDIA 驱动程序安装程序文件保存在“下载”文件夹中,如以下屏幕截图所示:

现在下载了最新版本的官方 NVIDIA 驱动程序安装程序文件,您必须将此文件传输到您的 Debian 11 服务器。将文件传输到 Debian 11 服务器的最简单方法之一是通过 SFTP。要了解如何通过 SFTP 将文件传输到您的 Debian 11 服务器,请阅读如何在 Synology NAS 上启用 SFTP?

方法二:在Debian 11服务器上使用CURL下载最新版NVIDIA官方驱动

在本节中,我们将向您展示如何通过 CURL 在您的 Debian 11 服务器上下载最新版本的官方 NVIDIA 驱动程序。这是在 Debian 11 上下载最新版 NVIDIA 官方驱动程序的另一种方法。

要使用此方法,您需要知道最新官方 NVIDIA 驱动程序的版本号。您可以在适用于 Linux 的官方 NVIDIA 驱动程序下载页面上找到此信息。在撰写本文时,官方 NVIDIA 驱动程序的最新版本是 525.89.02。到您阅读本文时,版本号可能有所不同。因此,请确保在阅读本文时将此版本号替换为可用的最新 NVIDIA 驱动程序版本号。

现在,如果您还没有安装 CURL,则必须安装它。

首先,使用以下命令更新 APT 包存储库缓存:

$ sudo apt update

要在您的 Debian 11 服务器上安装 CURL,请运行以下命令:

$ sudo apt install curl

要确认安装,请按Y,然后按<Enter>

应该安装 CURL。

现在,您必须设置一些环境变量,使下载过程更加简单和模块化。

首先,设置 BASE_URL 环境变量如下:

$ export BASE_URL=https://us.download.nvidia.com/XFree86/Linux-x86_64

接下来,设置 DRIVER_VERSION 环境变量。这个环境变量的值应该是你要下载的官方 NVIDIA 驱动程序的版本号。

$ export DRIVER_VERSION=525.89.02

最后,要使用 CURL 在您的 Debian 11 服务器上下载最新版本的官方 NVIDIA 驱动程序,请运行以下命令:

$ curl -fSl -O $BASE_URL/$DRIVER_VERSION/NVIDIA-Linux-x86_64-$DRIVER_VERSION.run

CURL 应该开始下载官方 NVIDIA 驱动程序安装程序文件。需要一段时间才能完成。

此时,CURL 应该完成下载官方 NVIDIA 驱动程序安装程序文件。

官方 NVIDIA 驱动程序安装程序文件应保存在当前工作目录中,如以下屏幕截图所示:

$ ls -lh

安装最新版 NVIDIA 官方驱动所需的依赖包

要使最新版本的官方 NVIDIA 驱动程序在您的 Debian 11 服务器上运行,您必须在您的 Debian 11 服务器上安装所需的依赖包。

要在 Debian 11 服务器上安装所有必需的依赖包以使最新版本的官方 NVIDIA 驱动程序正常工作,请运行以下命令:

$ sudo apt install linux-headers-$(uname -r) build-essential xorg pkg-config libvulkan1 libglvnd0 libglvnd-dev libvdpau1

要确认安装,请按Y。然后,按<Enter>

正在下载所有需要的依赖包。需要一段时间才能完成。

正在安装所有必需的依赖包。需要一段时间才能完成。

至此,所有的依赖包应该都安装好了。

在 Debian 11 服务器上安装最新版本的官方 NVIDIA 驱动程序

NVIDIA 官方驱动程序安装程序文件应保存在当前工作目录中。但它在默认情况下不可执行,如您在以下屏幕截图中所见:

$ ls -lh

要使 NVIDIA 驱动程序安装程序文件可执行,请运行以下命令:

$ chmod +x NVIDIA-Linux-x86_64-525.89.02.run

注意:将 525.89.02 替换为您下载的 NVIDIA 驱动程序的版本号。

官方 NVIDIA 驱动程序安装程序文件应该是可执行的。

$ ls -lh

要安装最新版本的官方 NVIDIA 驱动程序,请按如下方式运行安装程序文件:

$ sudo ./NVIDIA-Linux-x86_64-525.89.02.run

注意:将 525.89.02 替换为您下载的 NVIDIA 驱动程序的版本号。

正在初始化 NVIDIA 驱动程序安装程序。需要几秒钟才能完成。

官方 NVIDIA 驱动程序安装程序正在您的 Debian 11 服务器上安装最新版本的官方 NVIDIA 驱动程序。需要几秒钟才能完成。

看到以下窗口后,选择Yes并按<Enter>

安装应该继续。

看到以下窗口后,选择Yes并按<Enter>

应安装最新版本的 NVIDIA 官方驱动程序。

<Enter>

要使更改生效,请使用以下命令重新启动您的 Debian 11 服务器计算机:

$ sudo reboot

检查Debian 11服务器是否正确安装最新版NVIDIA官方驱动

Debian 11 服务器启动后,您可以使用以下命令验证是否使用了 nvidia 内核模块。如果该命令显示类似的输出(如以下屏幕截图所示),则最新版本的官方 NVIDIA GPU 驱动程序应该可以正常工作:

$ lsmod | grep nvidia

您还可以使用“nvidia-smi”命令查找 NVIDIA GPU 的使用信息。此命令的输出还验证是否正确安装了最新版本的官方 NVIDIA GPU 驱动程序。

$ nvidia-smi

从 Debian 11 服务器卸载最新版本的官方 NVIDIA 驱动程序

要从您的 Debian 11 服务器卸载最新版本的官方 NVIDIA 驱动程序,您需要用于安装最新版本的官方 NVIDIA 驱动程序的 NVIDIA 驱动程序安装程序文件。

$ ls -lh

要从您的 Debian 11 服务器卸载最新版本的官方 NVIDIA 驱动程序,请运行以下命令:

$ sudo ./NVIDIA-Linux-x86_64-525.89.02.run --uninstall

注意:将 525.89.02 替换为您下载的 NVIDIA 驱动程序的版本号。

正在初始化 NVIDIA 驱动程序安装程序。需要一段时间才能完成。

看到以下窗口后,选择Yes并按<Enter>

正在卸载最新版本的官方 NVIDIA 驱动程序。需要几秒钟才能完成。

此时,应从您的 Debian 11 服务器中删除最新版本的官方 NVIDIA 驱动程序。

选择确定并按<Enter>键。

要使更改生效,请使用以下命令重新启动 Debian 11 服务器:

$ sudo reboot

Debian 11 服务器启动后,不应加载 nvidia 内核模块,如下面的屏幕截图所示。这意味着最新版本的官方 NVIDIA 驱动程序已被删除:

$ lsmod | grep nvidia

结论

我们向您展示了如何为 Debian 11 服务器下载最新版本的官方 NVIDIA 驱动程序。我们还向您展示了如何在 Debian 11 服务器上安装最新版本的官方 NVIDIA 驱动程序,以及如何从 Debian 11 服务器上卸载最新版本的官方 NVIDIA 驱动程序。

文章原文出处:https: //linuxhint.com/

#debian #servers #nvidia #drivers 

在 Debian 11 服务器上安装最新的 NVIDIA 驱动程序

Install the Latest NVIDIA Drivers on Debian 11 Servers

An older version of the official NVIDIA drivers (version 470.161.03 on Debian 11 at the time of this writing) is available in the official package repository of Debian 11. If you need to install the latest version of the official NVIDIA drivers (version 525.89.02 at the time of this writing) on Debian 11, you have to download it from the official website of NVIDIA and install it on your Debian 11 machine.

In this article, we will show you how to download the latest version of the official NVIDIA drivers for Debian 11 and install it on a headless (without an installed graphical user interface) Debian 11 server.

Connecting to the Debian 11 Server via SSH

Connecting to your Debian 11 server machine via SSH is optional if you have an access to the server hardware (where you installed the Debian 11). You can just attach a mouse, a keyboard, and a monitor to the server and download and install the latest version of the official NVIDIA drivers on it.

If you don’t have an access to the Debian 11 server hardware, you need to SSH into it to install the latest version of the official NVIDIA drivers.

To SSH into your Debian 11 server machine, you can run the following command from a terminal app of your desktop/laptop from which you want to access it:

$ ssh <username>@<hostname/ip-address>

Make sure to replace the <username> and <hostname/ip-address> with the login username and domain name or IP address of your Debian 11 server machine, respectively.

If you’re using Windows 10 or Windows 11 and you need any assistance in connecting to your Debian 11 server machine via SSH, read the article on How to SSH into the Linux Servers from Windows 10/11.

Removing the Old NVIDIA Drivers from the Debian 11 Server

Before you attempt to install the latest version of the official NVIDIA drivers on your Debian 11 server, you must uninstall the NVIDIA drivers that you already installed from the official package repository of Debian 11. If you need any assistance on that, read the article on How to Clean Install the NVIDIA Drivers on Debian 11.

Disabling the Nouveau Drivers on the Debian 11 Server

Once you uninstall the NVIDIA drivers from your Debian 11 server, the nouveau drivers should be activated as you can see in the following screenshot:

$ lsmod | grep nouveau

To install the latest version of the official NVIDIA drivers, you have to disable the nouveau drivers on your Debian 11 server.

To disable the nouveau drivers on your Debian 11 server, create a new “nvidia-installer-disable-nouveau.conf” file in the /etc/modprobe.d/ directory as follows:

$ sudo nano /etc/modprobe.d/nvidia-installer-disable-nouveau.conf

Type in the following lines in the “nvidia-installer-disable-nouveau.conf” file:

blacklist nouveau
options nouveau modeset=0

Once you’re done, press <Ctrl> + X followed by Y and <Enter> to save the “nvidia-installer-disable-nouveau.conf” file.

For the changes to take effect, restart your Debian 11 server with the following command:

$ sudo reboot

Once the Debian 11 server machine boots, you should see that the nouveau drivers are not used anymore.

$ lsmod | grep nouveau

Method 1: Downloading the Latest Version of the Official NVIDIA Drivers for Linux and Transfering It to the Debian 11 Server via SFTP

In this section, we will show you how to download the latest version of the official NVIDIA drivers for Linux and transfer the installer file to the Debian 11 server via SFTP.

To download the latest version of the official NVIDIA drivers for Linux, visit https://nvidia.com/en-us/drivers/unix from your favorite web browser.

Once the page loads, you should find the latest version of the official NVIDIA drivers in the “Latest Production Branch Version” section. At the time of this writing, the latest version of the official NVIDIA drivers is 525.89.02. To download it, click on the version number as marked in the following screenshot:

In the “Supported Products” tab, you will find all the NVIDIA graphics cards that this driver supports.

If your NVIDIA GPU is in the “Supported Products” list, click on “Download”.

Click on “Agree & Download”.

Your browser should ask you to select a folder/directory where you want to save the NVIDIA GPU drivers installer file. Select a folder/directory of your choice and click on “Save”.

The latest version of the official NVIDIA drivers installer file is being downloaded. It takes a while to complete.

At this point, the latest version of the official NVIDIA drivers installer file is downloaded.

We saved the official NVIDIA drivers installer file in the “Downloads” folder as you can see in the following screenshot:

Now that the latest version of the official NVIDIA drivers installer file is downloaded, you have to transfer this file to your Debian 11 server. One of the easiest ways to transfer the file to your Debian 11 server is via SFTP. To learn how to transfer the file to your Debian 11 server via SFTP, read the article on How Do I Enable the SFTP on Synology NAS?

Method 2: Using CURL to Download the Latest Version of the Official NVIDIA Drivers on the Debian 11 Server

In this section, we will show you how to download the latest version of the official NVIDIA drivers on your Debian 11 server via CURL. This is another method of downloading the latest version of the official NVIDIA drivers on Debian 11.

For this method to work, you need to know the version number of the latest official NVIDIA drivers. You will find this information on the official NVIDIA drivers for Linux download page. At the time of this writing, the latest version of the official NVIDIA drivers is 525.89.02. The version number may be different by the time you read this article. So, make sure to replace this version number with the available latest NVIDIA drivers version number when you read this article.

Now, you have to install CURL if you don’t have it installed yet.

First, update the APT package repository cache with the following command:

$ sudo apt update

To install CURL on your Debian 11 server, run the following command:

$ sudo apt install curl

To confirm the installation, press Y and then press <Enter>.

CURL should be installed.

Now, you have to set some environment variables to make the download process a bit easier and modular.

First, set the BASE_URL environment variable as follows:

$ export BASE_URL=https://us.download.nvidia.com/XFree86/Linux-x86_64

Next, set the DRIVER_VERSION environment variable. The value of this environment variable should be the version number of the official NVIDIA drivers that you want to download.

$ export DRIVER_VERSION=525.89.02

Finally, to download the latest version of the official NVIDIA drivers on your Debian 11 server with CURL, run the following command:

$ curl -fSl -O $BASE_URL/$DRIVER_VERSION/NVIDIA-Linux-x86_64-$DRIVER_VERSION.run

CURL should start downloading the official NVIDIA drivers installer file. It takes a while to complete.

At this point, CURL should finish downloading the official NVIDIA drivers installer file.

The official NVIDIA drivers installer file should be saved in the current working directory as you can see in the following screenshot:

$ ls -lh

Installing the Required Dependency Packages for the Latest Version of the Official NVIDIA Drivers

For the latest version of the official NVIDIA drivers to work on your Debian 11 server, you have to install the required dependency packages on your Debian 11 server.

To install all the required dependency packages on your Debian 11 server for the latest version of the official NVIDIA drivers to work, run the following command:

$ sudo apt install linux-headers-$(uname -r) build-essential xorg pkg-config libvulkan1 libglvnd0 libglvnd-dev libvdpau1

To confirm the installation, press Y. Then, press <Enter>.

All the required dependency packages are being downloaded. It takes a while to complete.

All the required dependency packages are being installed. It takes a while to complete.

At this point, all the dependency packages should be installed.

Installing the Latest Version of the Official NVIDIA Drivers on the Debian 11 Server

The official NVIDIA drivers installer file should be saved in the current working directory. But it’s not executable by default as you can see in the following screenshot:

$ ls -lh

To make the NVIDIA drivers installer file executable, run the following command:

$ chmod +x NVIDIA-Linux-x86_64-525.89.02.run

NOTE: Replace 525.89.02 with the version number of the NVIDIA drivers that you downloaded.

The official NVIDIA drivers installer file should be executable.

$ ls -lh

To install the latest version of the official NVIDIA drivers, run the installer file as follows:

$ sudo ./NVIDIA-Linux-x86_64-525.89.02.run

NOTE: Replace 525.89.02 with the version number of the NVIDIA drivers that you downloaded.

The NVIDIA drivers installer is being initialized. It takes a few seconds to complete.

The official NVIDIA drivers installer is installing the latest version of the official NVIDIA drivers on your Debian 11 server. It takes a few seconds to complete.

Once you see the following window, select Yes and press <Enter>.

The installation should continue.

Once you see the following window, select Yes and press <Enter>.

The latest version of the official NVIDIA drivers should be installed.

Press <Enter>.

For the changes to take effect, restart your Debian 11 server machine with the following command:

$ sudo reboot

Checking If the Latest Version of the Official NVIDIA Drivers Is Installed Correctly on the Debian 11 Server

Once your Debian 11 server boots, you can verify whether the nvidia kernel modules are used with the following command. If the command displays similar outputs (as shown in the following screenshot), the latest version of the official NVIDIA GPU drivers should be working just fine:

$ lsmod | grep nvidia

You can also find the usage information of your NVIDIA GPU using the “nvidia-smi” command. The output of this command also verifies that the latest version of the official NVIDIA GPU drivers is installed correctly.

$ nvidia-smi

Uninstalling the Latest Version of the Official NVIDIA Drivers from the Debian 11 Server

To uninstall the latest version of the official NVIDIA drivers from your Debian 11 server, you need the NVIDIA drivers installer file which you used to install the latest version of the official NVIDIA drivers.

$ ls -lh

To uninstall the latest version of the official NVIDIA drivers from your Debian 11 server, run the following command:

$ sudo ./NVIDIA-Linux-x86_64-525.89.02.run --uninstall

NOTE: Replace 525.89.02 with the version number of the NVIDIA drivers that you downloaded.

The NVIDIA drivers installer is being initialized. It takes a while to complete.

Once you see the following window, select Yes and press <Enter>.

The latest version of the official NVIDIA drivers is being uninstalled. It takes a few seconds to complete.

At this point, the latest version of the official NVIDIA drivers should be removed from your Debian 11 server.

Select OK and press <Enter>.

For the changes to take effect, restart your Debian 11 server with the following command:

$ sudo reboot

Once your Debian 11 server boots, the nvidia kernel module should not be loaded as you can see in the following screenshot. This means the latest version of the official NVIDIA drivers is removed:

$ lsmod | grep nvidia

Conclusion

We showed you how to download the latest version of the official NVIDIA drivers for Debian 11 servers. We also showed you how to install the latest version of the official NVIDIA drivers on Debian 11 servers and how to uninstall the latest version of the official NVIDIA drivers from the Debian 11 servers.

Original article source at: https://linuxhint.com/

#debian #servers #nvidia #drivers 

Install the Latest NVIDIA Drivers on Debian 11 Servers
Tony R

Tony R

1665577042

Affordable Linux Hosting Server for your Website

Cheap Linux Hosting is the most popular hosting service in the industry. Most websites are now hosted using cheap linux hosting due to their affordable price and flexibility. Linux Hosting is compatible with PHP, MySQL, Zen Cart, and phpBB. It is an excellent choice because it supports just about everything you need or want in your website from blogs to online stores and more. You use cPanel to manage your cheap linux hosting account and websites in any web browser. It's generally easier to use. cPanel is an online Linux-based graphical interface (GUI) used as a control panel to simplify website and server management. The cPanel control panel allows you to publish websites, manage domains, organize web files, create email accounts, and more. Features of 10GB Hosting cheap linux hosting details: cPanel Control Panel, 24x7 Days Technical Support, 99.9% Uptime, Free Migration.

#hosting #webhosting #servers #website #uk #usa #europe

Affordable Linux Hosting Server for your Website
Nigel  Uys

Nigel Uys

1663269600

10 Popular Libraries for Geographic tools & Servers in Go

In today's post we will learn about 10 Popular Libraries for Geographic tools & servers in Go. 

A geographic information system (GIS) is a type of database containing geographic data (that is, descriptions of phenomena for which location is relevant), combined with software tools for managing, analyzing, and visualizing those data. In a broader sense, one may consider such a system to also include human users and support staff, procedures and workflows, body of knowledge of relevant concepts and methods, and institutional organizations.

Table of contents:

  • Geoserver - Geoserver Is a Go Package For Manipulating a GeoServer Instance via the GeoServer REST API.
  • Gismanager - Publish Your GIS Data(Vector Data) to PostGIS and Geoserver.
  • Godal - Go wrapper for GDAL.
  • H3 GeoJSON - Conversion utilities between H3 indexes and GeoJSON.
  • H3GeoDist - Distribution of Uber H3geo cells by virtual nodes.
  • Mbtileserver - A simple Go-based server for map tiles stored in mbtiles format.
  • OSM - Library for reading, writing and working with OpenStreetMap data and APIs.
  • Pbf - OpenStreetMap PBF golang encoder/decoder.
  • S2 geojson - Convert geojson to s2 cells & demonstrating some S2 geometry features on map.
  • S2 geometry - S2 geometry library in Go.

1 - Geoserver: Geoserver Is a Go Package For Manipulating a GeoServer Instance via the GeoServer REST API.

geoserver Is a Go Package For Manipulating a GeoServer Instance via the GeoServer REST API.

How to install:

  • go get -v gopkg.in/hishamkaram/geoserver.v1
    • now you can import the package from gopkg.in/hishamkaram/geoserver.v1, example:
import (
  ...
  "gopkg.in/hishamkaram/geoserver.v1"
  ...
)

usage:

  • Create new Catalog (which contains all available operations):
    • gsCatalog := geoserver.GetCatalog("http://localhost:8080/geoserver13/", "admin", "geoserver")
  • Use catalog Methods to Perform a Geoserver REST Operation:
    • Create New workspace:
created, err := gsCatalog.CreateWorkspace("golang")
if err != nil {
  fmt.Printf("\nError:%s\n", err)
}
fmt.Println(strconv.FormatBool(created))
  • output if created:
INFO[31-03-2018 16:26:35] url:http://localhost:8080/geoserver13/rest/workspaces	response Status=201  
true
  • output if error:
INFO[31-03-2018 16:26:37] url:http://localhost:8080/geoserver13/rest/workspaces	response Status=401  
WARN[31-03-2018 16:26:37] <!doctype html><html lang="en"><head><title>HTTP Status 401 – Unauthorized</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 401 – Unauthorized</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Workspace &#39;golang&#39; already exists</p><p><b>Description</b> The request has not been applied because it lacks valid authentication credentials for the target resource.</p><hr class="line" /><h3>Apache Tomcat/9.0.6</h3></body></html> 

Error:Unauthorized
false
  • Get Layers through GetLayers take workspace as paramter if empty workspace will be ignored and geoserver will return all public layers
layers, err := gsCatalog.GetLayers("")
if err != nil {
  fmt.Printf("\nError:%s\n", err)
}
for _, lyr := range layers {
  fmt.Printf("\nName:%s  href:%s\n", lyr.Name, lyr.Href)
}
  • output:
INFO[31-03-2018 19:04:44] url:http://localhost:8080/geoserver13/rest/layers	response Status=200  

Name:tiger:giant_polygon  href:http://localhost:8080/geoserver13/rest/layers/tiger%3Agiant_polygon.json

Name:tiger:poi  href:http://localhost:8080/geoserver13/rest/layers/tiger%3Apoi.json

Name:tiger:poly_landmarks  href:http://localhost:8080/geoserver13/rest/layers/tiger%3Apoly_landmarks.json

Name:tiger:tiger_roads  href:http://localhost:8080/geoserver13/rest/layers/tiger%3Atiger_roads.json

Name:nurc:Arc_Sample  href:http://localhost:8080/geoserver13/rest/layers/nurc%3AArc_Sample.json

Name:nurc:Img_Sample  href:http://localhost:8080/geoserver13/rest/layers/nurc%3AImg_Sample.json

Name:nurc:Pk50095  href:http://localhost:8080/geoserver13/rest/layers/nurc%3APk50095.json

Name:nurc:mosaic  href:http://localhost:8080/geoserver13/rest/layers/nurc%3Amosaic.json
......

View on Github

2 - Gismanager: Publish Your GIS Data(Vector Data) to PostGIS and Geoserver.

Publish Your GIS Data(Vector Data) to PostGIS and Geoserver

  • How to install:
    • go get -v github.com/hishamkaram/gismanager
  • Usage:
    • testdata folder content:
./testdata/
├── neighborhood_names_gis.geojson
├── nested
│   └── nyc_wi-fi_hotspot_locations.geojson
├── sample.gpkg
  • create ManagerConfig instance:
manager:= gismanager.ManagerConfig{
  Geoserver: gismanager.GeoserverConfig{WorkspaceName: "golang", Username: "admin", Password: "geoserver", ServerURL: "http://localhost:8080/geoserver"},
  Datastore: gismanager.DatastoreConfig{Host: "localhost", Port: 5432, DBName: "gis", DBUser: "golang", DBPass: "golang", Name: "gismanager_data"},
  Source:    gismanager.SourceConfig{Path: "./testdata"},
  logger:    gismanager.GetLogger(),
}
  • get Supported GIS Files:
files, _ := gismanager.GetGISFiles(manager.Source.Path)
for _, file := range files {
  fmt.Println(file)
}
  • output:
<full_path>/testdata/neighborhood_names_gis.geojson
<full_path>/testdata/nested/nyc_wi-fi_hotspot_locations.geojson
<full_path>/testdata/sample.gpkg
  • read files and get layers Schema:
  for _, file := range files {
    source, ok := manager.OpenSource(file, 0)
    if ok {
      for index := 0; index < source.LayerCount(); index++ {
        layer := source.LayerByIndex(index)
        gLayer := gismanager.GdalLayer{
          Layer: &layer,
        }
        fmt.Println(layer.Name())
        for _, f := range gLayer.GetLayerSchema() {
          fmt.Printf("\n%+v\n", *f)
        }
      }
    }
  }
  • output sample:
neighborhood_names_gis

{Name:geom Type:POINT}

{Name:stacked Type:String}

{Name:name Type:String}

{Name:annoline1 Type:String}

{Name:annoline3 Type:String}

{Name:objectid Type:String}

{Name:annoangle Type:String}

{Name:annoline2 Type:String}

{Name:borough Type:String}
...

View on Github

3 - Godal: Go wrapper for GDAL.

Godal aims at providing an idiomatic go wrapper around the GDAL library:

  • Function calls return a result and an error. The result will be valid if no error was returned. The error message will contain the root cause of why the error happened.
  • Calls between go and native libraries incur some overhead. As such godal does not strictly expose GDAL's API, but groups often-used calls in a single cgo function to reduce this overhead. For example, C code like
    hDS = GDALOpen(filename, GA_Readonly)
    if (hDS == NULL) exit(1);
    int sx = GDALGetRasterXSize(hDS);
    int sy = GDALGetRasterYSize(hDS);
    int nBands = GDALGetRasterCount(hDS);
    printf("dataset size: %dx%dx%d\n",sx,sy,nBands);
    for (int i=1; i<=nBands; i++) {
        hBand = GDALGetRasterBand(hDS,i);
        int ovrCount = GDALGetOverviewCount(hBand)
        for(int o=0; o<=ovrCount; o++) {
            GDALRasterBandH oBand = GDALGetOverview(hBand,o);
            int osx = GDALGetRasterBandXSize(oBand);
            int osy = GDALGetRasterBandYSize(oBand);
            printf("overview %d size: %dx%d\n",o,osx,osy);
        }
    }

will be written as

    hDS,err := godal.Open(filename)
    if err!=nil {
        panic(err)
    }
    structure := hDS.Structure()
    fmt.Printf("dataset size: %dx%dx%d\n", structure.SizeX,structure.SizeY,structure.NBands)
    for _,band := range hDS.Bands() {
        for o,ovr := range band.Overviews() {
            bstruct := ovr.Structure()
            fmt.Printf("overview %d size: %dx%d\n",o,bstruct.SizeX,bstruct.SizeY)
        }
    }
  • Unfrequently used or non-default parameters are passed as options:
    ds,err := godal.Open(filename) //read-only
    ds,err := godal.Open(filename, Update()) //read-write
  • Godal exposes a VSI handler that can easily allow you to expose an io.ReaderAt as a filename that can be opened by GDAL. A handler for opening gs:// google cloud storage URIs is provided through https://github.com/airbusgeo/osio

View on Github

4 - H3 GeoJSON: Conversion utilities between H3 indexes and GeoJSON.

The geojson2h3 library includes a set of utilities for conversion between GeoJSON Objects:

  • Point, MultiPoint,
  • LineString, MultiLineString
  • Polygon,MultiPolygon
  • GeometryCollection
  • Feature,FeatureCollection
  • Circle

and H3 hexagon indexes, using: H3-GO and GeoJSON

Installation

$ go get github.com/mmadfox/go-geojson2h3

API

// ToH3 converts a GeoJSON objects to a list of hexagons with specified resolution.
ToH3(resolution int, o geojson.Object) (indexes []h3.H3Index, err error)

// ToFeatureCollection converts a set of hexagons to a GeoJSON `FeatureCollection`
// with the set outline(s). The feature's geometry type will be `Polygon`.
ToFeatureCollection(indexes []h3.H3Index) (*geojson.FeatureCollection, error)

Examples

package main

import (
	"fmt"

	"github.com/mmadfox/go-geojson2h3"
	"github.com/tidwall/geojson"
	"github.com/uber/h3-go/v3"
)

func main() {
	resolution := 9
	object, err := geojson.Parse(`{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"shape":"Polygon","name":"Unnamed Layer","category":"default"},"geometry":{"type":"Polygon","coordinates":[[[-73.901303,40.756892],[-73.893924,40.743755],[-73.871476,40.756278],[-73.863378,40.764175],[-73.871444,40.768467],[-73.879852,40.760014],[-73.885515,40.764045],[-73.891522,40.761054],[-73.901303,40.756892]]]},"id":"a6ca1b7e-9ddf-4425-ad07-8a895f7d6ccf"}]}`, nil)
	if err != nil {
		panic(err)
	}

	indexes, err := geojson2h3.ToH3(resolution, object)
	if err != nil {
		panic(err)
	}
	for _, index := range indexes {
		fmt.Printf("h3index: %s\n", h3.ToString(index))
	}

	featureCollection, err := geojson2h3.ToFeatureCollection(indexes)
	if err != nil {
		panic(err)
	}
	fmt.Println("Polyfill:")
	fmt.Println(featureCollection.JSON())
}

View on Github

5 - H3GeoDist: Distribution of Uber H3geo cells by virtual nodes.

H3-geo distributed cells

Distribution of Uber H3geo cells by nodes

Prerequisites

H3-Go requires CGO

Install

With a correctly configured Go env:

go get github.com/mmadfox/go-h3geo-dist

Examples

package main

import (
	"fmt"

	h3geodist "github.com/mmadfox/go-h3geo-dist"
	"github.com/uber/h3-go/v3"
)

func main() {
	level := h3geodist.Level1
	h3dist, err := h3geodist.New(level)
	if err != nil {
		panic(err)
	}

	_ = h3dist.Add("127.0.0.1")
	_ = h3dist.Add("127.0.0.2")
	_ = h3dist.Add("127.0.0.3")

	// iterate over all cells level one
	h3geodist.Iter(level, func(index uint, cell h3.H3Index) {
		// find a node by h3geo cell
		dcell, ok := h3dist.Lookup(cell)
		fmt.Printf("h3dist.Lookup: cell=%v, host=%s, found=%v\n", cell, dcell.Host, ok)
	})

	h3dist.LookupMany([]h3.H3Index{
		h3.FromString("821fa7fffffffff"),
		h3.FromString("821f9ffffffffff"),
		h3.FromString("81973ffffffffff"),
		h3.FromString("81f07ffffffffff"),
	}, func(c h3geodist.Cell) bool {
		fmt.Printf("h3dist.LookupMany: cell=%v, host=%s\n", c.H3ID, c.Host)
		return true
	})

	h3dist.Remove("127.0.0.1")
	h3dist.Remove("127.0.0.2")
	h3dist.Remove("127.0.0.3")
}

View on Github

6 - Mbtileserver: A simple Go-based server for map tiles stored in mbtiles format.

It currently provides support for png, jpg, webp, and pbf (vector tile) tilesets according to version 1.0 of the mbtiles specification. Tiles are served following the XYZ tile scheme, based on the Web Mercator coordinate reference system. UTF8 Grids are no longer supported.

In addition to tile-level access, it provides:

  • TileJSON 2.1.0 endpoint for each tileset, with full metadata from the mbtiles file.
  • a preview map for exploring each tileset.
  • a minimal ArcGIS tile map service API

We have been able to host a bunch of tilesets on an AWS t2.nano virtual machine without any issues.

Goals

  • Provide a web tile API for map tiles stored in mbtiles format
  • Be fast
  • Run on small resource cloud hosted machines (limited memory & CPU)
  • Be easy to install and operate

Supported Go versions

Requires Go 1.16+.

mbtileserver uses go modules and follows standard practices as of Go 1.16.

Installation

You can install this project with

$  go install github.com/consbio/mbtileserver@latest

This will create and install an executable called mbtileserver.

Usage

From within the repository root ($GOPATH/bin needs to be in your $PATH):

$  mbtileserver --help
Serve tiles from mbtiles files.

Usage:
  mbtileserver [flags]

Flags:
  -c, --cert string            X.509 TLS certificate filename.  If present, will be used to enable SSL on the server.
  -d, --dir string             Directory containing mbtiles files. Directory containing mbtiles files.  Can be a comma-delimited list of directories. (default "./tilesets")
      --disable-preview        Disable map preview for each tileset (enabled by default)
      --disable-svc-list       Disable services list endpoint (enabled by default)
      --disable-tilejson       Disable TileJSON endpoint for each tileset (enabled by default)
      --domain string          Domain name of this server.  NOTE: only used for AutoTLS.
      --dsn string             Sentry DSN
      --enable-arcgis          Enable ArcGIS Mapserver endpoints
      --enable-fs-watch        Enable reloading of tilesets by watching filesystem
      --enable-reload-signal   Enable graceful reload using HUP signal to the server process
      --generate-ids           Automatically generate tileset IDs instead of using relative path
  -h, --help                   help for mbtileserver
  -k, --key string             TLS private key
  -p, --port int               Server port. Default is 443 if --cert or --tls options are used, otherwise 8000. (default -1)
  -r, --redirect               Redirect HTTP to HTTPS
      --root-url string        Root URL of services endpoint (default "/services")
  -s, --secret-key string      Shared secret key used for HMAC request authentication
      --tiles-only             Only enable tile endpoints (shortcut for --disable-svc-list --disable-tilejson --disable-preview)
  -t, --tls                    Auto TLS via Let's Encrypt
  -v, --verbose                Verbose logging

So hosting tiles is as easy as putting your mbtiles files in the tilesets directory and starting the server. Woo hoo!

View on Github

7 - OSM: Library for reading, writing and working with OpenStreetMap data and APIs.

This package is a general purpose library for reading, writing and working with OpenStreetMap data in Go (golang). It has the ability to:

Made available by the package are the following types:

  • Node
  • Way
  • Relation
  • Changeset
  • Note
  • User

And the following “container” types:

Scanning large data files

For small data it is possible to use the encoding/xml package in the Go standard library to marshal/unmarshal the data. This is typically done using the osm.OSM or osm.Change "container" structs.

For large data the package defines the Scanner interface implemented in both the osmxml and osmpbf sub-packages.

type osm.Scanner interface {
	Scan() bool
	Object() osm.Object
	Err() error
	Close() error
}

This interface is designed to mimic the bufio.Scanner interface found in the Go standard library.

Example usage:

f, err := os.Open("./delaware-latest.osm.pbf")
if err != nil {
	panic(err)
}
defer f.Close()

scanner := osmpbf.New(context.Background(), f, 3)
defer scanner.Close()

for scanner.Scan() {
	o := scanner.Object()
	// do something
}

scanErr := scanner.Err()
if scanErr != nil {
	panic(scanErr)
}

Note: Scanners are not safe for parallel use. One should feed the objects into a channel and have workers read from that.

View on Github

8 - Pbf: OpenStreetMap PBF golang encoder/decoder.

A golang based OpenStreetMap PBF encoder/decoder with a handy command line utility, pbf.

pbf Command Line Utility

The pbf CLI can be installed using the go install command:

$ go install m4o.io/pbf/cmd/pbf

pbf info

The pbf CLI can be used to obtain summary and extended information about an OpenStreetMap PBF file:

$ pbf info -i testdata/greater-london.osm.pbf
BoundingBox: [-0.511482, 51.28554, 0.335437, 51.69344]
RequiredFeatures: OsmSchema-V0.6, DenseNodes
OptionalFeatures: 
WritingProgram: Osmium (http://wiki.openstreetmap.org/wiki/Osmium)
Source: 
OsmosisReplicationTimestamp: 2014-03-24T21:55:02Z
OsmosisReplicationSequenceNumber: 0
OsmosisReplicationBaseURL: 

JSON output can be obtained by adding the -j option:

$ pbf info -j -i testdata/greater-london.osm.pbf | jq
{
  "BoundingBox": {
    "Left": -0.511482,
    "Right": 0.33543700000000004,
    "Top": 51.69344,
    "Bottom": 51.285540000000005
  },
  "RequiredFeatures": [
    "OsmSchema-V0.6",
    "DenseNodes"
  ],
  "OptionalFeatures": null,
  "WritingProgram": "Osmium (http://wiki.openstreetmap.org/wiki/Osmium)",
  "Source": "",
  "OsmosisReplicationTimestamp": "2014-03-24T14:55:02-07:00",
  "OsmosisReplicationSequenceNumber": 0,
  "OsmosisReplicationBaseURL": ""
}

Here, jq is used to pretty print the compact JSON.

View on Github

9 - S2 geojson: Convert geojson to s2 cells & demonstrating some S2 geometry features on map.

Draw a polygon on the map or paste a geoJSON and explore how the s2.RegionCoverer covers it with S2 cells depending on the min and max levels.

Summary

Draw a polygon on the map or paste a geoJSON and explore how the s2.RegionCoverer covers it with S2 cells depending on the min and max levels. Drop a marker and inspect the corresponding S2 cell.

  • Display s2 cells on leaflet map using the region coverer.
  • Convert geojson features to cell unions depending on the min and max levels (supported only Polygons and Points).
  • Draw points and polygons.
  • Check point & circle intersection with the geoJSON features.

Quick start

 go run cmd/s2-geojson/main.go

Docker

docker run -p 8080:8080 --rm lmaroulis/s2-geojson

View on Github

10 - S2 geometry: S2 geometry library in Go.

Overview

S2 is a library for spherical geometry that aims to have the same robustness, flexibility, and performance as the best planar geometry libraries.

This is a library for manipulating geometric shapes. Unlike many geometry libraries, S2 is primarily designed to work with spherical geometry, i.e., shapes drawn on a sphere rather than on a planar 2D map. (In fact, the name S2 is derived from the mathematical notation for the unit sphere .) This makes it especially suitable for working with geographic data.

More details about S2 in general are available on the S2 Geometry Website s2geometry.io.

Scope

The library provides the following:

Representations of angles, intervals, latitude-longitude points, unit vectors, and so on, and various operations on these types.

Geometric shapes over the unit sphere, such as spherical caps ("discs"), latitude-longitude rectangles, polylines, and polygons. These are collectively known as "regions".

A hierarchical decomposition of the sphere into regions called "cells". The hierarchy starts with the six faces of a projected cube and recursively subdivides them in a quadtree-like fashion.

Robust constructive operations (e.g., union) and boolean predicates (e.g., containment) for arbitrary collections of points, polylines, and polygons.

Fast in-memory indexing of collections of points, polylines, and polygons.

Algorithms for measuring distances and finding nearby objects.

Robust algorithms for snapping and simplifying geometry (with accuracy and topology guarantees).

A collection of efficient yet exact mathematical predicates for testing relationships among geometric objects.

Support for spatial indexing, including the ability to approximate regions as collections of discrete "S2 cells". This feature makes it easy to build large distributed spatial indexes.

On the other hand, the following are outside the scope of S2:

Planar geometry.

Conversions to/from common GIS formats.

Robustness

What do we mean by "robust"?

In the S2 library, the core operations are designed to be 100% robust. This means that each operation makes strict mathematical guarantees about its output, and is implemented in such a way that it meets those guarantees for all possible valid inputs. For example, if you compute the intersection of two polygons, not only is the output guaranteed to be topologically correct (up to the creation of degeneracies), but it is also guaranteed that the boundary of the output stays within a user-specified tolerance of true, mathematically exact result.

Robustness is very important when building higher-level algorithms, since unexpected results from low-level operations can be very difficult to handle. S2 achieves this goal using a combination of techniques from computational geometry, including conservative error bounds, exact geometric predicates, and snap rounding.

The implementation attempts to be precise both in terms of mathematical definitions (e.g. whether regions include their boundaries, and how degeneracies are handled) and numerical accuracy (e.g. minimizing cancellation error).

Note that the intent of this library is to represent geometry as a mathematical abstraction. For example, although the unit sphere is obviously a useful approximation for the Earth's surface, functions that are specifically related to geography are not part of the core library (e.g. easting/northing conversions, ellipsoid approximations, geodetic vs. geocentric coordinates, etc).

See http://godoc.org/github.com/golang/geo for specific package documentation.

For an analogous library in C++, see https://github.com/google/s2geometry, in Java, see https://github.com/google/s2-geometry-library-java, and Python, see https://github.com/google/s2geometry/tree/master/src/python

View on Github

Thank you for following this article.

#go #golang #servers 

10 Popular Libraries for Geographic tools & Servers in Go

Creating GOLang Project, Server and URL paths

In recent years, GoLang has become popular backend language for web development. In this article I will tell you

  1. How to create GoLang project.
  2. Creating server, routes and pages using net/http module.
  3. Separating the code into api files for large number of paths.

For practise you can find the sample code on this link.

Creating the Project

Someone can find creating project, importing the files as complicated, but once you know it is very easy. Install the go on your laptop either using brew install go or from the Golang website**.**

Create folder for your project.

mkdir golang-http
cd golang-http

#golang #servers #golang-packages

Creating GOLang Project, Server and URL paths

Writing Asynchronous Non-Blocking Rest API using JAVA.

Handle large traffic, improved application performance, and responsiveness

During an API call from a client, the server creates and assigns a thread of that request. This thread waits and is appointed until requests are served to that client.

Each server can open a limited number of threads, and if that number exceeds, then new clients request will store in the request queue of that server.

For the Tomcat server, its default number of threads maxThreads is 200, representing the maximum number of concurrent threads allowed to run at any given time.

There are other metrics, maxConnections, representing the total number of concurrent connections that the server will accept and process. Any additional incoming connections will be placed in a queue until a thread becomes available. The default value for NIO/NIO2 mode is 10,000 and APR/Native is 8,192.

Another metrics is acceptCount, which represents the maximum number of TCP requests that can wait in a queue at the OS level when there are no worker threads available. The default value is 100.

For a high traffic application, If a request takes much time or takes a long time to serve, it will create a huge problem. To overcome this thread management problem, we can use asynchronous programming.

According to visualstudiomagazine.com, the definition of asynchronous programming is

Asynchronous programming is a means of parallel programming in which a unit of work runs separately from the main application thread and notifies the calling thread of its completion, failure or progress.

How synchronous applications create problems?

#java #asynchronous-programming #spring #servers #api #writing asynchronous non-blocking rest api using java.

Writing Asynchronous Non-Blocking Rest API using JAVA.
Bongani  Ngema

Bongani Ngema

1621932480

How to Setup A Basic Server using NodeJS and Express.js

Express is the most preferable framework when it comes to building servers using nodeJS and javascript, and today, we are going to take a look at how to setup a basic express server, and we are going to keep it as simple as possible, and without further discussion, let’s get started:

1. Initialize a NodeJS Project:

2. Install The Needed Dependencies:

3. Setting Up The Express Server:

4. Routing:

4. Server Static Files:

#javascript #servers #expressjs #nodejs

How to Setup A Basic Server using NodeJS and Express.js
Sheldon  Grant

Sheldon Grant

1621830240

How to Create A Server in Node.js using Express

Everything you need to know to build your first server in Express

When I was first starting to learn Node.js and express it was very intimidating as all the tutorials I saw had me building medium to large scale applications. In this tutorial, we’re gonna keep it simple and build a basic server that sends “Hello World!” when the server is started.

Project Setup

Before we start our journey as a Node.js developer. We must first do some initial project setup

All we need to do for this is initialize npm in our project and install express into our app. The code for this is shown below:

Note: the _-y_ after _npm init_ allows us to skip filling out the package.json and get straight into coding

npm init -y 
npm install express

After this in your directory create a new file called server.js_. _This is where all the code for our server will go.

Adding express to our project

Now that we have to express added installed through npm we have to actually require it in our project.

In your server.js file require the express module and store it in a variable called express.

We will have another variable that will hold the port our server runs on when it is running locally. This variable will unoriginally be called port

After this, we will create another variable called app and make it reference express(). This app variable is essentially the top layer of our server and will be how we add routes and eventually start the server

#expressjs #nodejs #servers #software-development

How to Create A Server in Node.js using Express
Nat  Grady

Nat Grady

1621581660

Designing a Self-Healing Autonomic Server

1. Introduction

All web servers are configured with maximum worker threads which can be created to handle request from the clients. Conventionally the maximum number of worker thread is predefined by the system administrator based on the expected number of request per instance. It works fine as long as number of request is less than total number of worker thread. Once the request per instance is more than total number of worker threads service is unable to handle request from client. Thus, client’s request times out. The situation get worse because user feel frustrated and start clicking on refresh page on seeing the delay from usual from the application. This worsens the situation by increasing the number of requests per instance. This leads to a cycle and in end server fails and completely stops working. One solution is to manually monitor the server and shut it down during traffic burst and increase the number of worker threads and restart the server. This idea is not feasible because business will be lost for the time server is shut down and this will also lead to poor management of hardware resource.

2. Autonomic Servers

The term Autonomic comes from the autonomic nervous system found in mammals and other higher order creatures. This part of the nervous system enables the required body functions, while provided to them, to perform without consciousness. The fundamentals of autonomic computation revolve around system self-management. In this context, cooperation between the internal components is described in a manner of self-management. Autonomic computing aims at reducing human interference in system management and at optimizing system uptime efficiency. To do so, IBM has identified four basic component features: self-configuring, self-healing, self-optimizing and self-protecting.

Reduction of manual interventions in server configuration makes server themselves decide how to adapt to the current traffic makes them adaptive to flash crowd due to Slashdot effect and thus is comparatively more fault tolerant. In theory autonomic servers can tolerate any burst traffic as long as they have underlying hardware to support them.

Just like in Autonomic Nervous System, autonomic servers need to have a monitoring server to act as a load balancer and work dispatcher to decide which service needs to server upcoming requests. This server need to keep health check of all available service ports and perform mainly three operations, as discussed below:

· Health monitoring of all available services

· Dispatching request to accurate service

· Monitoring requests, and hence creating or destroying instances of service as per the pre decided short-circuiting hook

#servers #web-development #software-development #microservices

Designing a Self-Healing Autonomic Server
Royce  Reinger

Royce Reinger

1621071060

How to Create a Git Hook to Push to Your Server and Github Repo

React to Git Push to Update Your Remote Server

Introduction

Git hooks are scripts that Git executes before or after commit, push, and receive. Setting up a Git hook makes your development and deployment easy.

In this article, you will learn how to create a post-receive Git hook that executes when you use the git push command.

I use $ for a local terminal prompt and # for a remote server prompt. Also for simplicity, I use john for username and Github username, and yourdomain.com for our domain name.

Prerequisites

You already have a working Git repository on your local machine. We call it newsletter. You have a Linux server for your website (I use Ubuntu 20.04) and you can use ssh to connect from your local computer to your remote server.

Step-1 Creating working directories on a remote server

Step-2 Setting multiple remote URLs on a local Gitrepo

Step-3 Create a post-receive file

Step — 4 Test it

#git #servers #software-development #programming #gitbook

How to Create a Git Hook to Push to Your Server and Github Repo
Gordon  Taylor

Gordon Taylor

1618815960

Setup Express in TypeScript with Node.js

In this article, I will explain the simple step by step process of creating a new server with Express in TypeScript.

This example requires basic knowledge of  Node.js,  npm and  Visual Studio Code.

Setup project

Before we get started, we need to create a directory for our project. For this we enter mkdir typescript-express and confirm with Enter.

We change into the directory with cd typescript-express and set up the project.

First, we create a Node.js package with the command npm init -y.

After that we can install the modules for our project. Therefore we install Express with npm i express.

Since we are working in TypeScript, we also need TypeScript and Typings for Express. We do that with the command npm i -D typescript @types/express.

Last but not least, let’s create the configuration for TypeScript. For this we use the command npx tsc --init. The TypeScript compiler will create a predefined file with all possible settings.

Here all commands one after the other…

mkdir typescript-express
cd typescript-express

npm init -y
npm i -D typescript @types/express
npm i express
npx tsc --init

For more information on setting up a project for TypeScript, I can only refer to one of my previous article Simple setup for your next TypeScript project.

#debugging #javascript #nodejs #typescript #servers

Setup Express in TypeScript with Node.js
Mike  Kozey

Mike Kozey

1616627400

Coding for Cloud 101

Cloud has evolved drastically in recent times. While ago, physical servers were everything, bare-metal machines managed by Datacenter operators, where you as a developer or a sysadmin were responsible for managing your own rented machine. Commonly there was an SLA for uptime and scaling reliability scenarios.

After that, virtualization tech came up.

This technology has the ability to create virtual machines inside physical servers. This process was easy in terms of provisioning, scaling, and resource usage, letting you increase the experience in software delivery time, usage, and efficiency. On top of virtualization, things like IaaS or Infrastructure as a Code were born as well.

This “new” approach lets you handle related-infrastructure things such as networking, data storing, OS provisioning, etc, in an easy way with the help of a Control Panel or APIs. The IaaS is an interface that restricts the access of your physical infrastructure but provides wide and free tools for making things reliable as scalable smoothly.

IaaScan be offered as virtualized as well, where you can manage instances like if were bare-metal in terms of a business service model.

Another level of abstraction also came up as well. The PaaS or Platform as a Service, where instead of infrastructure you get a platform for host and develop your apps. Your PaaS provider directly handles scaling and reliability aspects automatically but can affect your applications if the provider is affected too.

With PaaS, you are provided with tools to develop and deliver your applications. A perfect and most popular PaaS example tool is Salesforce’s Heroku.

#microservices #servers #cloud-computing #infrastructure #serverless

Coding for Cloud 101
Lawson  Wehner

Lawson Wehner

1616572560

One Size Fits All: How to Distinguish the Ultimate Solution Between Scale-Up or Scale-Out

I wrote this essay while applying for the Data Engineering and Analytics master program at the Technical University of Munich. It may serve future applicants as an example of the scientific essay you need to append to your application.

Abstract

The scalability of a computing environment impacts the performance and the ability to serve business needs. Two approaches to scale a

computing environment are scale-up and scale-out. The objective of this paper is to describe the scale-up and scale-out approaches while mentioning their limitations. In addition, this paper describes why a

computing environment should be designed to scale-out from the get go to save costs.

1. Introduction

With the increase of interest in Artificial Intelligence and the growing complexity of modern computing architectures, more powerful resources are needed to adapt to business needs. If a computing environment has reached the limits of its computational power and can‘t serve the requests of its concurrent users efficiently, it has reached the limit of its scalability [3].

The limit of scalability can be extended by providing more resources. Although, increasing the resources also increases the cost of running the environment. The two primary approaches to increase the capacity of a computing environment are vertical scaling-up and horizontal scaling-out [2].

Both approaches are not exclusive and a computing environment can be designed to scale vertically, horizontally, or both [3]. Although both strategies can be used to increase the capacity of a computing environment, each strategy follows a different approach. Choosing the right scaling approach from the get go is beneficial to scale according to business needs and saving costs.

The contribution of this paper is as follows. First, the approach of each scaling strategy is introduced. Second, the limitations of both scaling approaches are described. Third, a recommended scaling strategy is introduced. Lastly, a summary of this essay is given with a logical conclusion.

#programming #scaling #microservices #architecture #university #servers

One Size Fits All: How to Distinguish the Ultimate Solution Between Scale-Up or Scale-Out

Pandas Web API

Pandas Web API is an open-source project that simplifies connecting pandas to a real-time data feed, testing hypotheses and visualizing results in a web browser.

By reading this article, you’ll learn how to wrap pandas operations into Web API. The server is also live and you can try it here.

#programming #python #pandas #analytics #servers

Pandas Web API