Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in nvidia gpu detection logic #120

Open
ireed opened this issue Aug 22, 2023 · 2 comments
Open

bug in nvidia gpu detection logic #120

ireed opened this issue Aug 22, 2023 · 2 comments

Comments

@ireed
Copy link

ireed commented Aug 22, 2023

The method for GPU detection does not handle all cases.
From the code in moonray/moonray/lib/rendering/rt/gpu/GPUUtils.cc:

    FILE *fp = fopen("/proc/driver/nvidia/version", "r");
    if (fp != NULL) 
        if (fscanf(fp, "NVRM version: NVIDIA UNIX x86_64 Kernel Module  %d.%d", major, minor) == 2)

The issue with this method is the output in /proc/driver/nvidia/version may not match this particular string. In my case, it does not:

  # cat /proc/driver/nvidia/version
  NVRM version: NVIDIA UNIX Open Kernel Module for x86_64  535.86.10  Release Build  (dvs-builder@U16-I2-C05-14-2)  Wed Jul 26 23:15:31 UTC 2023
  GCC version:  gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)

Note the 'for x86_64', which results in a string mismatch. This causes Moonray to incorrectly claim that i do not have a GPU:

  # moonray -in /openmoonray/testdata/rectangle.rdla -out /tmp/rectangle.exr -exec_mode xpu
     Loading Scene File(s): /openmoonray/testdata/rectangle.rdla
     Warning (lib.render): GPU: Unable to query NVIDIA driver version   ...falling back to CPU vectorized mode
     Error: GPU: Unable to query NVIDIA driver version   ...falling back to CPU vectorized mode
     Render prep time = 00:00:00.296

Of course, i can work around this by using root to manually edit that file.
A possible resolution would be to use nvidia-smi instead of parsing that file, which can change format. Maybe something like
$> nvidia-smi --query-gpu=driver_version --format=csv

@jmahovsky-dwa
Copy link
Contributor

Thank you for the detailed bug report!

We have created an internal ticket for this issue and are investigating a fix.

@jmahovsky-dwa
Copy link
Contributor

This has been fixed and the fix will appear in the next OpenMoonRay release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants