linux – Unable to properly switch between the AMD integrated and Nvidia dedicated graphics in Ubuntu 20.04LTS

I have recently tried installing Ubuntu 20.04LTS on my ASUS Laptop and i am not able to switch between the AMD iGPU and Nvidia graphic card. My laptop specs are as follows:

inxi -GxxSMC System: Host: anshul-TUF-Gaming-FA506IH-FA506IH Kernel: 5.4.0-54-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: Gnome 3.36.4 wm: gnome-shell dm: GDM3 Distro: Ubuntu 20.04.1 LTS (Focal Fossa) Machine: Type: Laptop System: ASUSTeK product: TUF Gaming FA506IH_FA506IH v: 1.0 serial: <superuser/root required> Mobo: ASUSTeK model: FA506IH v: 1.0 serial: <superuser/root required> UEFI: American Megatrends v: FA506IH.311 date: 09/11/2020 CPU: Topology: 6-Core model: AMD Ryzen 5 4600H with Radeon Graphics bits: 64 type: MT MCP arch: Zen rev: 1 L2 cache: 3072 KiB flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 71863 Speed: 1392 MHz min/max: 1400/3000 MHz Core speeds (MHz): 1: 1398 2: 1397 3: 1397 4: 1397 5: 1389 6: 1397 7: 1398 8: 1396 9: 1397 10: 1397 11: 1397 12: 1397 Graphics: Device-1: NVIDIA vendor: ASUSTeK driver: nvidia v: 455.38 bus ID: 01:00.0 chip ID: 10de:1f99 Device-2: Advanced Micro Devices (AMD/ATI) Renoir vendor: ASUSTeK driver: amdgpu v: 5.6.0.20.20 bus ID: 05:00.0 chip ID: 1002:1636 Display: x11 server: X.Org 1.20.8 driver: amdgpu,ati,nvidia unloaded: fbdev,modesetting,nouveau,vesa compositor: gnome-shell resolution: 1920x1080~144Hz OpenGL: renderer: AMD RENOIR (DRM 3.37.0 5.4.0-54-generic LLVM 10.0.0) v: 4.6 Mesa 20.0.5 direct render: Yes

The problem is that i am unable to switch to Nvidia graphic card.

The drivers for the same are installed, this is the output of:
nvidia-smi

+-----------------------------------------------------------------------------+

| NVIDIA-SMI 455.38 Driver Version: 455.38 CUDA Version: 11.1 |
|——————————-+———————-+———————-+
| 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 GeForce GTX 1650 Off | 00000000:01:00.0 Off | N/A |
| N/A 37C P8 3W / N/A | 10MiB / 3911MiB | 0% Default |
| | | N/A |
+——————————-+———————-+———————-+

+—————————————————————————–+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 980 G /usr/lib/xorg/Xorg 4MiB |
| 0 N/A N/A 1586 G /usr/lib/xorg/Xorg 4MiB |
+—————————————————————————–+

In NVIDIA X Server Settings the application shows the following output:

NVIDIA X SERVER SETTINGS

Here the prime-select option is also not available al though prime-select is showing up in the terminal.

I am not able to run anything else on the dedicated. Everything by default is running on the Ryzen 5 integrated graphic that is the AMD Renoir i guess.

I am a student and his is my first time using linux. Please help me solve the issue.

Please let me know if there is anything else required.

c – Erro “cannot jump from switch statement to this case label” ao adicionar outro case ao meu switch

Estou tentando adicionar outro case ao meu switch, porem apresenta esse erro acima. já verifiquei e não falta nenhum break nos cases anteriores. Porem, se eu excluir somente o case anterior ele não mais apresenta esse erro. Abaixo segue o código do case anterior.

case 5:
      printf("nDigite o valor da Largura e Comprimento da sala de aula e a distancia minima em metros recomendada respectivameten");
    scanf("%f %f %f", &Largura, &Altura, &Distancia_Minima);
    Semanas_Para_Fechar_O_Ciclo = ceil ((float) Cont_Quantidade_Aluno(Aln) / ((Quantidade_Alunos_Sala(Altura, Largura, Distancia_Minima) - 1)));
    printf("nnA turma com %d aluno(s) do nao grupo de risco foi dividida em %d grupo(s) para que haja o distanciamento adequado na sala de aula levando em consideracao a area da sala de aula e a distancia minima entre duas carteiras, sera preciso uma quantidade de %d semana(s) para que todos os alunos tenham a mesma quantidade de aulann",Cont_Quantidade_Aluno(Aln), Semanas_Para_Fechar_O_Ciclo, Semanas_Para_Fechar_O_Ciclo);
    printf("nnO grupo de alunos do grupo de risco contem uma quantidade de %d aluno(s) e eles deverão assistir as aulas de forma remotann",Cont_Quantidade_Aluno(Alunos_Grupo_De_Risco));
    //printf("nnnn");
    //printf("nQuantidade de alunos cadastrados = %dn", Cont_Quantidade_Aluno(Aln));
    //printf("nQuantidade maxima de alunos menos o professor = %dn", Quantidade_Alunos_Sala(Altura, Largura, Distancia_Minima) - 1);
    //printf("nProporcao de alunos na turma = %dn", Semanas_Para_Fechar_O_Ciclo);
    char Alocacao(Semanas_Para_Fechar_O_Ciclo)(Quantidade_Alunos_Sala(Altura, Largura, Distancia_Minima) - 1)(41);
    Aloca_Turma(Aln, (Quantidade_Alunos_Sala(Altura, Largura, Distancia_Minima) - 1), Semanas_Para_Fechar_O_Ciclo, Alocacao);
    //int L = Semanas_Para_Fechar_O_Ciclo;
    //int C = (Quantidade_Alunos_Sala(Altura, Largura, Distancia_Minima) - 1);
    //printf("nnLinhas = %d Colunas = %d", L, C);
    //for(i = 0; i < Semanas_Para_Fechar_O_Ciclo; i++){
    //  printf("nnTurma de numero %dnn", (i+1));
    //  for (j = 0; j < (Quantidade_Alunos_Sala(Altura, Largura, Distancia_Minima) - 1); j++){
    //    printf("nnPosicao (%d)(%d)Alunos = %s nn",i,j, Alocacao(i)(j));
    //  }
    //}
    Imprime_Turma_Alocada(Semanas_Para_Fechar_O_Ciclo, (Quantidade_Alunos_Sala(Altura, Largura, Distancia_Minima) - 1), Alocacao, Dias_Letivo, Horario_Escolar);
    break;

pfsense – choose between multiple pppoe servers connected to the same switch

I have a big 48ports managed switch, on this switch there are connected two ONT/PON zyxel adapters over their eth port, each one is equipped with 1 / 500 Gbs fiber connectivity of the same ISP and two masks of public IPs that I need for my stuffs. The ISP gived to me 2 different pppoe credentials but same name service 1GB FIBRA

Les’s say that the first one is pppoe-server-1 and the second one is pppoe-server-2

Now on this particular switch I have two routers one is a mikrotik CCR and a second one is a pfsense box. What I want is to use the

mikrotik as pppoe client for pppoe-server-1

and the

pfsense box for pppoe-server-2.

what happens is that both mikrotik and pfsense authenticates on pppoe-server-1(probably because the provider gives to me the possibility to connect to each pppoe server through same credentials). So the questions is how can I choose beetween the pppoe servers? I have to use vlans? or maybe I can call the provider and ask for changing the service name?
many thanks

Switch Between 2 profiles on android during device unlock

I have 2 profiles setup on my device as shown here

https://www.howtogeek.com/333484/how-to-set-up-multiple-user-profiles-on-android/

However the switching of accounts as shown here is cumbersome. Is there any app/ approach where I can enter something to unlock phone(separate pin) that will load the profiles appropriately.I sometimes hand over my phone to family and don’t and switching profiles after unlocking takes too long.

i did a master reset on my LG K51 cell phone now im trying to figure out how to remove the kill switch or by pass it which every one is easier

im just trying to get read of the kill switch on my LG K51 phone or by pass it so i can use this cell without having to send it off and spend 48$

centos – Switch from existing firewalld configuration to nftables

I’m running a low-RAM VPS with CentOS 8. I’ve noticed that firewalld service uses way too much RAM (up to 20%). So I guess it may be better to switch to use only built-in nftables.

I’m quite familiar with old iptables as well as firewalld syntax.
However, I’m not familiar with nftables syntax and configuration (and currently I cannot afford learning it and manual rewrite due to time restrictions).

Is it possible to export existing firewalld rules so nftables would be using them “directly” and it will be possible to completely disable firewalld service?

P.S. Will it be possible for fail2ban to work with nftables directly in such configuration?

Case statements in SWITCH statements in Google Sheets

What you should actually use is the IFS function instead

=IF(LEN(A2),IFS(A2<=60, "F", A2<=70, "D", A2<=80, "C", A2<=90, "B", A2<=100, "A"),"Unknown")

Using the extra function ArrayFormula we apply the same formula to each row for the whole range

=ArrayFormula(IF(LEN(A2:A), 
    IFS(A2:A<=60, "F", A2:A<=70, "D", A2:A<=80, "C", A2:A<=90, "B", A2:A<=100, "A"),""))  

enter image description here

networking – How to auto switch WIFI Router based on internet connectivity?

I have two internet connections at my home, one from Airtel and another from FusionNet. Both ISPs are providing internet via Router. But at random times one of the link is down and devices connected to respective Router are unable to access Internet.

What I want now is a device or something, so that devices can auto connect to the router which has internet connectivity.

Any thought on the same appreciable.

Currently on a VPS (MVPS-1) at Knownhost, but it seems overkill. Switch to Reseller?

My main site is a WordPress Multisite (with wildcard subdomain creation in the control panel). This is the main one I need speed and stabili… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1825840&goto=newpost

catalina – When does macOS switch between light and dark mode?

MacOS Catalina added support for automatic light and dark mode switching.

Sample settings screen

The support article linked above reads:

Auto (available in macOS Catalina): Automatically use the light appearance during the day, and the dark appearance at night.

This doesn’t seem to quite capture my experience though, so I’m wondering what the exact algorithm is here.

For example, where I’m currently situated today:

  • in my city, the sun sets 18:46 according to Google
  • in the capital of the country, it sets at 18:43 according to Google
  • my theme switched from light to dark at 18:57

Is this due to simply different services used by Google and Apple for determining the sunset, or is there more to the switching algorithm than meets the eye?