Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2024-03-28 11:55:58



Reply to topic  [ 6 posts ] 
Running Cool VL viewer on nvidia optimus laptops 
Author Message

Joined: 2009-03-18 09:32:02
Posts: 246
Reply with quote
I have a diff for the startup script that enables bumblebee or nvidia prime render offloading on laptops with that hardware.

https://build.opensuse.org/package/view ... h?expand=1

cheers


2020-06-18 08:54:52
Profile YIM WWW

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
Thank you.

Care to elaborate what it does exactly ?...

Not having any such hardware here, and not knowing anything about "Optimus", "Bumblebee" & Co, it is hard for me to figure out whether this could, for example, have negative side effects on some systems...

EDIT: there also seem to be issues:
  • What is LL_BUMBLEBEE ?... It is not set (or commented about) elsewhere in the script and does not look very much like an NVIDIA environment variable...
  • The "-p" option after 'type' should be "-P" (else nothing will be returned since no path search will be done and there won't be any hashed binary name populated in a fresh bash session).
  • In the xrandr test, you assume that the non-integrated GPU is NVIDIA but what about AMD/ATI ?... What about systems with 3 or more GPUs (you test only for 2) ?
  • Since you use LL_WRAPPER (normally reserved for debugging), launching a debug session with --debug would overwrite it.


2020-06-18 15:24:32
Profile WWW

Joined: 2009-03-18 09:32:02
Posts: 246
Reply with quote
Henri Beauchamp wrote:
Thank you.

Care to elaborate what it does exactly ?...


What it does is to check if the viewer is running on a computer with nvidia optimus hardware, and if so, activate the installed driver for it.

Henri Beauchamp wrote:
Not having any such hardware here, and not knowing anything about "Optimus", "Bumblebee" & Co, it is hard for me to figure out whether this could, for example, have negative side effects on some systems...


It shouldn't, I've had that in Dolphin Viewer for years and noone ever complained...

Anyway: Optimus is what nvidia calls those setups for laptops, an intel integrated GPU for normal rendering, and an additional NVidia chip for 3d work.
Bumblebee is the old way of dealing with this on linux, prime render offloading is the new way.

Henri Beauchamp wrote:
EDIT: there also seem to be issues:
  • What is LL_BUMBLEBEE ?... It is not set (or commented about) elsewhere in the script and does not look very much like an NVIDIA environment variable...
  • The "-p" option after 'type' should be "-P" (else nothing will be returned since no path search will be done and there won't be any hashed binary name populated in a fresh bash session).
  • In the xrandr test, you assume that the non-integrated GPU is NVIDIA but what about AMD/ATI ?... What about systems with 3 or more GPUs (you test only for 2) ?
  • Since you use LL_WRAPPER (normally reserved for debugging), launching a debug session with --debug would overwrite it.


  • LL_BUMBLEBEE is a way to override what wrapper script to use. You're right, some comment or other documentation would be good.
  • on openSUSE "type -p" and "type -P" are the same...
  • Yes I am. I don't have ATI, nor am I planning to ever touch ATI again. and 3 GPUs... well, in theory you have a point, in real life this is for laptops, and I don't think there are any laptops with more than two GPUs...
  • True, this does not work for --debug, but then this is meant for end users. Also, back in the days of snowglobe / dolphin viewer I've never done any development or debugging on my laptop...

Cheers
LC


2020-06-18 18:24:18
Profile YIM WWW

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
Lance Corrimal wrote:
  • on openSUSE "type -p" and "type -P" are the same...
Quoted from 'man type' (bash v5.0.11 built-ins manual):
Code:
If the -p option is used, type either returns the name of the disk file that would be executed if name were specified as a command name, or nothing if ``type -t name'' would not return file.  The -P option forces a PATH search for each name, even if ``type -t name'' would not return file.  If a command is hashed, -p and -P print the hashed value, which is not necessarily the file that appears  first in PATH.
And here is what I get here, when searching for 'ls' with 'type' from a terminal running bash:
Code:
root:~# type -p ls
root:~# type -P ls
/bin/ls
But there are so many flavours of 'bash' running under Linux (not to mention non-bash shells soft-linked as '/bin/bash' in some distros), that it is best not relying on uncommon built-ins and instead use well known UNIX commands that are implemented the same everywhere. 'which' is the command to use in place of 'type' here: it's universal and does what you need without obscure/fancy command line switches. :P

Lance Corrimal wrote:
  • Yes I am. I don't have ATI, nor am I planning to ever touch ATI again. and 3 GPUs... well, in theory you have a point, in real life this is for laptops, and I don't think there are any laptops with more than two GPUs...
BUT, the viewer does not only run on NVIDIA equipped PCs, and not only on laptops, so we need code that can deal even with desktop computers/workstations, possibly with 3 GPUs (or more): two cards in SLI (or CrossFire) + an iGPU (most Intel desktop CPUs got an iGPU) would most likely (I did not test it) be reported as three providers by "xrandr --listproviders"...

As for PRIME, I was under the impression that it was sort of built inside the NVIDIA drivers and that all you had to do is to set some fancy environment variables, the ones you used in your patch, but with "NVIDIA-0" (or NVIDIA-n, as reported by xrandr) instead of "nvidia"...


2020-06-18 19:28:42
Profile WWW

Joined: 2009-03-18 09:32:02
Posts: 246
Reply with quote
you were right about the type command, I'm going to rework my wrapper script a bit.

anyway, yes, for prime all you have to do is set those variables, which is what my wrapper does.
for optimus, it attempts to figure out which wrapper script to use, and then uses it.

For any system with more than two graphics cards: ... well... normally that would be a system with an onboard intel GPU and either dual NVIDIA or dual AMD cards in SLI or whatever AMD calls it.

In such a setup the onboard card should be disabled in your BIOS, and the crossfire / sli setup should report as only one card, if i'm not mistaken...

and as far as laptops go, I don't really think there will be a laptop with more than two GPUs anyway.

Still, I'm going to change my wrapper to the extent that the user can override everything I'm trying to do just by setting the right variables.

For example, is you have your own wrapper for optimus, you can already run the viewer like this:
Code:
LL_BUMBLEBEE=/home/frankenstein/bin/my_optimus_wrapper.sh CoolVLViewer


So all I need is to set the prime vars only IF there's a prime setup, and only IF they are empty. Should be simple enough.

In any case, my additions to the wrapper script already work without issues on regular desktop PCs.

Cheers
LC


2020-06-22 07:45:49
Profile YIM WWW

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
Lance Corrimal wrote:
In such a setup the onboard card should be disabled in your BIOS
Not at all !
Mind you, I have desktop PCs with both iGPU and GPU active: the iGPU can be used on a second screen and/or as an additional OpenCL device for calculations (e.g. for rendering in blender).

Quote:
and the crossfire / sli setup should report as only one card, if i'm not mistaken...
It would likely depend on your X11 configuration (for a multi-screen setup, you might want to be able to use the GPUs on different screens and also to have them cooperating in SLI/CrossFire when playing power-hungry games), but I cannot confirm or infirm, since I do not have such a system here.

Quote:
and as far as laptops go, I don't really think there will be a laptop with more than two GPUs anyway.
Again, laptops are not the only (and not even the main) target of my viewer which must run on any PC with sufficient hardware.


2020-06-22 08:41:04
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.