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

hello_triangle sample does not display anything on my Alienware laptop #935

Closed
mutantbob opened this issue Feb 22, 2024 · 5 comments
Closed

Comments

@mutantbob
Copy link

I tried to run the hello_triangle sample on my laptop but the window stayed black and did not draw a triangle.

After poking around in gdb I eventually concluded that the hello_triangle sample chooses the wrong GPU . Its log shows the following physical devices.

[info] Found GPU= Intel(R) UHD Graphics 630 (CFL GT2)
[info] Found GPU= NVIDIA GeForce RTX 2070
[info] Found GPU= llvmpipe (LLVM 12.0.0, 256 bits)

I tried to use the --gpu 1 argument to tell it to use the nVidia GPU, but hello_triangle still picked the first GPU (Intel) . When I changed the code to skip the first GPU, then the window successfully displays a triangle.

  1. How can hello_triangle be modified to obey the --gpu argument?
  2. How can hello_triangle be modified to detect that the intel GPU is unsuitable for rendering? or perhaps be modified to successfully render?
@SaschaWillems
Copy link
Collaborator

gpu selection is part of the framework and as such not implemented in the (hpp)hello_triangle sample. You can use it with any other sample though, as they use the sample framework that supports gpu selection.

Or if you want to use the hello_triangle sample, simply adjust the the init_device and e.g. force device 1.

@mutantbob
Copy link
Author

That turns out not to be the case. hello_triangle.cpp has code to pick the GPU / physical device here:

for (size_t i = 0; i < gpu_count && (context.graphics_queue_index < 0); i++)

It does not consult the framework to see which GPU has been selected by command-line arguments.

@SaschaWillems
Copy link
Collaborator

That's exactly what I wrote above.

@mutantbob
Copy link
Author

Maybe? I would have worded it differently. Maybe
"hello_triangle does not use the framework's GPU selection and instead picks the GPU using custom code inside init_device"
I read your sentence and grouped
"gpu selection is" "not implemented in the hello_triangle sample"
I guess my question can be refined as "could hello_triangle be modified to respect the framework's GPU settings?" And the one about ignoring GPUs that are non-functional still stands"

@SaschaWillems
Copy link
Collaborator

We don't have plans to add that functionality to the hello_triangle sample.

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