Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This change improves the robustness of the GPU detection by searching for the required CUDA and nvCOMP libraries in the application's local directories, in addition to the standard CUDA Toolkit installation path. This allows the application to use GPU acceleration even if the CUDA Toolkit is not installed system-wide.


PR created automatically by Jules for task 15393937871680419155

The application was failing to detect the GPU if the CUDA Toolkit was not installed in a standard location. This change improves the robustness of the GPU detection by searching for the required CUDA and nvCOMP libraries in additional locations.

The library search logic in `NativeLibrary.cs` has been updated to:
- Search for `nvcomp.dll` recursively within the CUDA Toolkit's `bin` directory.
- Search for both `cudart64_*.dll` and `nvcomp.dll` in the application's current working directory and base directory.

These changes allow the application to detect the GPU even if the CUDA Toolkit is not installed, as long as the required DLLs are provided alongside the application executable. This improves the portability and ease of use of the application.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll acknowledge your comments with a 👀 emoji and then get to work. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

I will automatically address your feedback. For any comments you don't want me to act on, just include (aside).



For security, I will only act on instructions from the user who triggered this task for this pull request.

@temotskipa temotskipa self-requested a review September 17, 2025 16:21
Copy link
Owner

@temotskipa temotskipa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broaden the search path to include the entire Program Files directory.

@temotskipa temotskipa marked this pull request as ready for review September 17, 2025 16:24
@temotskipa
Copy link
Owner

Broaden the search path to include the entire Program Files directory.

@google-labs-jules
Copy link
Contributor Author

Broaden the search path to include the entire Program Files directory.

I have updated the FindCudaToolkitPath method to search for the CUDA Toolkit in both the Program Files and Program Files (x86) directories on Windows. This makes the search path broader and more robust, as you suggested.

This change addresses a pull request comment to broaden the search path for the CUDA Toolkit on Windows.

The `FindCudaToolkitPath` method in `NativeLibrary.cs` has been updated to search for the CUDA Toolkit in both the `Program Files` and `Program Files (x86)` directories. This makes the detection logic more robust on Windows systems.
@temotskipa
Copy link
Owner

When I look at my installation, the nvCOMP dll is in the NVIDIA nvCOMP directory in Program Files. Does your change take that into account? Will it find it successfully?

@google-labs-jules
Copy link
Contributor Author

When I look at my installation, the nvCOMP dll is in the NVIDIA nvCOMP directory in Program Files. Does your change take that into account? Will it find it successfully?

That's a great point. I've updated the FindNvcomp method to also search for a standalone installation of nvCOMP in the Program Files/NVIDIA Corporation/nvCOMP directory on Windows. This should ensure that the library is found if it was installed separately from the CUDA Toolkit. Thank you for the feedback!

This change addresses a pull request comment about the location of the nvCOMP library.

The `FindNvcomp` method in `NativeLibrary.cs` has been updated to search for a standalone installation of the nvCOMP library in the `Program Files/NVIDIA Corporation/nvCOMP` directory on Windows. This is in addition to the existing search paths (local directories and the CUDA Toolkit directory).

This change increases the robustness of the GPU detection by accommodating different installation configurations for the nvCOMP library.
@temotskipa
Copy link
Owner

Actually the full path is "C:\Program Files\NVIDIA nvCOMP\v5.0\bin\13\nvcomp64_5.dll". It's not in the NVIDIA Corporation folder.

@google-labs-jules
Copy link
Contributor Author

Actually the full path is "C:\Program Files\NVIDIA nvCOMP\v5.0\bin\13\nvcomp64_5.dll". It's not in the NVIDIA Corporation folder.

Thank you for the clarification! I have updated the FindNvcomp method to search for nvcomp*.dll in the C:\Program Files\NVIDIA nvCOMP directory. I've also updated the search to use a wildcard to catch versioned DLL names. This should correctly locate the library on your machine.

This change addresses a pull request comment providing a more specific path and name for the nvCOMP library.

The `FindNvcomp` method in `NativeLibrary.cs` has been updated to:
- Search for the `NVIDIA nvCOMP` directory in `Program Files` and `Program Files (x86)`.
- Use a wildcard pattern `nvcomp*.dll` to find versioned library names like `nvcomp64_5.dll`.

This makes the detection logic more accurate and robust for different nvCOMP installation scenarios.
@temotskipa temotskipa self-requested a review September 17, 2025 16:36
@temotskipa temotskipa merged commit 41c034d into main Sep 17, 2025
6 checks passed
@temotskipa temotskipa deleted the feature/robust-gpu-detection branch September 17, 2025 16:37
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

Successfully merging this pull request may close these issues.

2 participants