Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrade nvidia proprietary driver warning #1147

Merged
merged 2 commits into from
Apr 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 35 additions & 5 deletions sway/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,55 @@ void detect_proprietary() {
if (!f) {
return;
}
bool nvidia = false, nvidia_modeset = false, nvidia_uvm = false, nvidia_drm = false;
while (!feof(f)) {
char *line;
if (!(line = read_line(f))) {
break;
}
if (strstr(line, "nvidia")) {
fprintf(stderr, "\x1B[1;31mWarning: Proprietary nvidia drivers do NOT support Wayland. Use nouveau.\x1B[0m\n");
fprintf(stderr, "\x1B[1;31mYes, they STILL don't work with the newly announced wayland \"support\".\x1B[0m\n");
free(line);
break;
nvidia = true;
}
if (strstr(line, "nvidia_modeset")) {
nvidia_modeset = true;
}
if (strstr(line, "nvidia_uvm")) {
nvidia_uvm = true;
}
if (strstr(line, "nvidia_drm")) {
nvidia_drm = true;
}
if (strstr(line, "fglrx")) {
fprintf(stderr, "\x1B[1;31mWarning: Proprietary AMD drivers do NOT support Wayland. Use radeon.\x1B[0m\n");
fprintf(stderr, "\x1B[1;31mWarning: Proprietary AMD drivers do "
"NOT support Wayland. Use radeon.\x1B[0m\n");
free(line);
break;
}
free(line);
}
fclose(f);
if (nvidia) {
fprintf(stderr, "\x1B[1;31mWarning: Proprietary nvidia driver support "
"is considered experimental. Nouveau is strongly recommended."
"\x1B[0m\n");
if (!nvidia_modeset || !nvidia_uvm || !nvidia_drm) {
fprintf(stderr, "\x1B[1;31mWarning: You do not have all of the "
"necessary kernel modules loaded for nvidia support. "
"You need nvidia, nvidia_modeset, nvidia_uvm, and nvidia_drm."
"\x1B[0m\n");
}
f = fopen("/proc/cmdline", "r");
if (f) {
char *line = read_line(f);
if (line && !strstr(line, "nvidia-drm.modeset=1")) {
fprintf(stderr, "\x1B[1;31mWarning: You must add "
"nvidia-drm.modeset=1 to your kernel command line to use "
"the proprietary driver.\x1B[0m\n");
}
fclose(f);
free(line);
}
}
}

void run_as_ipc_client(char *command, char *socket_path) {
Expand Down
3 changes: 0 additions & 3 deletions sway/sway.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ rather than switch to something else.
Launch sway directly from a tty or via your favorite Wayland-compatible login
manager.

*Important note for nvidia users*: The proprietary nvidia driver does _not_ have
support for Wayland as of 2016-06-10. Use nouveau.

Commands
--------

Expand Down