{"id":1445,"date":"2022-06-03T14:18:03","date_gmt":"2022-06-03T14:18:03","guid":{"rendered":"https:\/\/www.ridiculously-simple.com\/?p=1445"},"modified":"2022-06-03T16:23:18","modified_gmt":"2022-06-03T16:23:18","slug":"debian-11-on-laptop-with-nvidia-optimus","status":"publish","type":"post","link":"https:\/\/www.voodoo.business\/blog\/2022\/06\/03\/debian-11-on-laptop-with-nvidia-optimus\/","title":{"rendered":"Debian 11 on laptop with nVidia optimus"},"content":{"rendered":"\n<p>This is a short one, just a quick referance to have your system optimized for both efficiency and performance<\/p>\n\n\n\n<p>This laptop which has had a fresh Debian Bullseye installed has both an nVidia card alongside the intel card, to find out what cards your system is running, you could start with the command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo lspci<\/pre>\n\n\n\n<p>00:02.0 VGA compatible controller: Intel Corporation HD Graphics 620 (rev 02)<br>01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)<\/p>\n\n\n\n<p>Or you could simply get the relevant data with<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>lshw -c video<\/code><\/pre>\n\n\n\n<p>This is a 7th generation intel CPU, namely the &#8220;Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz&#8221;<\/p>\n\n\n\n<p>Let us start by installing the nVidia drivers from nvidia, in my case, i installed the detection script followed by nvidia-drivers package from the non-free repositories<\/p>\n\n\n\n<p>If your CPU is post 2007, Make sure you do not install &#8220;xserver-xorg-video-intel&#8221;, if it is already installed remove it ! we want xserver-xorg-core to manage the intel graphics<\/p>\n\n\n\n<p>Install nvidia primus<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-get install primus<\/pre>\n\n\n\n<p>Once that is setup, to figure out which card is being used as the main one, you can run<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">glxinfo|egrep \"OpenGL vendor|OpenGL renderer\"<\/pre>\n\n\n\n<p>To execute the command with the nvidia card and check if it is being used, execute it in the following way<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">primusrun glxinfo|egrep \"OpenGL vendor|OpenGL renderer\"<\/pre>\n\n\n\n<p>Now, without the primusrun you should get intel, with the primusrun, you should see nvidia<\/p>\n\n\n\n<p>Now, you know the system is taking care of what is running which application correctly, I will follow with more information once i have the time.<\/p>\n\n\n\n<p>To instruct the system to use your nvidia card to play a video, you can execute something like<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">primusrun totem<\/pre>\n\n\n\n<p>(this will force it to use your nvidia card)<\/p>\n\n\n\n<p>Another command that will show you the utilization of your nvidia GPU (Mine is mostly 0 percent as I am not running anything with a primusrun prefix)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>nvidia-smi<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is a short one, just a quick referance to have your system optimized for both efficiency and performance This laptop which has had a fresh Debian Bullseye installed has both an nVidia card alongside the intel card, to find out what cards your system is running, you could start with the command sudo lspci [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1445","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/1445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/comments?post=1445"}],"version-history":[{"count":6,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/1445\/revisions"}],"predecessor-version":[{"id":1452,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/1445\/revisions\/1452"}],"wp:attachment":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/media?parent=1445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/categories?post=1445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/tags?post=1445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}