Ubuntu HowTo: How can I get my my system to recognise my aditional PCIE graphics card?

Original Source Link

I have just upgraded my system to 20.04 and my system does not recognise my ATI Radeon R7 240 PCIE graphics card.

This is the output:

$ lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b5)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation H61 Express Chipset LPC Controller (rev 05)
00:1f.2 IDE interface: Intel Corporation 6 Series/C200 Series Chipset Family Desktop SATA Controller (IDE mode, ports 0-3) (rev 05)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)
00:1f.5 IDE interface: Intel Corporation 6 Series/C200 Series Chipset Family Desktop SATA Controller (IDE mode, ports 4-5) (rev 05)
02:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 04)
03:04.0 Multimedia audio controller: C-Media Electronics Inc CMI8788 [Oxygen HD Audio]
04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 09)

Tagged : / / /

Server Bug Fix: How do I plot a series of disks in the center of each hexagon?

Original Source Link

I am trying to put a series of disks at the center of each hexagon, but I could center only 1.
How do I center all of the disks at the center of each hexagon?

Here is the code I am using.

h[x_, y_] := Polygon[Table[{Cos[2 Pi k/6] + x, Sin[2 Pi k/6] + y}, {k, 6}]]
p1 = Graphics[{EdgeForm[Opacity[.7]], White, Table[h[3 i + 3 ((-1)^j + 1)/4, Sqrt[3]/2 j], {i, 0, 1}, {j, 0,3}]}];
Show[p1, Table[Graphics[Disk[{i, j}, {0.25, 0.25}]], {i, 0, 2, 1.5}, {j, 0, 2, 1.5}]]

Here is my result:

enter image description here

Just reuse the expression for the x and y components that you used when centering the hexagons:

Table[
 Graphics[Disk[{3 i + 3 ((-1)^j + 1)/4, Sqrt[3]/2 j}, {0.25, 0.25}]],
 {i, 0, 1},
 {j, 0, 3}
 ]

This gives you:

enter image description here

Clear["Global`*"]

You can use CirclePoints to define the Polygon

h[x_, y_] := Polygon[{x, y} + # & /@ CirclePoints[6]]

EDIT: As pointed out in the comment by J.M., using RegularPolygon this can be simplified to

h[x_, y_] := RegularPolygon[{x, y}, 1, 6]

The common center points are

ctrs = Table[
    {3 i + 3 ((-1)^j + 1)/4, Sqrt[3]/2 j},
    {i, 0, 1}, {j, 0, 3}] //
   Flatten[#, 1] &;

Map Polygon and Disk onto the centers.

Graphics[{
  EdgeForm[Opacity[.7]], {
     White, h @@ #,
     Black, Disk[#, 0.25]} & /@
   ctrs}]

enter image description here

1. You can post-process your p1 to add disks at RegionCentroid of polygons:

p1 /. p_Polygon:> {p, FaceForm[Black], Disk[RegionCentroid @ p, {1, 1} / 4]}

enter image description here

2. Alternatively, you can create a single disk/hexagon pair centered at {0, 0}

prims = {Black, Scale[Disk[], {1, 1}/4], 
   EdgeForm[Gray], FaceForm[], RegularPolygon[{0, 0}, 1, 6]};

and Translate it using centers:

centers = {3 # + 3 (1 + (-1)^#2)/4, Sqrt[3] #2/2} & @@@ 
   Tuples[{{0, 1}, Range[0, 3]}];


Graphics[Translate[prims, #] & /@ centers]

enter image description here

Tagged :

Ubuntu HowTo: Install the correct Nvidia driver version for NVIDIA CUDA Toolkit

Original Source Link

I have installed Ubuntu on, but now I am trying to install NVIDIA CUDA Toolkit for the GPU. When I install it, it says that there is no driver found, so I have tried to install the driver, but I don’t know why after installation, the system not coming up. Maybe it is because of the wrong version of the driver.

When I tried to detect the driver version using sudo lshw -C display , it showed this information:

enter image description here

But here it doesn’t say that what is the product name of the driver, and also when I go Software & Updates -> Additional Drivers, then it says NVIDIA Corporation: Unknown.

enter image description here

What should I do?

Sorry about posting this as an answer, I’m not able to post a comment to ask you this. Can you show the output of sudo lspci | grep -i nvidia? That might show what GPU it is.

edit: I don’t think this is a duplicate. the output of lshw would typically have the name of the GPU, which you could use to install the right driver. Here’s what it would usually look like:


  *-display                 
       description: VGA compatible controller
       product: GK107GL [Quadro K420]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: [email protected]:02:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nouveau latency=0
       resources: irq:49 memory:fa000000-faffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:e000(size=128) memory:c0000-dffff

From the Software and Updater/Alternative Drivers tab:

  1. Click on the Nvidia binary driver (384.111, should say “tested”)
  2. Then click on the “Apply Change” button. Wait for the installation to finish.
  3. Reboot and use the command:

    lshw -c video

    to ensure the Nvidia driver is used (should say driver=nvidia).

    Login problems may result from a “nomodeset” left in the grub.cfg file — edit it out of the grub boot commands to successfully boot (type e, instructions at bottom of grub screen). Permanently fix grub by editing the /etc/default/grub file and remove the “nomodeset” wherever it appears. Leftover dot files (those beginning with a “.”) in your home directory may also cause login problems after installing the Nvidia drivers. These dot files are normally hidden in directory listings, but are shown when the -a is used for the ls command:

    ls -a

    Move them to a directory to save them and let them be recreated as needed.

    cd
    mkdir tmphold
    mv .Xauthority .cache .config .local tmphold

    Pull any pieces out of the saved copied if necessary. .Xauthority, .cache, .config and .local are the prime candidates for holding leftover configuration information.

Once the Nvidia drivers are installed and working, just install the cuda deb from the Intel site. Do check that your hardware is compatible with CUDA 9.1. You might need to use CUDA 8.0 which has lower requirements. Download the CUDA deb
Intel CUDA download page and the patches offered. Follow the instructions in step one, copied below:

`sudo dpkg -i cuda-repo-ubuntu1604-9-1-local_9.1.85-1_amd64.deb`
`sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub`
`sudo apt-get update`
`sudo apt-get install cuda`

The last step installs the cuda package(s) from the Ubuntu repositories.

Tagged : / / /

Ubuntu HowTo: OBS NVENC Doesn’t work Out of Box on 20.04?

Original Source Link

I just installed Kubuntu 20.04 and OBS,but NVENC doesn’t seem to work for some reason even though I have nvidia-driver-390 installed and configured via System Settings.

Settings:

Settings

Error on Start Recording:

Error

System Settings:

System Settings

How can I restore OBS’s hardware NVENC support?

Hardware Specs:

[email protected]:~$ inxi -Fx
System:    Host: LesserArk Kernel: 5.4.0-31-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: KDE Plasma 5.18.5 
           Distro: Ubuntu 20.04 LTS (Focal Fossa) 
Machine:   Type: Laptop System: Hewlett-Packard product: HP ENVY 17 Notebook PC v: 097E110000405E00000620100 
           serial: <superuser/root required> 
           Mobo: Hewlett-Packard model: 1968 v: KBC Version 93.52 serial: <superuser/root required> UEFI: Insyde v: F.70 
           date: 10/20/2017 
Battery:   ID-1: BAT0 charge: 41.2 Wh condition: 41.2/41.2 Wh (100%) model: Hewlett-Packard Primary status: Full 
CPU:       Topology: Quad Core model: Intel Core i7-4702MQ bits: 64 type: MT MCP arch: Haswell rev: 3 L2 cache: 6144 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 35120 
           Speed: 2050 MHz min/max: 800/3200 MHz Core speeds (MHz): 1: 2050 2: 2152 3: 2027 4: 2090 5: 2067 6: 2128 7: 1956 
           8: 2096 
Graphics:  Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: Hewlett-Packard driver: i915 v: kernel 
           bus ID: 00:02.0 
           Device-2: NVIDIA GK107M [GeForce GT 750M] vendor: Hewlett-Packard driver: nvidia v: 390.132 bus ID: 01:00.0 
           Display: x11 server: X.Org 1.20.8 driver: modesetting,nvidia unloaded: fbdev,nouveau,vesa 
           resolution: 1920x1080~60Hz, 1920x1080~75Hz 
           OpenGL: renderer: GeForce GT 750M/PCIe/SSE2 v: 4.6.0 NVIDIA 390.132 direct render: Yes 
Audio:     Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio vendor: Hewlett-Packard driver: snd_hda_intel 
           v: kernel bus ID: 00:03.0 
           Device-2: Intel 8 Series/C220 Series High Definition Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel 
           bus ID: 00:1b.0 
           Sound Server: ALSA v: k5.4.0-31-generic 
Network:   Device-1: Intel Wireless 7260 driver: iwlwifi v: kernel port: 5000 bus ID: 07:00.0 
           IF: wlp7s0 state: up mac: e4:70:b8:f8:99:b8 
           Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Hewlett-Packard driver: r8169 v: kernel 
           port: 3000 bus ID: 0f:00.0 
           IF: eno1 state: up speed: 1000 Mbps duplex: full mac: a0:1d:48:fa:67:c0 
           IF-ID-1: tun0 state: unknown speed: 10 Mbps duplex: full mac: N/A 
Drives:    Local Storage: total: 3.21 TiB used: 1.18 TiB (36.8%) 
           ID-1: /dev/sda vendor: Toshiba model: MQ01ABD100 size: 931.51 GiB 
           ID-2: /dev/sdb vendor: LITE-ON IT model: LMS-24L6M-HP size: 22.37 GiB 
           ID-3: /dev/sdc vendor: Seagate model: ST2000LM015-2E8174 size: 1.82 TiB 
           ID-4: /dev/sdd vendor: Samsung model: SSD 860 EVO 500GB size: 465.76 GiB 
           ID-5: /dev/sde type: USB vendor: SanDisk model: U3 Cruzer Micro size: 1.91 GiB 
           ID-6: /dev/sdf type: USB vendor: SanDisk model: Gaming Xbox 360 size: 7.48 GiB 
RAID:      Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci v: 3.0 bus ID: 00:1f.2 
Partition: ID-1: / size: 398.61 GiB used: 208.93 GiB (52.4%) fs: btrfs dev: /dev/sdd2 
           ID-2: /home size: 398.61 GiB used: 208.93 GiB (52.4%) fs: btrfs dev: /dev/sdd2 
           ID-3: swap-1 size: 14.90 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sdd3 
Sensors:   System Temperatures: cpu: 63.0 C mobo: 60.0 C gpu: nvidia temp: 55 C 
           Fan Speeds (RPM): N/A 
Info:      Processes: 466 Uptime: 1h 34m Memory: 15.57 GiB used: 7.12 GiB (45.7%) Init: systemd runlevel: 5 Compilers: 
           gcc: 9.3.0 Shell: bash v: 5.0.16 inxi: 3.0.38 

I installed Ubuntu 20.04 on a fresh machine last night. I did not install an NVidia driver from the NVidia website but rather used the one provided as additional drivers like you did

enter image description here

The OBS installation was done as outlined in the installation steps on the wiki, which means first installing FFmpeg and then adding the obs ppa.
Here, NVENC is working out of the box.

In the past on Ubuntu 16.04, I had to compile everything myself (FFmpeg and all its dependencies and then obs) to get NVENC working. The versions I’m using right now are

ffmpeg/focal,now 7:4.2.2-1ubuntu1 amd64 [installed]
obs-studio/focal,now 25.0.8-0obsproject1~focal amd64 [installed]

The difference I notice is that I’m using a more recent NVidia driver. Maybe this helps you to debug the issue.

Tagged : / / / /

Ubuntu HowTo: How to get OpenCL working with AMD GPU on Ubuntu 18.04

Original Source Link

I have tried several attempts but without success. AMDGPU-PRO 17.40, 17.50, ROCm, Oibaf PPA, Kernel 4.16 and something more, but nothing makes OpenCL working with the AMD card and clinfo never gives right results.

Can I only wait the next AMDGPU-PRO driver compatible with Ubuntu 18.04 or could I do something different?

You can try to install their experimental driver from here:

https://support.amd.com/en-us/kb-articles/Pages/Radeon-Software-for-Linux-18.20-Early-Preview-Release-Notes.aspx

Hope it works for you

I’m in the same boat – for completeness here is the thread I started.
@Mods, please consolidate if it makes sense to do so.

Intel/AMD Hybrid graphics Ubuntu 18.04

Tagged : / / /

Ubuntu HowTo: Can i use different cards for 3 same displays?

Original Source Link

I am running Ubuntu 18.04 on a 6 core AMD CPU, and a GeForce GT610 rev. A1 graphic to which i have connected two display (2 same HP monitors).

I need to use a third monitor and from researching it seems that I need add another graphic card.

Let’s assume that there is room on the motherboard, the question that i have is this: can i use two different graphic cards to be able to use three identical HP monitors (used independently from each other not to create one long display) or the graphic cards have to be the same?

Currently i have a GeForce GT610, and i saw the GeForce GT710 on sale but the two have different memory capacity (1GB vs 2GB).

Does Ubuntu work fine with 2 graphic cards? Also, will i need to do any coding to be able to use a third monitor? Or i can just install the second card and connect the third monitor?

Tagged : / /

Ubuntu HowTo: How can I avoid seeing fragments of my pre-reboot screen after a reboot?

Original Source Link

Every time I reboot my computer, after entering my password and pressing enter, I briefly see jumbled fragments of my screen as it was right before I rebooted. I’m a bit concerned about this from a privacy/security standpoint, as it means that any information that was on the screen when I rebooted is potentially available for someone to see after rebooting. Is there any way I can prevent this from happening, for example by having Ubuntu forcibly clear/overwrite the GPU memory during shutdown?

Note: I don’t use Wayland because of several disruptive issues it has, so I use X11 for both the login screen and my session.

I originally installed this system as Kubuntu 19.10, but I have since upgraded to 20.04 and switched everything to “regular” Ubuntu as much as possible, including boot animation, GDM3 as login screen, and GNOME 3 as my login session. In case it matters, the CPU is a AMD Ryzen 7 3700X, and the GPU is an AMD Radeon RX 5700 XT.

Tagged : / /

Ubuntu HowTo: How to update graphics drivers on ubuntu?

Original Source Link

I’m trying to get Blender 2.8 and Unity Game Engine to work on my Ubuntu laptop but I keep getting errors related to my graphics driver. The main problem seems to be that I need OpenGL 3.3. Is there any way to update this?
Blender gives the following error:

Error! Unsupported graphics card or driver.
A graphics card and driver with support for OpenGL 3.3 or higher is required.
The program will now close.

Unity gives the following error:

Fatal Error: Failed to initialize Unity graphics

Some info:

$sudo lshw -c video

  *-display                 
   description: VGA compatible controller
   product: Park [Mobility Radeon HD 5430/5450/5470]
   vendor: Advanced Micro Devices, Inc. [AMD/ATI]
   physical id: 0
   bus info: [email protected]:01:00.0
   version: 00
   width: 64 bits
   clock: 33MHz
   capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
   configuration: driver=radeon latency=0
   resources: irq:16 memory:a0000000-afffffff memory:c4400000-c441ffff ioport:3000(size=256) memory:c4440000-c445ffff

  *-display
   description: VGA compatible controller
   product: Core Processor Integrated Graphics Controller
   vendor: Intel Corporation
   physical id: 2
   bus info: [email protected]:00:02.0
   version: 02
   width: 64 bits
   clock: 33MHz
   capabilities: msi pm vga_controller bus_master cap_list rom
   configuration: driver=i915 latency=0
   resources: irq:30 memory:c0000000-c03fffff memory:b0000000-bfffffff ioport:4050(size=8) memory:c0000-dffff

$lspci -nnk | grep -i vga -A3 | grep 'in use'

    Kernel driver in use: i915
    Kernel driver in use: radeon

$lspci -k | grep -EA3 'VGA|Display|3D'

    00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)
    Subsystem: Hewlett-Packard Company Core Processor Integrated Graphics Controller
    Kernel driver in use: i915
    Kernel modules: i915
--
    01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Park [Mobility Radeon HD 5430/5450/5470]
    Subsystem: Hewlett-Packard Company Park [Mobility Radeon HD 5430/5450/5470]
    Kernel driver in use: radeon
    Kernel modules: radeon

$glxinfo | grep OpenGL

    OpenGL vendor string: Intel Open Source Technology Center
    OpenGL renderer string: Mesa DRI Intel(R) Ironlake Mobile 
    OpenGL version string: 2.1 Mesa 19.2.8
    OpenGL shading language version string: 1.20
    OpenGL extensions:
    OpenGL ES profile version string: OpenGL ES 2.0 Mesa 19.2.8
    OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
    OpenGL ES profile extensions:

Tagged : / /

Ubuntu HowTo: How can I change the screen (graphics card) that the system uses when booting and disable the other one?

Original Source Link

I’ve got a triple boot system going on with Windows, Ubuntu and Mac. (It is a hackintosh).
I’ve got a problem, that is, my dedicated graphics card (Nvidia GTX 1660) isn’t supported by Mac, so I wanted to boot Mac with the integrated graphics card of my processor (Intel i7 6700).

What I did is, as my screen has both a DVI input and a HDMI input, I plugged both a DVI to HDMI wire and a HDMI to HDMI wire to it, then one goes to the HDMI output of my dedicated card and the other one to the output of the motherboard (integrated one).

I have the Intel as the main card, but the system boots with both, in Mac it’s not a problem since I have it configured so it doesn’t recognize the Nvidia.

On the other hand, Windows thought I had 2 screens as it recognized both adapters, so I disabled the integrated card in it and now it uses the Nvidia card for everything (booting etc).

I have a problem when I boot Ubuntu though, it recognizes 2 screens, my screen loads the Nvidia Input (Screen 0 recognized by Ubuntu) but for some reason the login is on the other one (Screen 1). I’ve told it to just use Screen 1 in the settings, and it does when I have logged in, but outside of (at login) it it’s still showing extended screens.

Is there a way I can force that setting accross all the system so it is like that when it boots and gets into the login too?

Thanks in advance!

I’ve found the solution here: Ubuntu 18.04 login screen Display settings

You have to change your settings as desired with your user logged in and then perform this two commands in the terminal:

sudo cp ~/.config/monitors.xml ~gdm/.config/monitors.xml

sudo chown gdm:gdm ~gdm/.config/monitors.xml

Tagged : / / /

Ubuntu HowTo: Is intel-virtual-output a saviour tool? [closed]

Original Source Link

What I mean is that can this be used to solve the eternal problem of hybrid graphcs laptop + external monitor? Can this be used to power an external display in Hybrid Graphics mode? Also, are there any caveats in using this, as in performance?

To explain a little a further, I’m using an HP gaming laptop that’s unfortunately an nVidia Optimus laptop. As a result, the HDMI output is wired to the nVidia discrete GPU; meaning I can’t use my Intel iGPU to power my external monitor. Even if I use a USB Type-C to HDMI cable, the Intel iGPU can’t recognize my monitor. Afer months of desperation, I found this potential solution, but unfortunatrly, it seems like a lot of people don’t know much about it.

If this doesn’t work, I guess I’ll have to return to Windows. nVidia is really, such a b-word.

You need to check this by yourself.

Documents to read more about the intel-virtual-output:

Using mate-optimus on Ubuntu MATE may help too.

Tagged : / / /