This code cause a blue screen on windows on my computer :
import matplotlib.pyplot as plt
plt.plot(range(10),range(10)) # This is the line that cause the crash
WhoCrashed tells me this :
This was probably caused by the following module: nt_wrong_symbols.sys
(nt_wrong_symbols) Bugcheck code: 0x124 (0x0, 0xFFFFB60A6AF4D028,
0xB2000000, 0x70005) Error: WHEA_UNCORRECTABLE_ERROR
Here is a link to the full Minidump
What I have done:
Fully tested the CPU with a CPU-Z stress test
Fully tested the RAM with memtest86+
Tested the GPU with Assassin's creed origin in full ultra
Tested the same code on Ubuntu (double boot) : works fine
This lead me to believe this is a windows specific error.
Hardware configuration :
i9-7940X
GTX 1080 Ti
64 Gb RAM #2400Mhz (CPU frequency)
Software :
Windows 10, fresh install (I've always had this issue)
Python 2.7 installed through Anaconda ( I tested the code with Jupyter and IPython with the same results)
Windows and graphic drivers up to date
This is the only thing that causes blue screen on my computer, and I'm out of ideas on how to solve this, any advice would be greatly appreciated.
NOTE : I asked this question here as it appears to be matplotlib related, I hope this is the right place
EDIT : Correction : it does not happens all the time, but more like 95% of the time.
I updated the BIOS and it seems to work now. As i9-7940X is very recent (Q3'17), my old BIOS version was supposed to work with it but was released before the CPU (06/17) so that might have been the issue.
I'll post again if blue screens come back.
I had the same problem on an Alienware Area 51 machine. Fixed it by disabling processor's "hyperthreading" on the BIOS configuration. Also, I had a similar crashing issue on another machine with Ubuntu when trying to use multithreading.
In conclusion Matplotlib and multithreading don't get along well.
Related
Cursor repeating and remaining in the Integrated Terminal in VS Code
I encountered this bug in my terminal while doing Python tutorial so downloaded and reinstalled the same version (latest version of VS Code) but the problem persists. I looked about for some answers but only found this tutorial which is not related.
Anyway, I reinstalled the software only to find the bug was still present. The code runs but the cursor is an obstruction. From time to time I may type in the wrong execution so it's a bit of a bother.
Turned off GPU acceleration in the Terminal of VS Code. That has seemed to resolve the matter; No longer cursor trails.
Settings > Type 'Render' > Go to
Terminal › Integrated: Gpu Acceleration.
Setting controls whether the terminal will leverage the GPU to do its rendering.
Switch 'off' in dropdown menu
I recently got a really awesome gaming laptop that I use for all my heavy-duty computer tasks. There's one problem. The RGB lighting isn't changing from its default blue color. I want to change the color so I thought I could do that using an SDK provided by ASUS to change it with python; since the aura software is garbage.
import win32com.client
auraSdk = win32com.client.Dispatch("aura.sdk.1")
auraSdk.SwitchMode()
devices = auraSdk.Enumerate(0)
for dev in devices:
for i in range(dev.Lights.Count):
dev.Lights(i).color = 0x0000FF00
This code, which I copied off of https://www.asus.com/microsite/aurareadydevportal/tutorial_python.html, didn't work at first because I didn't have the right module installed. So I did a simple git clone and a pip install and it ran. Then I got this other error.
can't load MsIo.dll(SMB)!
can't load MsIo.dll(SMB)!
Check DRAM Module. (0)
I don't really understand what MsIo.dll is for or why there is SMB(Server Message Block) within parentheses.
and it doesn't give much information on what to check in my DRAM Module.
Help please?
At first, I tried to download the necessary modules and clone the necessary packages. I was expecting that it works. It ran this time, but I got the error. "can't load MsIo.dll(SMB)", twice then "Check DRAM Module". I don't really understand what MsIo.dll does or what I am supposed to do to resolve this issue.
I have two computers at home for my python projects. One is a PC with an Intel i5-7400 CPU and the other is a laptop with an Intel i7-10750H CPU. Presumably the laptop is faster running the same python code than the PC. This was the case before I made some changes to the laptop in an attempt to leverage its Nvida GPU for training DNN model.
I followed the instruction from Tensorflow GPU support webpage to upgrade Nvida GPU driver, install Cuda toolkit and cuDNN with the recommanded version. After the installation, I created a new conda environment and installed latest tensorflow. With all this I could detect my GPU with tf.config.list_physical_devices() and run some test code on the GPU. However, the performance was not lifted and even worse, the laptop became noticeably slower running the same code on its CPU. I tested the following simple code on both machines:
from datetime import datetime
import numpy as np
t0 = datetime.now()
for i in range(1000):
a = np.random.rand(1000, 1000)
b = np.random.rand(1000, 1000)
c = np.matmul(a, b)
t1 = datetime.now()
print(t1 - t0)
The PC ran it in 32s but the laptop needed 45s. I tried a few things to resolve this, including uninstalling Cuda toolkit/cuDNN and reinstalling anaconda (tried different anaconda versions). But the issue still remains. Anyone has any insights about why this happens and what to try in order to address it? Many thanks.
Update: I notice that the same python code uses about 30% CPU if running on the PC's intel i5-7400 CPU but uses over 90% CPU and is slower if on the laptop intel i7-10750H CPU. Is it normal?
This is probably not your main problem however, your laptop run with battery? The laptop can decrease performance for saving battery life
There are many reasons to consider. Firstly, The code you are ruining
doesn't use GPU at all. It's all about CPU's holding the throttle.
Basically, as a part of "Thermal management" Laptops CPU power limit
throttle is constantly controlled. Fact is in CPU's runs code faster
than GPU's. So, maybe your laptop reaching thermal limitations and
throttles down to slower for most of the time it takes to run the
program. Maybe your PC CPU is able to withhold that throttle so it's
finishing bit faster.
Once check Benchmarking your code. A wonderful instructions return here
https://stackoverflow.com/a/1593034/15358800
I have an assignment for a Deep Learning class, and they provide a Jupyter notebook as a base code, the thing is that after running the data import and reshape, jupyter notebook through a "Memory Error", after some analysis y tried to compile the same code in a normal .py file, and everything runs well.
The thing is that I'm required (preferably) to use the Jupyter notebook as the base for development, since is more interactive for the kind of task.
<ipython-input-2-846f80a40ce2> in <module>()
2 # Load the raw CIFAR-10 data
3 cifar10_dir = 'datasets\\'
----> 4 X, y = load_CIFAR10(cifar10_dir)
C:\path\data_utils.pyc in load_CIFAR10(ROOT)
18 f = os.path.join(ROOT, 'cifar10_train.p')
19 print('Path: ' + f );
---> 20 Xtr, Ytr = load_CIFAR_batch(f)
21 return Xtr, Ytr
22
C:\path\data_utils.pyc in load_CIFAR_batch(filename)
10 X = np.array(datadict['data'])
11 Y = np.array(datadict['labels'])
---> 12 X = X.reshape(-1, 3, 32, 32).transpose(0,2,3,1).astype("float")
13 return X, Y
14
MemoryError:
The error occurs in the line 12, i know is a memory consuming assignment, but that doesn't mean that 4 GB of RAM wont suffice, and that was confirmed when the code run without problems outside Jupyter.
My Guess is it has something to do with the memory limit either by Jupyter or by Chrome, but I'm not sure and also dont know how to solve it.
By the way:
I have a Windows 10 laptop with 4GB of RAM
and Chrome Version 57.0.2987.133 (64-bit)
I am only a year and 2 months late to this question. The technical answer as to why is really nicely explained here: https://superuser.com/questions/372881/is-there-a-technical-reason-why-32-bit-windows-is-limited-to-4gb-of-ram
It also implies why the conda solution works.
But for a lazy engineer's no-change workaround, close the Chrome tabs not absolutely necessary and restart your kernel so it starts afresh.
Kernel > Restart (& Run All)
Apparently this happens when the python installation is not the best.
As a matter of fact before solving the problem, I had installed on windows manually python 2.7 and the packages that I needed, after messing almost two days trying to figure out what was the problem, I reinstalled everything with Conda and the problem was solved.
I guess Conda is installing better memory management packages and that was the main reason.
Try running with Administrator privileges. Worked for me.
Similar thing happened with me while loading .npy file. Freeing up RAM solved the issue. It didn't have enough memory to load file into variables. Actually, both firefox and chrome was running on my system and closing firefox solved the problem.
Useful Commands:free -h
Note of precaution: before interpreting this command on your own. Its highly recommended to go through this page: https://www.linuxatemyram.com/ .
You can either reduce your dataset for training and testing this can solve your memory error problem.
I've been trying to get PyOpenCL and PyCUDA running on a Linux Mint machine. I have things installed but the demo scripts fail with the error:
pyopencl.cffi_cl.LogicError: clgetplatformids failed: PLATFORM_NOT_FOUND_KHR
Configuration
$ uname -a && cat /etc/lsb-release && lspci | grep NV
Linux 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
DISTRIB_DESCRIPTION="Linux Mint 17.3 Rosa"
01:00.0 VGA compatible controller: NVIDIA Corporation GK208 [GeForce GT 730] (rev a1)
Relevant installed packages:
libcuda1-352-updates
libcudart5.5:amd64
nvidia-352-updates
nvidia-352-updates-dev
nvidia-cuda-dev
nvidia-cuda-toolkit
nvidia-opencl-icd-352-updates
nvidia-profiler
nvidia-settings
ocl-icd-libopencl1:amd64
ocl-icd-opencl-dev:amd64
opencl-headers
python-pycuda
python-pyopencl
python3-pycuda
python3-pyopencl
Research
This post describes a scenario in which the package-manager installed opencl/cuda implementation don't set up some simlinks correctly. That issue doesn't seem to be present on my system.
There was a version number mismatch between the graphics drivers (were nvidia-340) and the nvidia-opencl package (352). I update the graphics drivers to nvidia-352-updates-dev but the issue remains.
There is a bug in Arch linux that seems to revolve around the necessary device files not being created. However, I've verified that the /dev/nvidia0 and /dev/nvidiactl exist and have permissions 666, so they should be accessible.
Another Stackoverflow post suggests running the demos as root. I have tried this and the behavior does not change.
Older installation instructions for cuda/opencl say to download drivers directly from the NVidia website. I'm not sure this still applies, so I'm holding off on that for now since there seem to be plenty of relevant packages in the respositories.
The same error, but for an ATI card on a different linux system, was resolved by putting proper files in /usr/lib/OpenCL/vendors. That path isn't used on my system, However, I do have /etc/OpenCL/vendors/nvidia.icd which contains the line libnvidia-opencl.so.1, suggesting my issue is dissimilar.
This error has been observed on OSX, but for unrelated reasons. Similar error messages for PyCUDA also appear to be unrelated.
This error can occur under remote access since the device files are not initialized if X is not loaded. However, I'm testing this in a desktop environment. Furthermore, I've run the manual commands suggested in that thread just to be sure, and they are redundant since the relevant /dev entries already exist.
There is a note here about simply running a command a few times to get around some sort temporary glitch. That doesn't seem to help.
This post describes how the similar cuInit failed: no device CUDA error was caused by not having the user in the video group. To check, I ran usermod -a -G video $USER, but it did not resolve my issue.
In the past, routine updates have broken CUDA support. I have not taken the time to explore every permutation of package version numbers, and it's possible that downgrading some packages may change the situation. However, without further intuition about the source of the issue, I'm not going to invest time in doing that since I don't know whether it will work.
The most common google search result for this error, appearing four times on the first pages, is a short and unresolved email thread on the PyOpenCL list. Checking the permissions bits for /dev/nvidia0 and /dev/nvidiactl is suggested. On my machine user/group/other all have read and write access to these devices, so I don't think that's the source of the trouble.
I've also tried building and installing PyOpenCL form the latest source, rather than using the version in the repositories. This is failing at an earlier phase which suggests to me it is not building correctly.
Summary
The issue would appear to be that PyCUDA/PyOpenCL cannot locate the graphics card. There are several known issues that can cause this, but none of them seem to apply here. I'm missing something, and I'm not sure what else to do.