OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 // Load and initialize the GL implementation and locate the GL entry points. | 81 // Load and initialize the GL implementation and locate the GL entry points. |
82 content::GPUInfo gpu_info; | 82 content::GPUInfo gpu_info; |
83 if (gfx::GLSurface::InitializeOneOff()) { | 83 if (gfx::GLSurface::InitializeOneOff()) { |
84 // Collect information about the GPU. | 84 // Collect information about the GPU. |
85 if (!gpu_info_collector::CollectGraphicsInfo(&gpu_info)) { | 85 if (!gpu_info_collector::CollectGraphicsInfo(&gpu_info)) { |
86 LOG(INFO) << "gpu_info_collector::CollectGraphicsInfo failed"; | 86 LOG(INFO) << "gpu_info_collector::CollectGraphicsInfo failed"; |
87 } | 87 } |
88 | 88 |
89 #if defined(OS_LINUX) | 89 #if defined(OS_LINUX) |
90 if (gpu_info.vendor_id == 0x10de) { // NVIDIA | 90 if (gpu_info.vendor_id == 0x10de && // NVIDIA |
| 91 gpu_info.driver_vendor == "NVIDIA") { |
91 base::ThreadRestrictions::AssertIOAllowed(); | 92 base::ThreadRestrictions::AssertIOAllowed(); |
92 if (access("/dev/nvidiactl", R_OK) != 0) { | 93 if (access("/dev/nvidiactl", R_OK) != 0) { |
93 LOG(INFO) << "NVIDIA device file /dev/nvidiactl access denied"; | 94 LOG(INFO) << "NVIDIA device file /dev/nvidiactl access denied"; |
94 gpu_info.gpu_accessible = false; | 95 gpu_info.gpu_accessible = false; |
95 dead_on_arrival = true; | 96 dead_on_arrival = true; |
96 } | 97 } |
97 } | 98 } |
98 #endif | 99 #endif |
99 | 100 |
100 // Set the GPU info even if it failed. | 101 // Set the GPU info even if it failed. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 child_thread->Init(start_time); | 154 child_thread->Init(start_time); |
154 | 155 |
155 gpu_process.set_main_thread(child_thread); | 156 gpu_process.set_main_thread(child_thread); |
156 | 157 |
157 main_message_loop.Run(); | 158 main_message_loop.Run(); |
158 | 159 |
159 child_thread->StopWatchdog(); | 160 child_thread->StopWatchdog(); |
160 | 161 |
161 return 0; | 162 return 0; |
162 } | 163 } |
OLD | NEW |