[elrepo] nvidia-detect feature enhancement

Phil Perry phil at elrepo.org
Mon Feb 16 17:48:35 EST 2015


On 16/02/15 20:29, Manuel Wolfshant wrote:
> On 16 februarie 2015 20:38:40 EET, Bonnie King <bonniek at fnal.gov> wrote:
>>>
>>> Updated packages (nvidia-detect-346.35-2) are currently syncing to
>> the
>>> mirrors and should be available shortly from the elrepo testing
>> repository:
>>>
>>> yum --enablerepo=elrepo-testing update nvidia-detect
>>>
>>> I'd appreciate if folks could test and confirm they work as expected.
>> On
>>> my el5 desktop system:
>>
>> With multi-GPU cards, two lines are printed:
>>
>> [root at host ~]# nvidia-detect
>> kmod-nvidia-304xx
>> kmod-nvidia-304xx
>>

Ack.

>> [root at hody ~]# lspci |grep -v vga
>> 04:00.0 VGA compatible controller: nVidia Corporation NV43 [Quadro NVS 
>> 440] (rev a2)
>> 05:00.0 VGA compatible controller: nVidia Corporation NV43 [Quadro NVS 
>> 440] (rev a2)
>>
>> I was of two minds on this, and printing both is probably the correct 
>> thing to do, but this explains why in my original 
> If the GPUs are identical, I'd print only one line
> 

I only have one machine, an old Intel based laptop, that returns 2 entries:

[phil at xps-pc ~]$ nvidia-detect -v
Probing for supported NVIDIA devices...
[8086:2a02] Intel Corporation Mobile GM965/GL960 Integrated Graphics
Controller (primary)
[8086:2a03] Intel Corporation Mobile GM965/GL960 Integrated Graphics
Controller (secondary)
No NVIDIA devices were found.


I think returning verbose output for all detected adapters is the right
thing to do.

>> patch terse_output() 
>> prints according nv_lookup_device_id()'s return code.
>>
>> Of course this breaks if you had two different GPU versions in the 
>> system (I don't have any examples of that, and you wouldn't be able to
>> probe both module versions at once, right?)...
> Excellent question !
> I might be able to test that config... assuming the old old old very old nvidia cards are supported. I have to check the cartons with old hardware and see if any of those deprecated video cards fit into one of the new computers.... most of which have integrated ATI video
> 
> 
> 
>>
>> My reasoning was that one-line output is nicer, and that the output 
>> you'll get is as reliable as the program's exit code.
>>
>> Thoughts?
> Would it help if I tried the above mentioned dual card setup (assuming that I do have compatible hardware, which I am not sure that is true ) ?
> 

I think Bonnie is right. IMHO non-verbose mode should only return one
driver value and it MUST be the same as the program exit code. The
program exist code returns the value found for the last NVIDIA device
detected as it loops through all video class devices, therefore the
driver string should match the program exit code. If we were to break
out of the loop after detecting the first NVIDIA device having printed
that string we could potentially return two conflicting values in cases
where the supported driver were different (should that be possible).

Commit to fix here:

https://github.com/elrepo/packages/commit/3af8a57a1bde630946041b8ef1fc4c7bb00b0543

Phil




More information about the elrepo mailing list