Install nvidia drivers ubuntu 20.04 / 22.04

hypervisor.cpuid.v0 -> FALSE in vmware

sudo apt install build-essential  libglvnd-dev

First Disable nouveau & enable unsuported GPU’s for open source drivers:

  1. Go to: /etc/modprobe.d/
  2. Make a file: blacklist-nvidia-nouveau.conf
  3. Put this in the file:
blacklist nouveau
options nouveau modeset=0
  1. Make a other “nvidia.conf” file and put this in the file: options nvidia
NVreg_OpenRmEnableUnsupportedGpus=1
  1. Updat kernel init ram fs:
sudo update-initramfs -u
  1. Uninstall intel microcode
sudo dpkg -l | grep intel
sudo apt purge intel-microcode
sudo update-grub
  1. Reboot
  2. Go to the Nvidia site to the page to download the driver that you want.
mkdir tmp & cd tmp
wget https://es.download.nvidia.com/XFree86/Linux-x86_64/515.76/NVIDIA-Linux-x86_64-515.76.run
  1. Copy the URL of the download butten and past it behind wget to download it to the current folder
  2. Sudo chmod 700 the file
sudo chmod 700 NVIDIA*
  1. Run the install file: sudo .\filename.run -m=kernel-open
  2. After the instalation reboot the server
  3. Test with nvidia-smi
sudo apt install nvidia-driver-470-server
sudo apt install nvidia-utils-470-server

sudo lshw -C display

  *-display
       description: VGA compatible controller
       product: SVGA II Adapter
       vendor: VMware
       physical id: f
       bus info: pci@0000:00:0f.0
       version: 00
       width: 32 bits
       clock: 33MHz
       capabilities: vga_controller bus_master cap_list rom
       configuration: driver=vmwgfx latency=64
       resources: irq:16 ioport:1070(size=16) memory:e8000000-efffffff memory:fe000000-fe7fffff memory:c0000-dffff
  *-display UNCLAIMED
       description: VGA compatible controller
       product: NVIDIA Corporation
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:0b:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller cap_list
       configuration: latency=64
       resources: memory:fc000000-fcffffff memory:d0000000-dfffffff memory:e4000000-e5ffffff ioport:5000(size=128)

List Drivers

NVidia Install (work notes)

- 5 mins read

NVIDIA Install

https://communities.vmware.com/t5/Photon-OS-Discussions/NVidia-Triton-on-Photon-OS/m-p/2926221 https://plmlab.math.cnrs.fr/plmshift/gpu_driver/-/blob/master/photon3.0/Dockerfile

nvidia_binary_version="515.76"
nvidia_binary="NVIDIA-Linux-x86_64-${nvidia_binary_version}.run"
mkdir tmp
cd tmp
wget -q https://us.download.nvidia.com/XFree86/Linux-x86_64/${nvidia_binary_version}/${nvidia_binary}
chmod +x ${nvidia_binary}
./${nvidia_binary} --accept-license --ui=none --no-kernel-module --no-questions
nvidia-smi
# required
tdnf install tar
tdnf install -y build-essential wget tar
tdnf install -y linux-esx-devel

nvidia_binary_version="470.57.02"
nvidia_binary="NVIDIA-Linux-x86_64-${nvidia_binary_version}.run"
wget -q https://us.download.nvidia.com/XFree86/Linux-x86_64/${nvidia_binary_version}/${nvidia_binary} 
chmod +x ${nvidia_binary}

./${nvidia_binary} --kernel-source-path=/usr/lib/modules/`uname -r`/build --ui=none --no-questions --accept-license


Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 470.57.02.....

Welcome to the NVIDIA Software Installer for Unix/Linux

Detected 32 CPUs online; setting concurrency level to 32.
Installing NVIDIA driver version 470.57.02.
There appears to already be a driver installed on your system (version: 470.57.02).  As part of installing this driver (version:
470.57.02), the existing driver will be uninstalled.  Are you sure you want to continue? (Answer: Continue installation)
Performing CC sanity check with CC="/usr/bin/cc".
Performing CC check.
Using the kernel source path '/usr/lib/modules/5.10.132-1.ph4-esx/build' as specified by the '--kernel-source-path' commandline
option.
Kernel source path: '/usr/lib/modules/5.10.132-1.ph4-esx/build'
Kernel output path: '/usr/lib/modules/5.10.132-1.ph4-esx/build'
Performing Compiler check.
Performing Dom0 check.
Performing Xen check.
Performing PREEMPT_RT check.
Performing vgpu_kvm check.
Cleaning kernel module build directory.
Building kernel modules
  : [##############################] 100%
Kernel module compilation complete.
Unable to determine if Secure Boot is enabled: No such file or directory
Kernel messages:
[   18.636632] IPv6: ADDRCONF(NETDEV_CHANGE): veth9f70f59: link becomes ready
[   18.636662] br-ff0ee4ab2a87: port 1(veth9f70f59) entered blocking state
[   18.636663] br-ff0ee4ab2a87: port 1(veth9f70f59) entered forwarding state
[   19.117388] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
[   19.117393] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[   75.562344] kauditd_printk_skb: 62 callbacks suppressed
[   75.562348] audit: type=1006 audit(1662044975.583:97): pid=1653 uid=0 subj==unconfined old-auid=4294967295 auid=0 tty=(none)
old-ses=4294967295 ses=1 res=1
[   75.647052] audit: type=1006 audit(1662044975.667:98): pid=1643 uid=0 subj==unconfined old-auid=4294967295 auid=0 tty=(none)
old-ses=4294967295 ses=2 res=1
[  814.633125] nvidia: loading out-of-tree module taints kernel.
[  814.633137] nvidia: module license 'NVIDIA' taints kernel.
[  814.633138] Disabling lock debugging due to kernel taint
[  814.665314] nvidia-nvlink: Nvlink Core is being initialized, major device number 246

[  814.666286] nvidia 0000:1b:00.0: enabling device (0000 -> 0003)
[  814.667559] nvidia 0000:1b:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=none
[  814.712479] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  470.57.02  Tue Jul 13 16:14:05 UTC 2021
[  814.728936] nvidia_uvm: module uses symbols from proprietary module nvidia, inheriting taint.
[  814.732612] nvidia-uvm: Loaded the UVM driver, major device number 244.
[  814.737822] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  470.57.02  Tue Jul 13 16:06:24 UTC
2021
[  814.740363] [drm] [nvidia-drm] [GPU ID 0x00001b00] Loading driver
[  814.740365] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:1b:00.0 on minor 1
[  814.745448] [drm] [nvidia-drm] [GPU ID 0x00001b00] Unloading driver
[  814.748380] nvidia-modeset: Unloading
[  814.753086] nvidia-uvm: Unloaded the UVM driver.
[  814.756718] nvidia-nvlink: Unregistered the Nvlink Core, major device number 246

WARNING: nvidia-installer was forced to guess the X library path '/usr/lib64' and X module path '/usr/lib64/xorg/modules'; these
         paths were not queryable from the system.  If X fails to find the NVIDIA X driver module, please install the `pkg-config`
         utility and the X.Org SDK/development package for your distribution and reinstall the driver.


WARNING: Unable to find a suitable destination to install 32-bit compatibility libraries. Your system may not be set up for 32-bit
         compatibility. 32-bit compatibility files will not be installed; if you wish to install them, re-run the installation and
         set a valid directory with the --compat32-libdir option.

Uninstalling the previous installation with /usr/bin/nvidia-uninstall.
Searching for conflicting files:
  Searching: [##############################] 100%
Installing 'NVIDIA Accelerated Graphics Driver for Linux-x86_64' (470.57.02):
  Installing: [##############################] 100%
Driver file installation is complete.
Running post-install sanity check:
  Checking: [##############################] 100%
Post-install sanity check passed.
Running runtime sanity check:
  Checking: [##############################] 100%
Runtime sanity check passed.
Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that the NVIDIA X driver
will be used when you restart X?  Any pre-existing X configuration file will be backed up. (Answer: No)

Installation of the NVIDIA Accelerated Graphics Driver for Linux-x86_64 (version: 470.57.02) is now complete.  Please update your
xorg.conf file as appropriate; see the file /usr/share/doc/NVIDIA_GLX-1.0/README.txt for details.


nvidia-smi
Thu Sep  1 15:24:11 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.57.02    Driver Version: 470.57.02    CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:1B:00.0 Off |                  N/A |
|  0%   62C    P0     1W / 200W |      0MiB /  7982MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

nvidia-container-toolkit

https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html https://github.com/NVIDIA/nvidia-docker

Docker Ubuntu (work notes)

- 1 min read

Install on ubuntu 20.04

sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker

Network Explorer

- 1 min read

Finally I have a working version of the Network Explorer. This is a tool that allows me to draw the network topology of a network using SNMP.

Docker Context (work notes)

- 1 min read

Working on remote Docker Host using docker context

SSH keys

In order to use remote Docker host, as a prerequisite you need SSH enabled (required login using SSH keys).

Generate or find your public SSH key

If the file does not exist, generate the SSH key-pair using following command

ssh-keygen -t rsa -b 4096

Setting up SSH keys to remote machine

Copying your public ssh key to machine

You can use password-based authentication to get into linux machine for the first time, and then use the following command:

Docker Root (work notes)

- 2 mins read

Procedure

To relocate the Docker root directory, complete the following steps as root or a user with “sudo all” authority:

Stop the Docker services:

sudo -i

systemctl stop docker
systemctl stop docker.socket
systemctl stop containerd

Create the necessary directory structure into which to move Docker root by running the following command. This directory structure must reside on a file system with at least 50 GB free disk space. Significantly more disk space might be required depending on your daily ingestion volumes and data retention policy.

Drawing Rules

- 2 mins read

Today I’m using the same technique to draw the rules of the Fortinet devices.

It Looks pretty amazing.

This is a sample of the dot file generated by the parser.

digraph G {
fontname="Arial"
node [fontname="Arial"]
edge [fontname="Arial"]
graph [rankdir="LR",fontsize=9 ];
node [fontsize=9, shape=ellipse];
edge [lblstyle="above, sloped"];
subgraph "_default" {
  cluster=true;
  label="_default";
  style=filled;
  color=lightgrey;
  node [style=filled];
"src15";
"src25";
}
subgraph "VLAN 961" {
  cluster=true;
  label="VLAN 961";
  style=filled;
  color=lightgrey;
  node [style=filled];
"dst15";
"dst25";
}
src15 [
  shape=none
  label = <<table border="0" cellspacing="0">
  <tr>
   <td port="NET_USERS2" border="1" bgcolor="orange">NET_USERS2</td>
   <td>10.10.25.0/24</td>
  </tr>
</table>>
]
dst15 [
  shape=none
  label = <<table border="0" cellspacing="0">
  <tr>
   <td port="NET_IMPRESORAS" border="1" bgcolor="orange">NET_IMPRESORAS</td>
   <td>10.10.61.50-10.10.61.55</td>
  </tr>
</table>>
]
proto15 [
  shape=none
  label = <<table border="0" cellspacing="0">
  <tr>
   <td port="ALL" border="1" bgcolor="#BAB86C">ALL</td>
   <td border="1"></td>
  </tr>
</table>>
]
sec15 [
  shape=none
  label = <<table border="0" cellspacing="0">
  <tr>
   <td align="left" port="" border="1" bgcolor="#C0C0C0">schedule</td>
   <td align="left" border="1" bgcolor="#ffffff">always</td>
  </tr>
</table>>
]
"src15" -> "proto15" -> "sec15" -> "dst15" [label="lan2impresoras", fontsize=9, color="#A9A726"];
src25 [
  shape=none
  label = <<table border="0" cellspacing="0">
  <tr>
   <td port="NET_USERS2" border="1" bgcolor="orange">NET_USERS2</td>
   <td>10.10.25.0/24</td>
  </tr>
</table>>
]
dst25 [
  shape=none
  label = <<table border="0" cellspacing="0">
  <tr>
   <td port="SERVER1" border="1" bgcolor="#00f7ff">SERVER</td>
   <td>10.10.61.10</td>
  </tr>
</table>>
]
proto25 [
  shape=none
  label = <<table border="0" cellspacing="0">
  <tr>
   <td port="RDP" border="1" bgcolor="#E5E4E2">RDP</td>
   <td border="1">3389</td>
  </tr>
  <tr>
   <td port="Windows AD" border="1" bgcolor="#E5E4E2">Windows AD</td>
   <td border="1"></td>
  </tr>
  <tr>
   <td port="PING" border="1" bgcolor="#E5E4E2">PING</td>
   <td border="1"></td>
  </tr>
  <tr>
   <td port="IPERF" border="1" bgcolor="#E5E4E2">IPERF</td>
   <td border="1">5201</td>
  </tr>
</table>>
]
s_g125 [
  shape=none,
  label = <<table border="0" cellspacing="0">
  <tr>
   <td align="left" port="DCE-RPC" border="1" bgcolor="#fffde7">DCE-RPC</td>
   <td align="left" border="1">135</td>
  </tr>
  <tr>
   <td align="left" port="DNS" border="1" bgcolor="#fffde7">DNS</td>
   <td align="left" border="1">53</td>
  </tr>
  <tr>
   <td align="left" port="KERBEROS" border="1" bgcolor="#fffde7">KERBEROS</td>
   <td align="left" border="1">88 464</td>
  </tr>
  <tr>
   <td align="left" port="LDAP" border="1" bgcolor="#fffde7">LDAP</td>
   <td align="left" border="1">389</td>
  </tr>
  <tr>
   <td align="left" port="LDAP_UDP" border="1" bgcolor="#fffde7">LDAP_UDP</td>
   <td align="left" border="1"></td>
  </tr>
  <tr>
   <td align="left" port="SAMBA" border="1" bgcolor="#fffde7">SAMBA</td>
   <td align="left" border="1">139</td>
  </tr>
  <tr>
   <td align="left" port="SMB" border="1" bgcolor="#fffde7">SMB</td>
   <td align="left" border="1">445</td>
  </tr>
</table>>
]
{ rank=same; "s_g125" -> "proto25" [label="Windows AD", fontsize=8, penwidth=2, style=dotted]};
sec25 [
  shape=none
  label = <<table border="0" cellspacing="0">
  <tr>
   <td align="left" port="" border="1" bgcolor="#C0C0C0">schedule</td>
   <td align="left" border="1" bgcolor="#ffffff">always</td>
  </tr>
</table>>
]
"src25" -> "proto25" -> "sec25" -> "dst25" [label="lan2servidores", fontsize=9, color="#A9A726"];
}

Some times things that seems easy, tend to be more complicated than expected, and sometimes things that seems complicated, are actually easy.

I love simplicity. Yeah !!

Sure that there is some law about how things tend to compexity, but I’m not going to talk about that. The thing is with the time, and security risks, netkork rules in this devices are getting more and more complex.

I have been working with Fortinet devices for a while, and I have to say that they are very good devices. They have a lot of features, and they are very secure. But, as I said before, the rules are getting more complex, and sometimes is difficult to understand what is happening in the device.

I have been working on a project that requires me to draw a lot of switches. I’m using SNMP to get the information from the switches, and I’m using Python to draw the switches.

To do this, I have an small algorithm that reads the configuration of the switch and draws the switch in a SVG file.

In a json file I have the main network configuration,, something like this

BIM Workbench End

- 1 min read

It is time to move on to the next project. The BIM Workbench project is finished.

Was an incredible journey, I learned a lot about Autodesk Forge, Vue.js, Node.js, and the Revit API. I am very happy with the result, and I am looking forward to the next project.

Here are some videos of the project:

This part shows the integration with Power BI mixing all the data from the project, and showing it in a dashboard in Power BI. Everything at the same time that the user is working on the project in Revit.