Меню

Illegal memory address ошибка

Windows 10: Error! Illegal memory address

Discus and support Error! Illegal memory address in Windows 10 Ask Insider to solve the problem; Hello,

I am trying to run an old pc game on my laptop. I’ve changed the graphics to suit the old game, I’ve downloaded DirectX but an error keeps…
Discussion in ‘Windows 10 Ask Insider’ started by /u/HappyViking_, May 2, 2020.

  1. Error! Illegal memory address

    Hello,

    I am trying to run an old pc game on my laptop. I’ve changed the graphics to suit the old game, I’ve downloaded DirectX but an error keeps popping up “Illegal memory address”.

    Does anyone know what this means and how I can fix it please?

    submitted by /u/HappyViking_
    [link] [comments]

    🙂

  2. cuda error — an illegal memory access encountered

    I have a P106-100 Graphics card which crashed halfway through mining.

    When I now run the miner software I get «cuda error — an illegal memory access encountered»

    I have rebooted my PC and I still cannot resolve the issue.

    Is my graphics card knackered ? is there a way to reset the memory (I am assuming somehow the memory is not being refreshed after a device power off)

  3. BSOD Memory Addresses

    Alot of times the issue is a bad device driver that mishandles memory and so windows shuts down to prevent eh driver from overwriting some part of the active pages of other processes as there is no alternative.

    If you post the whole error or the dumps sometimes you can just look at the memory address the fault occurred at, and the look through the process list to see what was using it, and what tried to access it.

    If it is a hardware failure then you CAN use memtest X86 or X64 to diagnose that part, and you CAN run certain tests on your CPU, however som eof the advanced functions may not be in ANY test, such as the decode part that may be used for specific instruction sets causing corruption of items processed.

    However Occam’s Razor, and we have a simple driver, software or misconfiguration error.

  4. Error! Illegal memory address

    Overclocking / Undervolting guide for Vega 56 or 64?

    Here’s a quick laundry list:

    List of software to use for overclocking and testing
    Examples:
    Wattman (and how to find and use it, like an overview, including profiles)
    Unigine Valley or Heaven (use this for quick testing while changing settings in Wattman and checking for stability / artifacts) …just suggesting this
    How to monitor cores / mem speeds and temps during testing (I’ve seen screen overlays, and others using GPUz)

    Step-by step overclocking in Wattman
    Fan speeds
    Power limit
    Temp limit
    Voltages
    Core speeds
    Memory speeds

Thema:

Error! Illegal memory address

  1. Error! Illegal memory address — Similar Threads — Error Illegal memory

  2. illegal state change requested error.

    in Windows 10 Gaming

    illegal state change requested error.: i just got the new forza 5 horizon and noticed when i try to make a convoy/party on pc it asked me to login and i did and it prompted me that there was a illegal state change requested and it can’t sign me in. however i can login to my account fine on google or any browser…
  3. illegal state change requested error.

    in Windows 10 Software and Apps

    illegal state change requested error.: i just got the new forza 5 horizon and noticed when i try to make a convoy/party on pc it asked me to login and i did and it prompted me that there was a illegal state change requested and it can’t sign me in. however i can login to my account fine on google or any browser…
  4. illegal state change requested error.

    in Microsoft Windows 10 Store

    illegal state change requested error.: i just got the new forza 5 horizon and noticed when i try to make a convoy/party on pc it asked me to login and i did and it prompted me that there was a illegal state change requested and it can’t sign me in. however i can login to my account fine on google or any browser…
  5. Is this good or illegal?

    in Windows 10 Updates and Activation

    Is this good or illegal?: I was looking at Win10 Pro for Workstations in MS Store and clicked install FOR FUN, thinking that the thing would exit because I didn’t have a product key, but when I clicked install, I got scared something would happen and closed Store and it’s task in Task Manager. But,…
  6. Memory Error

    in Windows 10 Software and Apps

    Memory Error: Hello there! I got a error on a virtual machine after un-pausing after cleaning up some space on my host. Can someone help me? Here’s the screenshot:

    [ATTACH]

    https://answers.microsoft.com/en-us/windows/forum/all/memory-error/521c644c-efb5-4587-955f-f31298425a10

  7. Error code: Status illegal instruction

    in Windows 10 BSOD Crashes and Debugging

    Error code: Status illegal instruction: Hello,

    I would like some help with an issue that occurs while i’m watching a youtube video on my laptop. It happens a lot lately and is very annoying. So, while i’m watching a video, the page stops working and the message «oops something went wrong» appears on my screen…

  8. illegible font

    in Windows 10 Customization

    illegible font: Hi

    after iave chenge to dark background my font is not clear and can not see/ invisible

    how do I change to normal

    https://answers.microsoft.com/en-us/windows/forum/all/illegible-font/ecf11183-d954-4702-8547-e36e6d94352b

  9. IS IT ILLEGAL?

    in Windows 10 Updates and Activation

    IS IT ILLEGAL?: I am not a legal expert, and would like to know if it is in theory illegal to share (for free) a functional, NOT-ACTIVATED, non-malicious, windows ISO, that has been stripped down to be less hardware intensive with performance tweaks prepared to a friend, considering they…
  10. User received an Illegal File Process error

    in Windows 10 Performance & Maintenance

    User received an Illegal File Process error: I have a client that said they are getting this error multiple times over the past week and the PC either restarts or they are restarting it. I ran SFC and it said Windows Resource Protection found corrupt files but was unable to fix some of them. I then ran DISM and it says…

Users found this page by searching for:

  1. realtek illegal memory address error popup


Windows 10 Forums

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package main
 
import (
    "fmt"
    "go_blog/models"
    "net/http"
    "text/template"
)
//здесь хранятся данные формы
var posts map[string]*models.Post
 
//функция индексации главной страницы
func indexHandler(w http.ResponseWriter, r *http.Request) {
    t, err := template.ParseFiles("templates/index.html", "templates/header.html", "templates/footer.html")
    if err != nil {
        fmt.Fprintf(w, err.Error())
        return
    }
    fmt.Println(posts)
    t.ExecuteTemplate(w, "index", posts)
}
 
//функция индексации формы 
func writeHandler(w http.ResponseWriter, r *http.Request) {
    t, err := template.ParseFiles("templates/write.html", "templates/header.html", "templates/footer.html")
    if err != nil {
        fmt.Fprintf(w, err.Error())
        return
    }
 
    t.ExecuteTemplate(w, "write", nil)
}
//функция обработки формы редактированя
func editHandler(w http.ResponseWriter, r *http.Request) {
    t, err := template.ParseFiles("templates/write.html", "templates/header.html", "templates/footer.html")
    if err != nil {
        fmt.Fprintf(w, err.Error())
        return
    }
 
    id := r.FormValue("id")
    post, found := posts[id]
    if !found {
        http.NotFound(w, r)
    }
 
    t.ExecuteTemplate(w, "write", post)
}
 
//функция сохранения данных формы
func savePostHandler(w http.ResponseWriter, r *http.Request) {
    id := r.FormValue("id")
    title := r.FormValue("title")
    content := r.FormValue("content")
 
    var post *models.Post
    if id != "" {
        post = posts[id]
        post.Title = title
        post.Content = content
    } else {
        id = GenerateID()
        post := models.NewPost(id, title, content)
        posts[post.Id] = post
    }
 
    http.Redirect(w, r, "/", 302)
}
 
func main() {
    fmt.Println("Listening port: 3000")
    posts = make(map[string]*models.Post, 0)
 
    // /css/app.css
    http.Handle("/assets/", http.StripPrefix("/assets/", http.FileServer(http.Dir("./assets"))))
    http.HandleFunc("/", indexHandler)
    http.HandleFunc("/write", writeHandler)
    http.HandleFunc("/edit", editHandler)
    http.HandleFunc("/SavePost", savePostHandler)
 
    http.ListenAndServe(":3000", nil)
}

Здравствуйте! Помогите пожалуйста разобраться в проблеме.

Используя фреймворк IRIS написал REST службу. Использую 1.11.5 версию Golang. При обращении к определенному URL пытаюсь вернуть все данные из таблицы reports (база данных PostgreSQL) c помощью библиотеки GORM. В момент запроса к базе данных возникает ошибка:

[WARN] 2019/06/06 13:31 Recovered from a route's Handler('constructor/controllers.glob..func1')
At Request: 200 /api/report/d5f9c639-13e6-42c1-9043-30783981724b GET ::1
Trace: runtime error: invalid memory address or nil pointer dereference

C:/Go/src/runtime/asm_amd64.s:522
C:/Go/src/runtime/panic.go:513
C:/Go/src/runtime/panic.go:82
C:/Go/src/runtime/signal_windows.go:204
C:/Users/NNogerbek/go/src/github.com/jinzhu/gorm/main.go:768
C:/Users/NNogerbek/go/src/github.com/jinzhu/gorm/main.go:179
C:/Users/NNogerbek/go/src/github.com/jinzhu/gorm/main.go:322
C:/Users/NNogerbek/go/src/constructor/controllers/report.go:14
C:/Users/NNogerbek/go/src/github.com/kataras/iris/context/context.go:1208
C:/Users/NNogerbek/go/src/github.com/kataras/iris/context/context.go:1217
C:/Users/NNogerbek/go/src/github.com/kataras/iris/middleware/logger/logger.go:50
C:/Users/NNogerbek/go/src/github.com/kataras/iris/middleware/logger/logger.go:31
C:/Users/NNogerbek/go/src/github.com/kataras/iris/context/context.go:1208
C:/Users/NNogerbek/go/src/github.com/kataras/iris/context/context.go:1217
C:/Users/NNogerbek/go/src/github.com/kataras/iris/middleware/recover/recover.go:56
C:/Users/NNogerbek/go/src/github.com/kataras/iris/context/context.go:922
C:/Users/NNogerbek/go/src/github.com/kataras/iris/context/context.go:1094
C:/Users/NNogerbek/go/src/github.com/kataras/iris/core/router/handler.go:227
C:/Users/NNogerbek/go/src/github.com/kataras/iris/core/router/router.go:84
C:/Users/NNogerbek/go/src/github.com/kataras/iris/core/router/router.go:161
C:/Go/src/net/http/server.go:2741
C:/Go/src/net/http/server.go:1847
C:/Go/src/runtime/asm_amd64.s:1333

Ниже представлен полный код проекта. Подскажите пожалуйста в каком месте сделал упущение?

main.go:

package main

import (
	"constructor/database"
	"constructor/routes"
	"github.com/joho/godotenv"
	"github.com/kataras/iris"
)

func main()  {
	// Check the connection to remote PostgreSQL database with the help of the "gorm".
	database.ConnectPostgreSQL()
	defer database.DisconnectPostgreSQL()

	// Create an application with default logger and recovery middleware.
	application := iris.Default()

	// Define the list of all available routes of the application.
	routes.Handle(application)

	// Start to listen and serve the application.
	application.Run(iris.Addr(":8000" + port), iris.WithoutServerError(iris.ErrServerClosed))
}

database.go:

package database

import (
	"constructor/utils"
	"fmt"
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/postgres"
)

var DBGORM *gorm.DB

func ConnectPostgreSQL() {
	// Initialize variables related with the remote PostgreSQL database.
	databaseUser := utils.CheckEnvironmentVariable("PostgreSQL_USER")
	databasePassword := utils.CheckEnvironmentVariable("PostgreSQL_PASSWORD")
	databaseHost := utils.CheckEnvironmentVariable("PostgreSQL_HOST")
	databaseName := utils.CheckEnvironmentVariable("PostgreSQL_DATABASE_NAME")

	// Define the connection string for the remote PostgreSQL database with the help of the "gorm" package.
	databaseURL:= fmt.Sprintf("host=%s user=%s dbname=%s password=%s sslmode=disable", databaseHost, databaseUser, databaseName, databasePassword)

	// Create connection pool to remote PostgreSQL database with the help of the "gorm" package.
	DBGORM, err := gorm.Open("postgres", databaseURL); if err != nil {
		utils.Logger().Println(err)
		panic(err)
	}

	// Ping the remote PostgreSQL database with the help of "gorm" package.
	err = DBGORM.DB().Ping(); if err != nil {
		utils.Logger().Println(err)
		panic(err)
	}

	// Enable logging mode of "gorm" package.
	DBGORM.LogMode(true)
}

func DisconnectPostgreSQL() error {
	return DBGORM.Close()
}

routes.go:

package routes

import (
	"constructor/controllers"
	"github.com/kataras/iris"
)

func Handle(application *iris.Application)  {
	application.Get("/api/report/{report_id:string}", controllers.GetReport)
}

controllers/report.go:

package controllers
import (
	"constructor/database"
	"constructor/utils"
	"github.com/kataras/iris"
)

type Report struct {
	ID int `gorm:"primary_key" json:"report_id"`
	Name string `json:"report_name"`
}

var GetReport = func(ctx iris.Context) {
	// Initialize variable.
	reportID := ctx.Params().Get("report_id")

	if utils.IsValidUUID(reportID) {
		var reports []Report
		database.DBGORM.Find(&reports) // <-ERROR
		ctx.JSON(reports)
	} else {
		ctx.StatusCode(iris.StatusBadRequest)
		ctx.JSON(iris.Map{"STATUS": "ERROR", "DESCRIPTION": "BAD REQUEST",})
	}
}

I am trying to setup a deep learning machine with dual rtx 3070 gpus in Ubuntu 20.04. I have installed Nvidia drivers 460,CUDA 11.2 and Cudnn 8.1. When i try to test the gpu with a sample tensorflow code i am getting CUDA_ERROR_ILLEGAL_ADDRESS on both GPUs. Can someone let me know what the issue is?

Hitting this issue in Python3.8 and 3.9 and also in tensorflow 2.5.0,2.9.0

Mon Jun 27 14:10:22 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.91.03    Driver Version: 460.91.03    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce RTX 3070    Off  | 00000000:09:00.0 Off |                  N/A |
| 57%   46C    P8    28W / 270W |     15MiB /  7979MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  GeForce RTX 3070    Off  | 00000000:0A:00.0 Off |                  N/A |
|  0%   48C    P8    23W / 270W |      5MiB /  7982MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1264      G   /usr/lib/xorg/Xorg                  9MiB |
|    0   N/A  N/A      1463      G   /usr/bin/gnome-shell                3MiB |
|    1   N/A  N/A      1264      G   /usr/lib/xorg/Xorg                  4MiB |
+-----------------------------------------------------------------------------+
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Sun_Feb_14_21:12:58_PST_2021
Cuda compilation tools, release 11.2, V11.2.152
Build cuda_11.2.r11.2/compiler.29618528_0
2022-06-27 13:59:11.843491: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0
2022-06-27 13:59:12.901104: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcuda.so.1
2022-06-27 13:59:12.943243: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:12.943685: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1733] Found device 0 with properties:
pciBusID: 0000:09:00.0 name: GeForce RTX 3070 computeCapability: 8.6
coreClock: 1.815GHz coreCount: 46 deviceMemorySize: 7.79GiB deviceMemoryBandwidth: 417.29GiB/s
2022-06-27 13:59:12.943725: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:12.944127: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1733] Found device 1 with properties:
pciBusID: 0000:0a:00.0 name: GeForce RTX 3070 computeCapability: 8.6
coreClock: 1.815GHz coreCount: 46 deviceMemorySize: 7.79GiB deviceMemoryBandwidth: 417.29GiB/s
2022-06-27 13:59:12.944141: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0
2022-06-27 13:59:12.945421: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcublas.so.11
2022-06-27 13:59:12.945447: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcublasLt.so.11
2022-06-27 13:59:12.945900: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcufft.so.10
2022-06-27 13:59:12.946021: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcurand.so.10
2022-06-27 13:59:12.946360: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcusolver.so.11
2022-06-27 13:59:12.946647: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcusparse.so.11
2022-06-27 13:59:12.946717: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudnn.so.8
2022-06-27 13:59:12.946758: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:12.947192: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:12.947610: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:12.948028: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:12.948421: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1871] Adding visible gpu devices: 0, 1
2022-06-27 13:59:12.948662: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-06-27 13:59:13.250592: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:13.250986: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1733] Found device 0 with properties:
pciBusID: 0000:09:00.0 name: GeForce RTX 3070 computeCapability: 8.6
coreClock: 1.815GHz coreCount: 46 deviceMemorySize: 7.79GiB deviceMemoryBandwidth: 417.29GiB/s
2022-06-27 13:59:13.251025: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:13.251384: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1733] Found device 1 with properties:
pciBusID: 0000:0a:00.0 name: GeForce RTX 3070 computeCapability: 8.6
coreClock: 1.815GHz coreCount: 46 deviceMemorySize: 7.79GiB deviceMemoryBandwidth: 417.29GiB/s
2022-06-27 13:59:13.251420: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:13.251794: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:13.252260: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:13.252633: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:13.252984: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1871] Adding visible gpu devices: 0, 1
2022-06-27 13:59:13.253013: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0
2022-06-27 13:59:13.721007: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1258] Device interconnect StreamExecutor with strength 1 edge matrix:
2022-06-27 13:59:13.721033: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1264]      0 1
2022-06-27 13:59:13.721041: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1277] 0:   N N
2022-06-27 13:59:13.721045: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1277] 1:   N N
2022-06-27 13:59:13.721180: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:13.721614: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:13.722002: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:13.722382: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:13.722757: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:13.723125: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1418] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6114 MB memory) -> physical GPU (device: 0, name: GeForce RTX 3070, pci bus id: 0000:09:00.0, compute capability: 8.6)
2022-06-27 13:59:13.723332: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-06-27 13:59:13.723699: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1418] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:1 with 6126 MB memory) -> physical GPU (device: 1, name: GeForce RTX 3070, pci bus id: 0000:0a:00.0, compute capability: 8.6)
2022-06-27 13:59:14.182153: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:176] None of the MLIR Optimization Passes are enabled (registered 2)
2022-06-27 13:59:14.201622: I tensorflow/core/platform/profile_utils/cpu_utils.cc:114] CPU Frequency: 3700310000 Hz
Epoch 1/10
2022-06-27 13:59:14.370438: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcublas.so.11
2022-06-27 13:59:14.763996: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcublasLt.so.11
2022-06-27 13:59:14.764035: I tensorflow/stream_executor/cuda/cuda_blas.cc:1838] TensorFloat-32 will be used for the matrix multiplication. This will only be logged once.
1563/1563 [==============================] - 3s 1ms/step - loss: 1.8131 - accuracy: 0.3549
Epoch 2/10
 500/1563 [========>.....................] - ETA: 1s - loss: 1.6540 - accuracy: 0.4167Traceback (most recent call last):
  File "/home/vicky/testtf/testf.py", line 24, in <module>
    model_gpu.fit(X_train_scaled, y_train_encoded, epochs = 10)
  File "/home/vicky/testtf/tf/lib/python3.9/site-packages/tensorflow/python/keras/engine/training.py", line 1188, in fit
    callbacks.on_train_batch_end(end_step, logs)
  File "/home/vicky/testtf/tf/lib/python3.9/site-packages/tensorflow/python/keras/callbacks.py", line 457, in on_train_batch_end
    self._call_batch_hook(ModeKeys.TRAIN, 'end', batch, logs=logs)
  File "/home/vicky/testtf/tf/lib/python3.9/site-packages/tensorflow/python/keras/callbacks.py", line 317, in _call_batch_hook
    self._call_batch_end_hook(mode, batch, logs)
  File "/home/vicky/testtf/tf/lib/python3.9/site-packages/tensorflow/python/keras/callbacks.py", line 337, in _call_batch_end_hook
    self._call_batch_hook_helper(hook_name, batch, logs)
  File "/home/vicky/testtf/tf/lib/python3.9/site-packages/tensorflow/python/keras/callbacks.py", line 375, in _call_batch_hook_helper
    hook(batch, logs)
  File "/home/vicky/testtf/tf/lib/python3.9/site-packages/tensorflow/python/keras/callbacks.py", line 1029, in on_train_batch_end
    self._batch_update_progbar(batch, logs)
  File "/home/vicky/testtf/tf/lib/python3.9/site-packages/tensorflow/python/keras/callbacks.py", line 1101, in _batch_update_progbar
    logs = tf_utils.sync_to_numpy_or_python_type(logs)
  File "/home/vicky/testtf/tf/lib/python3.9/site-packages/tensorflow/python/keras/utils/tf_utils.py", line 519, in sync_to_numpy_or_python_type
    return nest.map_structure(_to_single_numpy_or_python_type, tensors)
  File "/home/vicky/testtf/tf/lib/python3.9/site-packages/tensorflow/python/util/nest.py", line 867, in map_structure
    structure[0], [func(*x) for x in entries],
  File "/home/vicky/testtf/tf/lib/python3.9/site-packages/tensorflow/python/util/nest.py", line 867, in <listcomp>
    structure[0], [func(*x) for x in entries],
  File "/home/vicky/testtf/tf/lib/python3.9/site-packages/tensorflow/python/keras/utils/tf_utils.py", line 515, in _to_single_numpy_or_python_type
    x = t.numpy()
  File "/home/vicky/testtf/tf/lib/python3.9/site-packages/tensorflow/python/framework/ops.py", line 1094, in numpy
    maybe_arr = self._numpy()  # pylint: disable=protected-access
  File "/home/vicky/testtf/tf/lib/python3.9/site-packages/tensorflow/python/framework/ops.py", line 1062, in _numpy
    six.raise_from(core._status_to_exception(e.code, e.message), None)  # pylint: disable=protected-access
  File "<string>", line 3, in raise_from
tensorflow.python.framework.errors_impl.InternalError: Could not synchronize CUDA stream: CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered

This is the sample code i am running

import tensorflow as tf
from tensorflow import keras
import numpy as np
(X_train, y_train), (X_test, y_test) = keras.datasets.cifar10.load_data()
# scaling image values between 0-1
X_train_scaled = X_train/255
X_test_scaled = X_test/255
# one hot encoding labels
y_train_encoded = keras.utils.to_categorical(y_train, num_classes = 10, dtype = 'float32')
y_test_encoded = keras.utils.to_categorical(y_test, num_classes = 10, dtype = 'float32')
def get_model():
    model = keras.Sequential([
        keras.layers.Flatten(input_shape=(32,32,3)),
        keras.layers.Dense(3000, activation='relu'),
        keras.layers.Dense(1000, activation='relu'),
        keras.layers.Dense(10, activation='sigmoid')
    ])
    model.compile(optimizer='SGD',
              loss='categorical_crossentropy',
              metrics=['accuracy'])
    return model
with tf.device('/GPU:0'):
    model_gpu = get_model()
    model_gpu.fit(X_train_scaled, y_train_encoded, epochs = 10)

windows10 pro, NVIDIA GeForce RTX 2080 SUPER, GPU Memory2,4/39,9 GB, deeplabcut2.2b8

Hi all,

So I am a bit frustrated with this error I am getting. I start to train the network and then suddenly I get this weird error (below). It doesn’t matter if the iteration was 24,000 or 500, I get it over and over again.

 `Selecting multi-animal trainer
Config:
{'all_joints': [[0], [1], [2], [3], [4]],
 'all_joints_names': ['snout', 'ear1', 'ear2', 'tail base', 'tail end'],
 'batch_size': 8,
 'crop_pad': 0,
 'cropratio': 0.4,
 'dataset': 'training-datasets\iteration-0\UnaugmentedDataSet_MULTINov29\MULTI_ornaim95shuffle5.pickle',
 'dataset_type': 'multi-animal-imgaug',
 'deterministic': False,
 'display_iters': 500,
 'fg_fraction': 0.25,
 'global_scale': 0.8,
 'init_weights': 'C:\Users\orna\.conda\envs\dlc-gpu\lib\site-packages\deeplabcut\pose_estimation_tensorflow\models\pretrained\resnet_v1_50.ckpt',
 'intermediate_supervision': False,
 'intermediate_supervision_layer': 12,
 'location_refinement': True,
 'locref_huber_loss': True,
 'locref_loss_weight': 0.05,
 'locref_stdev': 7.2801,
 'log_dir': 'log',
 'max_input_size': 1500,
 'mean_pixel': [123.68, 116.779, 103.939],
 'metadataset': 'training-datasets\iteration-0\UnaugmentedDataSet_MULTINov29\Documentation_data-MULTI_95shuffle5.pickle',
 'min_input_size': 64,
 'mirror': False,
 'multi_step': [[0.0001, 7500], [5e-05, 12000], [1e-05, 200000]],
 'net_type': 'resnet_50',
 'num_joints': 5,
 'num_limbs': 10,
 'optimizer': 'adam',
 'pafwidth': 20,
 'pairwise_huber_loss': False,
 'pairwise_loss_weight': 0.1,
 'pairwise_predict': False,
 'partaffinityfield_graph': [[0, 1],
                             [1, 2],
                             [1, 3],
                             [1, 4],
                             [2, 3],
                             [0, 4],
                             [2, 4],
                             [0, 3],
                             [3, 4],
                             [0, 2]],
 'partaffinityfield_predict': True,
 'pos_dist_thresh': 17,
 'project_path': 'C:\Users\orna\Desktop\dlc_projects\MULTI-ornaim-2020-11-29',
 'regularize': False,
 'rotation': 25,
 'rotratio': 0.4,
 'save_iters': 10000,
 'scale_jitter_lo': 0.5,
 'scale_jitter_up': 1.25,
 'scoremap_dir': 'test',
 'shuffle': True,
 'snapshot_prefix': 'C:\Users\orna\Desktop\dlc_projects\MULTI-ornaim-2020-11-29\dlc-models\iteration-0\MULTINov29-trainset95shuffle5\train\snapshot',
 'stride': 8.0,
 'weigh_negatives': False,
 'weigh_only_present_joints': False,
 'weigh_part_predictions': False,
 'weight_decay': 0.0001}
Activating limb prediction...
Starting with multi-animal imaug + adam pose-dataset loader.
Batch Size is 8
Getting specs multi-animal-imgaug 10 5
Initializing ResNet
Loading ImageNet-pretrained resnet_50
2020-11-29 20:42:42.928549: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
2020-11-29 20:42:43.043267: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1433] Found device 0 with properties:
name: GeForce RTX 2080 SUPER major: 7 minor: 5 memoryClockRate(GHz): 1.815
pciBusID: 0000:01:00.0
totalMemory: 8.00GiB freeMemory: 6.55GiB
2020-11-29 20:42:43.047534: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0
2020-11-29 20:42:43.316876: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-11-29 20:42:43.319096: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990]      0
2020-11-29 20:42:43.320361: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0:   N
2020-11-29 20:42:43.321758: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6279 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2080 SUPER, pci bus id: 0000:01:00.0, compute capability: 7.5)
Max_iters overwritten as 15000
Display_iters overwritten as 10
Save_iters overwritten as 500
Training parameters:
{'stride': 8.0, 'weigh_part_predictions': False, 'weigh_negatives': False, 'fg_fraction': 0.25, 'mean_pixel': [123.68, 116.779, 103.939], 'shuffle': True, 'snapshot_prefix': 'C:\Users\orna\Desktop\dlc_projects\MULTI-ornaim-2020-11-29\dlc-models\iteration-0\MULTINov29-trainset95shuffle5\train\snapshot', 'log_dir': 'log', 'global_scale': 0.8, 'location_refinement': True, 'locref_stdev': 7.2801, 'locref_loss_weight': 0.05, 'locref_huber_loss': True, 'optimizer': 'adam', 'intermediate_supervision': False, 'intermediate_supervision_layer': 12, 'regularize': False, 'weight_decay': 0.0001, 'crop_pad': 0, 'scoremap_dir': 'test', 'batch_size': 8, 'dataset_type': 'multi-animal-imgaug', 'deterministic': False, 'mirror': False, 'pairwise_huber_loss': False, 'weigh_only_present_joints': False, 'partaffinityfield_predict': True, 'pairwise_predict': True, 'all_joints': [[0], [1], [2], [3], [4]], 'all_joints_names': ['snout', 'ear1', 'ear2', 'tail base', 'tail end'], 'cropratio': 0.4, 'dataset': 'training-datasets\iteration-0\UnaugmentedDataSet_MULTINov29\MULTI_ornaim95shuffle5.pickle', 'display_iters': 500, 'init_weights': 'C:\Users\orna\.conda\envs\dlc-gpu\lib\site-packages\deeplabcut\pose_estimation_tensorflow\models\pretrained\resnet_v1_50.ckpt', 'max_input_size': 1500, 'metadataset': 'training-datasets\iteration-0\UnaugmentedDataSet_MULTINov29\Documentation_data-MULTI_95shuffle5.pickle', 'min_input_size': 64, 'multi_step': [[0.0001, 7500], [5e-05, 12000], [1e-05, 200000]], 'net_type': 'resnet_50', 'num_joints': 5, 'num_limbs': 10, 'pafwidth': 20, 'pairwise_loss_weight': 0.1, 'partaffinityfield_graph': [[0, 1], [1, 2], [1, 3], [1, 4], [2, 3], [0, 4], [2, 4], [0, 3], [3, 4], [0, 2]], 'pos_dist_thresh': 17, 'project_path': 'C:\Users\orna\Desktop\dlc_projects\MULTI-ornaim-2020-11-29', 'rotation': 25, 'rotratio': 0.4, 'save_iters': 10000, 'scale_jitter_lo': 0.5, 'scale_jitter_up': 1.25}
Starting multi-animal training....
iteration: 10 loss: 0.3964 scmap loss: 0.3097 locref loss: 0.0162 limb loss: 0.0704 lr: 0.0001
iteration: 20 loss: 0.0842 scmap loss: 0.0600 locref loss: 0.0052 limb loss: 0.0190 lr: 0.0001
...
iteration: 990 loss: 0.0153 scmap loss: 0.0141 locref loss: 0.0003 limb loss: 0.0009 lr: 0.0001
iteration: 1000 loss: 0.0146 scmap loss: 0.0135 locref loss: 0.0003 limb loss: 0.0008 lr: 0.0001
2020-11-29 20:45:27.262728: E tensorflow/stream_executor/cuda/cuda_event.cc:48] Error polling for event status: failed to query event: CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered
2020-11-29 20:45:27.266438: F tensorflow/core/common_runtime/gpu/gpu_event_mgr.cc:274] Unexpected Event status: 1`

What could be the case?
Thanks!

Почему эта программа паникует?

type Point struct {
    X, Y float64
}

func (p *Point) Abs() float64 {
    return math.Sqrt(p.X*p.X + p.Y*p.Y)
}

func main() {
    var p *Point
    fmt.Println(p.Abs())
}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0xffffffff addr=0x0 pc=0xd2c5a]

goroutine 1 [running]:
main.(*Point).Abs(...)
 ../main.go:6
main.main()
 ../main.go:11 +0x1a

Ответ

Неинициализированный указатель p в main функции равен nil, и вы не можете следовать за нулевым указателем.

Если x равен nil, попытка выполнить *x вызовет панику во время выполнения. Спецификация языка программирования Go: адресные операторы.

Вам необходимо создать Point. С помощью new:

func main() {
    var p *Point = new(Point)
    fmt.Println(p.Abs())
}

Либо с помощи литерала с оператором ссылки:

func main() {
    var p *Point = &Point{}
    fmt.Println(p.Abs())
}

Поскольку методы с получателями указателей принимают либо значение, либо указатель, вы также можете вообще пропустить указатель:

func main() {
    var p Point // имеет нулевое значение Point{X:0, Y:0}
    fmt.Println(p.Abs())
}

Читайте также:

  • Спецификация Go: типы указателя (pointer types), типы функций (function types)
  • Go FAQ: Следует ли определять методы для значений или указателей?
  • Основы Go: указатели
  • Указатели по-простому в Golang

When a property or method is called on nil, a null pointer will be reported

Especially the structure pointer, this problem is very easy to occur, the following is the test code

package tools

import "fmt"

func MyTest() {
    type MConn struct {
        Name string
    }
    var conn * MConn
    var conn2 MConn
    conn3 := new (MConn)
    conn4 := & MConn{}
    fmt.Printf("%v,%v,%v,%v" , conn, conn2, conn3, conn4)
}

Return separately

<nil>,{},&{},&{}

When a structure pointer variable var conn *MConn is declared, but it is not initialized and the property is called directly, it will appear

panic: runtime error: invalid memory address or nil pointer dereference

Because conn is nil at this time, it is a null pointer

A null operation must be performed, if conn != nil {}

Of course, we sometimes do not make such an obvious error, but when we cooperate with map, this error may occur unintentionally.

    var mMap map[ string ]* MConn
    m1: = mMap[ " name " ]
    m1.Name = " qqq "

In this code map, when the key element does not exist, the zero value of value is returned, which happens to be *MConn. The zero value is nil, and an error will also be reported.

So the map has to be judged here

    var mMap map[ string ]* MConn
    m1, ok: = mMap[ " name " ]
     if ok {
        m1.Name = " qqq " 
    }

Read More:

yourbasic.org/golang

Why does this program panic?

type Point struct {
	X, Y float64
}

func (p *Point) Abs() float64 {
	return math.Sqrt(p.X*p.X + p.Y*p.Y)
}

func main() {
	var p *Point
	fmt.Println(p.Abs())
}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0xffffffff addr=0x0 pc=0xd2c5a]

goroutine 1 [running]:
main.(*Point).Abs(...)
	../main.go:6
main.main()
	../main.go:11 +0x1a

Answer

The uninitialized pointer p in the main function is nil,
and you can’t follow the nil pointer.

If x is nil, an attempt to evaluate *x will cause a run-time panic.
The Go Programming Language Specification: Address operators

You need to create a Point:

func main() {
	var p *Point = new(Point)
	fmt.Println(p.Abs())
}

Since methods with pointer receivers take either a value or a pointer,
you could also skip the pointer altogether:

func main() {
	var p Point // has zero value Point{X:0, Y:0}
	fmt.Println(p.Abs())
}

See Pointers for more about pointers in Go.

  • « Prev
  • Index
  • Next »

Share this page:  
   
   

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Illegal constructor вайлдберриз ошибка
  • Ilife v8s ошибка e41