我试图使用aleagpu但我得到System.TypeInitializationException.我试图谷歌问题是什么,但我找不到任何解决方案,所以请帮助.该计划是最简单的:
class Klazz
{
private const int N = 100;
private const int Length = 10000000;
var gpu = Gpu.Default;// here is the Exception thrown
public static void Unmanaged()
{
var data = new int[Length];
for (var k = 0; k < N; k++)
gpu.For(0, data.Length, i => data[i] += 1);
}
}
Run Code Online (Sandbox Code Playgroud)
我想象我的安装有问题,因为该程序是来自aleagpu主页的复制示例.
我的系统是:
Alea于2016年11月9日从NuGet安装
PATH中的变量是正确的.
我已经尝试了AleaSample.CS.ParallelForAutoMemMgt以及相同的结果.
我已经在 Ubuntu 16.10 环境中从 Source 安装了 tensorflow。一切都很顺利,但现在在编译程序时,它显示以下错误:
Traceback (most recent call last):
File "ff.py", line 3, in <module>
sess = tf.InteractiveSession()
AttributeError: module 'tensorflow' has no attribute 'InteractiveSession'
Run Code Online (Sandbox Code Playgroud)
没有找到与此相关的帖子。有人可以帮忙吗?
为了测试我的tensorflow安装,我使用tensorflow存储库中提供的mnist示例,但是当我执行convolutional.py脚本时,我有这个输出:
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcurand.so.8.0 locally
Extracting data/train-images-idx3-ubyte.gz
Extracting data/train-labels-idx1-ubyte.gz
Extracting data/t10k-images-idx3-ubyte.gz
Extracting data/t10k-labels-idx1-ubyte.gz
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled …Run Code Online (Sandbox Code Playgroud) (GTX 1080,Tensorflow 1.0.0)
在训练nvidia-smi输出期间(如下所示)表明,大多数情况下GPU 使用率均为0%(尽管使用了GPU)。关于我已经训练的时间,情况似乎是这样。偶尔,它有时会达到100%或类似的峰值。
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 375.26 Driver Version: 375.26 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1080 Off | 0000:01:00.0 On | N/A |
| 33% 35C P2 49W / 190W | 7982MiB / 8110MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type …Run Code Online (Sandbox Code Playgroud) 我试图编译YOLO GPU = 1,OPENCV = 1,DEBUG = 1.与DEBUG = 0相同的组合已成功编译,但是当我使用DEBUG = 1时,导致编译失败.
>>make
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/gemm.c -o obj/gemm.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/utils.c -o obj/utils.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/cuda.c -o obj/cuda.o
gcc -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -Wall -Wfatal-errors -O0 -g -DOPENCV -DGPU -c ./src/convolutional_layer.c -o …Run Code Online (Sandbox Code Playgroud) 我正在使用Keras和CNTK(后端)
我的代码是这样的:
def run_han(embeddings_index, fname, opt)
...
sentence_input = Input(shape=(MAX_SENT_LENGTH,), dtype='int32')
embedded_sequences = embedding_layer(sentence_input)
l_lstm = Bidirectional(GRU(GRU_UNITS, return_sequences=True, kernel_regularizer=l2_reg,
implementation=GPU_IMPL))(embedded_sequences)
l_att = AttLayer(regularizer=l2_reg)(l_lstm)
sentEncoder = Model(sentence_input, l_att)
review_input = Input(shape=(MAX_SENTS, MAX_SENT_LENGTH), dtype='int32')
review_encoder = TimeDistributed(sentEncoder)(review_input)
l_lstm_sent = Bidirectional(GRU(GRU_UNITS, return_sequences=True, kernel_regularizer=l2_reg,
implementation=GPU_IMPL))(review_encoder)
l_att_sent = AttLayer(regularizer=l2_reg)(l_lstm_sent)
preds = Dense(n_classes, activation='softmax', kernel_regularizer=l2_reg)(l_att_sent)
model = Model(review_input, preds)
model.compile(loss='categorical_crossentropy',
optimizer=opt, #SGD(lr=0.1, nesterov=True),
metrics=['acc'])
...
model.fit(x_train[ind,:,:], y_train[ind,:], epochs=NUM_EPOCHS, batch_size=BATCH_SIZE, shuffle=False,
callbacks=[cr_result, history, csv_logger],
verbose=2,validation_data=(x_test, y_test), class_weight = class_weight)
...
%xdel model
gc.collect()
Run Code Online (Sandbox Code Playgroud)
更改优化程序时,我多次调用上述模型。像这样:
opt = optimizers.RMSprop(lr=0.0001, …Run Code Online (Sandbox Code Playgroud) 我使用 pip 安装了 dlib。我的显卡支持 CUDA,但是在运行 dlib 时,它没有使用 GPU。
我在 ubuntu 18.04 上工作
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0] on linux
>>> import dlib
>>> dlib.DLIB_USE_CUDA
False
Run Code Online (Sandbox Code Playgroud)
我还安装了 NVidia Cuda Compile 驱动程序,但仍然无法正常工作。
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助我如何让它工作。?
我需要运行 1.3.0 版本的tensorflow-gpu。为此,我需要将 cuda 降级到版本 8。有人可以分享一下将 google colab 中的 cuda 从 10.0 降级到 8.0 的代码吗?
我使用这个得到了降级到版本 9 的代码。
!wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb
!dpkg -i cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb
!apt-key add /var/cuda-repo-9-0-local/7fa2af80.pub
!apt-get update
!apt-get install cuda=9.0.176-1
Run Code Online (Sandbox Code Playgroud)
我尝试将代码中的 9 更改为 8 但没有成功。
我正在尝试做 pytorch 教程。当我尝试将他们的设备设置为 cuda 时,它不起作用并且我的代码运行被卡住。
具体信息,我使用的是 python 3.7.3 pytorch 1.3.0 cuda 10.2 (NVIDIA RTX2080TI) 的 conda 环境
>>> import torch
>>> torch.cuda.is_available()
True
>>> torch.cuda.device_count()
1
>>> torch.cuda.current_device()
0
>>> device = torch.device('cuda:0')
>>> device
device(type='cuda', index=0)
>>> aa = torch.randn(5)
>>> aa = tensor([-2.2084, -0.2700, 0.0921, -1.7678, 0.7642])
>>> aa.to(device)
nothing happens...
Run Code Online (Sandbox Code Playgroud)
有人可以帮助我如何克服这个问题吗?
系统信息
描述问题
安装了 cuda 11.2 和 cudnn 8.1.0.77。运行train.py时遇到以下问题
无法加载动态库“libcupti.so.11.0”;dlerror: libcupti.so.11.0: 无法打开共享对象文件