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 x8664', 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
The method for GPU detection does not handle all cases. From the code in moonray/moonray/lib/rendering/rt/gpu/GPUUtils.cc:
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:
Note the '_for x8664', which results in a string mismatch. This causes Moonray to incorrectly claim that i do not have a GPU:
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