打开 google-chrome 并启动任何页面都会导致“冻结”。当启动终端时,它显示一些错误:
ERROR: gpu_process_host.cc(956)] GPU process exited unexpectedly: exit_code=139
ERROR: gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is
ERROR: command_buffer_proxy_impl.cc(125)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
ERROR: chrome_browser_main_extra_parts_metrics.cc(228)] crbug.com/1216328: Checking Bluetooth availability started. Please report if there is no report that this ends.
ERROR: chrome_browser_main_extra_parts_metrics.cc(231)] crbug.com/1216328: Checking Bluetooth availability ended.
ERROR: chrome_browser_main_extra_parts_metrics.cc(234)] crbug.com/1216328: Checking default browser status started. Please report if there is no report that this ends.
ERROR: chrome_browser_main_extra_parts_metrics.cc(238)] crbug.com/1216328: Checking default browser status ended.
ERROR: platform_thread_posix.cc(147)] …Run Code Online (Sandbox Code Playgroud) 我正在执行在 GPU 上运行 Julia 1.6.5 代码的第一步。由于某种原因,GPU 似乎根本没有被使用。这些是步骤:
首先,我的 GPU 通过了CUDA Julia Docs推荐的测试:
# install the package
using Pkg
Pkg.add("CUDA")
# smoke test (this will download the CUDA toolkit)
using CUDA
CUDA.versioninfo()
using Pkg
Pkg.test("CUDA") # takes ~40 minutes if using 1 thread
Run Code Online (Sandbox Code Playgroud)
其次,下面的代码在我的 GPU 上运行大约需要 8 分钟(实时)。它加载两个矩阵 10000 x 10000 并相乘 10 次:
using CUDA
using Random
N = 10000
a_d = CuArray{Float32}(undef, (N, N))
b_d = CuArray{Float32}(undef, (N, N))
c_d = CuArray{Float32}(undef, (N, N))
for i in …Run Code Online (Sandbox Code Playgroud) 这个问题__device__询问和之间的区别__global__。
区别在于:
__device__函数只能从设备调用,并且只能在设备中执行。
__global__函数可以从主机调用,并在设备中执行。
__global__我将和之间的区别解释__device__为类似于public和private类访问说明符。重点是防止意外地__device__从主机调用函数。听起来我可以将所有void返回函数标记为__global__不改变程序行为。这会改变程序性能吗?
下面是我想要做的伪代码。我已经知道如何将张量移动到 GPU ( .cuda())...
但不知道如何使用 GPU 指针来创建新的张量。有什么方法我错过了吗?
我不想复制devPtr回主机端,而只是用指针制作 GPU 张量。
int main(void) {
float* devPtr;
cudaMalloc((void**)&devPtr, sizeof(float)*HOSTDATA_SIZE);
cudaMemcpy(devPtr, hostData, sizeof(float)*HOSTDATA_SIZE, cudaMemcpyHostToDevice);
torch::Tensor inA = /* make Tensor with devPtr which is already in GPU */;
torch::Tensor inB = torch::randn({1, 10, 512, 512}).cuda();
torch::Tensor out = torch::matmul(inA, inB);
std::cout << out << std::endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud) 我目前正在尝试在我的笔记本电脑(配备 Intel Iris Pro GPU 的 MacBook Pro)上开发基于 vulkan 的图形引擎。我在台式电脑(带有 NVIDIA GTX 1080 ti GPU 的 Windows)上启动了这个项目。这在我的台式电脑上完美运行。但是,当我尝试在笔记本电脑上构建并执行此命令时,可执行文件尝试创建 vulkan 实例失败,并返回“VK_ERROR_INCOMPATIBLE_DRIVER”作为 VkResult。
免责声明:我是 C++ 新手,我知道以下代码不符合大多数 C++ 编码约定。我正在努力使我的代码尽可能具有可读性,以便我可以更好地学习。
我正在尝试使用以下代码创建一个新的 vulkan 实例:
VkApplicationInfo app_info{}; // APPLICATION INFO
app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; // type of the struct
app_info.pApplicationName = application_name; // name of the application
app_info.applicationVersion = VK_MAKE_VERSION(1, 0, 0); // version
app_info.pEngineName = application_engine_name; // name of the engine
app_info.engineVersion = VK_MAKE_VERSION(1, 0, 0); // version
app_info.apiVersion = VK_API_VERSION_1_0; // API version
// get available …Run Code Online (Sandbox Code Playgroud) 我正在构建一个渲染引擎,我想要的一件事是处理任意网格数据的管理,无论表示如何。
我的想法是,定义一个特征来强制执行函数签名,然后当我处理所有 GPU 内容时,用户可以处理序列化。这就是我所创造的特质:
pub enum GpuAttributeData
{
OwnedData(Vec<Vec<i8>>, Vec<u32>),
}
pub trait GpuSerializable
{
fn serialize(&self) -> GpuAttributeData;
}
Run Code Online (Sandbox Code Playgroud)
非常简单,给我几个数组。
当我测试板条箱内的东西时,它起作用了,但我将示例移到了板条箱外,即我在示例中包含以下代码片段:
impl <const N : usize> GpuSerializable for [Vertex; N]
{
fn serialize(&self) -> GpuAttributeData
{
let size = size_of::<Vertex>() * self.len();
let data = unsafe {
let mut data = Vec::<i8>::with_capacity(size);
copy_nonoverlapping(
self.as_ptr() as *const i8, data.as_ptr() as *mut i8, size);
data.set_len(size);
data
};
// let indices : Vec<usize> = (0..self.len()).into_iter().collect();
let indices = vec![0, 1, 2];
let …Run Code Online (Sandbox Code Playgroud) 我的任务是编写一个通过 OpenMP 卸载到 GPU 的程序。目前我使用 Intel oneAPI DPC++ 编译器编译我的代码icpxv2022.1.0 编译代码,目标是在后端使用 NVIDIA Tesla V100。请在下面找到我的相关部分Makefile:
MKLROOT = /lustre/system/local/apps/intel/oneapi/2022.2.0/mkl/latest
CXX = icpx
INC =-I"${MKLROOT}/include"
CXXFLAGS =-qopenmp -fopenmp-targets=spir64 ${INC} --gcc-toolchain=/lustre/system/local/apps/gcc9/9.3.0
LDFLAGS =-qopenmp -fopenmp-targets=spir64 -fsycl -L${MKLROOT}/lib/intel64
LDLIBS =-lmkl_sycl -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lsycl -lOpenCL -lstdc++ -lpthread -lm -ldl
${EXE}: ${OBJ}
${CXX} ${CXXFLAGS} $^ ${LDFLAGS} ${LDLIBS} -o $@
Run Code Online (Sandbox Code Playgroud)
该代码编译时没有错误和警告,但我不完全确定它在运行时确实使用了 GPU。
我根据官方安装页面安装了支持 GPU 的 TensorFlow ,并且可以从终端识别 GPU,但不能从具有相同 Conda 环境的 Jupyter 内核的 Jupyter 笔记本识别 GPU tensor_gpu(请参见下面的屏幕截图)。Jupyter Lab 3.6.3 (Windows 10) 从单独的 Conda 环境安装和运行jupyter。
我还在 Jupyter Lab 控制台中看到以下警告:
2023-04-25 16:34:44.493879: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2023-04-25 16:34:44.494185: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2023-04-25 16:34:47.012660: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2023-04-25 16:34:47.014859: …Run Code Online (Sandbox Code Playgroud) 如何在NVIDIA GPU中实现NVIDIA PhysX引擎:它是一个协处理器还是物理算法被实现为要在GPU管道中执行的片段程序?
假设我有一个游戏,在openGL方面做了很多图形,我有一个安装了Linux 32位的桌面,配有4GB内存和1G Nvidia显卡.我的游戏应用程序虚拟地址空间如何?显卡内存是否映射在此虚拟地址空间中?
此外,RAM和显卡内存之间是否存在某种关系?linux是否为显卡分配了相同的RAM,任何进程都无法使用?也就是说,它导致我的游戏进程只有3GB的RAM可用?